CN112560395A - Device and method for formatting data contained in text - Google Patents

Device and method for formatting data contained in text Download PDF

Info

Publication number
CN112560395A
CN112560395A CN202011547395.9A CN202011547395A CN112560395A CN 112560395 A CN112560395 A CN 112560395A CN 202011547395 A CN202011547395 A CN 202011547395A CN 112560395 A CN112560395 A CN 112560395A
Authority
CN
China
Prior art keywords
data
text
identifier
target data
index
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011547395.9A
Other languages
Chinese (zh)
Inventor
王宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Luster LightTech Co Ltd
Original Assignee
Luster LightTech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Luster LightTech Co Ltd filed Critical Luster LightTech Co Ltd
Priority to CN202011547395.9A priority Critical patent/CN112560395A/en
Publication of CN112560395A publication Critical patent/CN112560395A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • G06F16/316Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing

Abstract

The present application relates to the field of data processing technologies, and in particular, to a device and a method for formatting data contained in a text. The problem that a data packet needs to be manually generated, a formatted character string needs to be edited, the data packet needs to be repeatedly modified and the formatted character string needs to be solved to a certain extent in the text formatting process, and the device comprises the following components: a display for displaying a user interface containing text; a controller configured to: adding a data index into a first text, wherein the data index is used for acquiring the position of target data in the first text, the data index comprises a data name and an identifier, and the target data is of a first data type; reformatting and writing the first data type of the target data at the position corresponding to the data index into a second data type to obtain a second text; controlling the user interface to display the second text containing the target data as a second data type.

Description

Device and method for formatting data contained in text
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a device and a method for formatting data contained in a text.
Background
Text formatting is a commonly used technical means in an industrial vision system, mainly converts data in the system into a text in a specified format, and is applied to the realization of functions such as log output, prompt information display or communication sending and the like.
In the implementation of some text containing data formatting, two steps are usually included, firstly, data is extracted, the required data in the text is extracted, and a data packet is generated by packaging; and secondly, formatting the data in the data packet, and specifying the format of the text through a formatting character string.
However, the data in the data packet and the format qualifier specified by the formatting character string must correspond, and the data packet and the formatting character string should be modified simultaneously during modification, and more steps are required for operation during newly adding or modifying, and the flexibility is poor; when text formatting is performed, a user needs to manually generate a data packet, manually edit a formatted character string, and edit a cut formatted character string, and needs to master related knowledge of a character format, so that the text formatting method is difficult, complicated in steps, and poor in usability.
Disclosure of Invention
In order to solve the problems that a data packet needs to be manually generated, a formatted character string needs to be edited, the data packet needs to be repeatedly modified and the formatted character string needs to be manually generated in the text formatting process, the application provides a device and a method for formatting data contained in a text.
The embodiment of the application is realized as follows:
a first aspect of an embodiment of the present application provides an apparatus for formatting data included in a text, including: a display for displaying a user interface containing text; a controller configured to: adding a data index into a first text, wherein the data index is used for acquiring the position of target data in the first text, the data index comprises a data name and an identifier, and the target data is of a first data type; reformatting and writing the first data type of the target data at the position corresponding to the data index into a second data type to obtain a second text; controlling the user interface to display the second text containing the target data as a second data type.
A second aspect of an embodiment of the present application provides a method for formatting data included in a text, where the method includes: adding a data index into a first text, wherein the data index is used for acquiring the position of target data in the first text, the data index comprises a data name and an identifier, and the target data is of a first data type; reformatting and writing the first data type of the target data at the position corresponding to the data index into a second data type to obtain a second text; displaying the second text containing the target data as a second data type.
The technical scheme provided by the application comprises the following beneficial technical effects: by constructing a data index, the identification of target data to be formatted can be realized; furthermore, by constructing the identifier, the target data to be formatted can be quickly positioned, the processes of manually generating a data packet and compiling a formatted character string by a user are omitted, the text is directly compiled, and the flexibility and the usability of text formatting can be improved.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is a diagram illustrating a system 100 for formatting data contained in text according to an embodiment of the present application;
FIG. 2 illustrates a schematic diagram of a computing device 200 in an embodiment of the present application;
FIG. 3A is a schematic flow chart illustrating formatting of data contained in a text according to an embodiment of the present application;
FIG. 3B is a flowchart illustrating a method for formatting data contained in text according to an embodiment of the present application;
FIG. 4 is a schematic flow chart illustrating data parsing in a method for formatting data contained in a text according to an embodiment of the present application;
fig. 5 shows a schematic flowchart of formatting data included in the text according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Reference throughout this specification to "embodiments," "some embodiments," "one embodiment," or "an embodiment," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Thus, appearances of the phrases "in various embodiments," "in some embodiments," "in at least one other embodiment," or "in an embodiment" or the like throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Thus, the particular features, structures, or characteristics shown or described in connection with one embodiment may be combined, in whole or in part, with the features, structures, or characteristics of one or more other embodiments, without limitation. Such modifications and variations are intended to be included within the scope of the present application.
Fig. 1 is a schematic diagram of a system 100 for formatting data contained in text according to an embodiment of the present application. The system 100 for formatting textual inclusion data is a system that can automate the formatting of textual inclusion data for output.
System 100 for formatting data contained in text may include a server 110, at least one storage device 120, at least one network 130, one or more formatting terminals 150-1, 150-2 (i.e., components 1, 2 in the figure). The server 110 may include a processing engine 112.
In some embodiments, the server 110 may be a single server or a group of servers. The server farm can be centralized or distributed (e.g., server 110 can be a distributed system). In some embodiments, the server 110 may be local or remote. For example, server 110 may access data stored in storage device 120 via network 130. Server 110 may be directly connected to storage device 120 to access the stored data. In some embodiments, the server 110 may be implemented on a cloud platform. The cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, multiple clouds, the like, or any combination of the above.
In some embodiments, server 110 and the alert platform may be implemented on a computing device as illustrated in FIG. 2 herein, including one or more components of computing device 200.
In some embodiments, the server 110 may include a processing engine 112. Processing engine 112 may process information and/or data related to the service request to perform one or more of the functions described herein. For example, the processing engine 112 may be based on obtaining data collected by the formatting terminal 150 and sending it to the storage device 120 via the network 130 for updating the data stored therein. In some embodiments, processing engine 112 may include one or more processors. The processing engine 112 may include one or more hardware processors, such as a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), an application specific instruction set processor (ASIP), an image processor (GPU), a physical arithmetic processor (PPU), a Digital Signal Processor (DSP), a field-programmable gate array (FPGA), a Programmable Logic Device (PLD), a controller, a micro-controller unit, a Reduced Instruction Set Computer (RISC), a microprocessor, or the like, or any combination of the above.
Storage device 120 may store data and/or instructions. In some embodiments, storage device 120 may store data obtained from formatting terminal 150. In some embodiments, storage device 120 may store data and/or instructions for execution or use by server 110, which server 110 may execute or use to implement the embodiment methods described herein. In some embodiments, storage device 120 may include mass storage, removable storage, volatile read-write memory, read-only memory (ROM), the like, or any combination of the above. In some embodiments, storage device 120 may be implemented on a cloud platform. For example, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, multiple clouds, the like, or any combination of the above.
In some embodiments, storage device 120 may be connected to network 130 to enable communication with one or more components in system 100 for formatting data contained in text. One or more components of system 100 for formatting data contained in text may access data or instructions stored in storage device 120 via network 130. In some embodiments, the storage device 120 may be directly connected to or in communication with one or more components of the system 100 for formatting data contained in text. In some embodiments, storage device 120 may be part of server 110.
The network 130 may facilitate the exchange of information and/or data. In some embodiments, one or more components of system 100 for formatting data contained in text may send information and/or data to other components of system 100 for formatting data contained in text over network 130. For example, server 110 may obtain/obtain requests from formatting terminal 150 via network 130. In some embodiments, the network 130 may be any one of a wired network or a wireless network, or a combination thereof. In some embodiments, the network 130 may include one or more network access points. For example, the network 130 may include wired or wireless network access points, such as base stations and/or Internet switching points 130-1, 130-2, and so forth. Through the access point, one or more components of system 100 for formatting data contained in text may connect to network 130 to exchange data and/or information.
Formatting terminal 150 may include a display, an image recognition device, a camera, a text reading device, and the like. In some embodiments, formatting terminal 150 may read the first text to be formatted for output. In some embodiments, formatting terminal 150 may send the various collected data information to one or more devices in system 100 for formatting data contained in text. For example, formatting terminal 150 may send data identifying, capturing, and sending the first text to server 110 for processing or storage in storage device 120.
FIG. 2 is a schematic diagram of an exemplary computing device 200 shown in accordance with some embodiments of the present application.
Server 110, storage device 120 may be implemented on computing device 200. For example, the processing engine 112 may be implemented on the computing device 200 and configured to implement the functionality disclosed herein.
Computing device 200 may include any components used to implement the systems described herein. For example, the processing engine 112 may be implemented on the computing device 200 by its hardware, software programs, firmware, or a combination thereof. For convenience, only one computer is depicted in the figures, but the computational functions described herein in connection with the traffic data prediction system 100 may be implemented in a distributed manner by a set of similar platforms to distribute the processing load of the system.
Computing device 200 may include a communication port 250 for connecting to a network for enabling data communication. Computing device 200 may include a processor 220 that may execute program instructions in the form of one or more processors. An exemplary computer platform may include an internal bus 210, various forms of program memory and data storage including, for example, a hard disk 270, and Read Only Memory (ROM)230 or Random Access Memory (RAM)240 for storing various data files that are processed and/or transmitted by the computer. An exemplary computing device may include program instructions stored in read-only memory 230, random access memory 240, and/or other types of non-transitory storage media that are executed by processor 220. The methods and/or processes of the present application may be embodied in the form of program instructions. Computing device 200 also includes input/output component 260 for supporting input/output between the computer and other components. Computing device 200 may also receive programs and data in the present disclosure via network communication.
For ease of understanding, only one processor is exemplarily depicted in fig. 2. However, it should be noted that the computing device 200 in the present application may include multiple processors, and thus the operations and/or methods described in the present application that are implemented by one processor may also be implemented by multiple processors, collectively or independently. For example, if in the present application a processor of computing device 200 performs steps 1 and 2, it should be understood that steps 1 and 2 may also be performed by two different processors of computing device 200, either collectively or independently.
Fig. 3A is a schematic flow chart illustrating formatting of data included in a text according to an embodiment of the present application.
Firstly, text editing is carried out, and the data name of the quoted data is directly inserted into a text;
after the text editing is finished, extracting target data according to the edited data name, and acquiring the value and the data type of the target data;
then, according to the type of the target data, replacing the value of the target data according to the format of the type of the target data; and after the data in the original text is completely replaced, obtaining the generated formatted text.
Fig. 3B shows a flowchart of a method for formatting data contained in text according to an embodiment of the present application.
In step 301, a data index is added to a first text, the data index is used to obtain a position of target data in the first text, the data index includes a data name and an identifier, and the target data is of a first data type.
In some embodiments, the present application provides an apparatus for formatting data contained in text, comprising a display, and a controller. The display is used for displaying a user interface containing text; the controller is configured to: adding a data index in a first text, wherein the data index is used for acquiring the position of target data in the first text, the data index comprises a data name and an identifier, and the target data is of a first data type. It should be noted that in some embodiments, the controller may include a central processing unit, a video processor, an audio processor, a graphics processor, a RAM, a ROM, a first interface to an nth interface for input/output.
For example, for target data to be formatted in the first text, the controller first needs to locate the target data in the first text, and the location of the target data can be realized by inserting a mark, for example, inserting a data index, into a position in the first text corresponding to the target data.
The data index comprises a data name and an identifier, wherein the data name represents a distinguishing attribute of the target data, for example, the target data can be known to be a circle radius, or a search result, or a length and the like through the data name; the identifier is used to enable the controller to quickly identify, locate, the target data in subsequent steps.
In some embodiments, the controller adds a data index in the first text to obtain a position of the target data in the first text, wherein the identifier comprises: a first identifier for identifying a start of the data index, and a second identifier for identifying an end of the data index.
For example, the data index locates the start position of the target data by the contained first identifier and locates the end position of the target data by the contained second identifier, so that the target data located and identified at one position can be located by a pair of identifiers.
When a user edits the first text, the data name of the data to be referred to, namely a data index is inserted into the text, and the two ends of the data name inserted by the data index are automatically labeled with identifiers $, for example
$ find round tool _001. circle radius $;
searching a result $;
it should be noted that the identifier can also be set as other symbols, or letters, or text content as required.
In some embodiments, the method for acquiring the position of the target data in the first text by adding a data index to the first text by the controller specifically includes: inserting the data name of the data index into the left side of the target data of the first text; inserting a first identifier to the left of the data name and a second identifier to the right of the target data.
For example, the target data in the first text is a circle radius value, and the controller first inserts a data name to the left of the circle radius value of the target data, which may be implemented as "circle finding tool _ 001", for example; and then the controller inserts a first identifier $onthe left side of the data name and inserts a second identifier $onthe right side of the target data circle radius value, so that the position of the target data in the first text is obtained.
For another example, in the first text, the user needs to generate an output text containing the radius of the rounding tool and the search result, and the data index can be edited as:
"radius of circle: $ find circle instrument _001. circle radius $, find result: find circle tool _001. result ".
In some embodiments, the means for formatting the data contained in the text may be embodied as a smart terminal, which may include any one of a mobile terminal, a tablet, a computer, a laptop, an AR/VR device, and the like.
In some embodiments, the display includes a display screen component for presenting a picture, and a driving component for driving image display, a component for receiving an image signal from the controller output, performing display of video content, image content, and a menu manipulation interface, and a user manipulation UI interface, and the like.
In some embodiments, the display may be implemented as at least one of a liquid crystal display, an OLED display, and a projection display, and may also be a projection device and a projection screen.
In some embodiments, a "user interface" is a media interface for interaction and information exchange between an application or operating system and a user that enables conversion between an internal form of information and a form that is acceptable to the user. A commonly used presentation form of the User Interface is a Graphical User Interface (GUI), which refers to a User Interface related to computer operations and displayed in a graphical manner. It may be an interface element such as an icon, a window, a control, etc. displayed in the display screen of the electronic device, where the control may include at least one of an icon, a button, a menu, a tab, a text box, a dialog box, a status bar, a navigation bar, a Widget, etc. visual interface elements.
In step 302, the first data type of the target data at the position corresponding to the data index is reformatted and written into a second data type to obtain a second text.
In some embodiments, the present application provides an apparatus for formatting data included in a text, wherein a controller of the apparatus is configured to reformat and write the first data type of the target data at a position corresponding to the data index into a second data type to obtain a second text.
It should be noted that the first data type is an existing data type of the first text target data, and the second data type is a target data type of data formatting.
In some embodiments, the reformatting, by the controller, the first data type of the target data at the position corresponding to the data index into a second data type to obtain a second text includes: traversing the first text, and determining the positions of the first identifier and the second identifier; intercepting a character string between the first identifier and the second identifier, and analyzing and acquiring a first data format of target data contained in the character string; and replacing the target data from the first data format to the second data format.
For example, the controller may identify one target data by traversing the identifiers in the first text by every two adjacent identifiers according to the data index that has been added in step 301;
the controller traverses the edited first text and searches for paired $, namely a first identifier and a second identifier;
after the paired identifiers are obtained, the names of the data quoted in the text between the identifiers are analyzed, and then the values and the data types of the quoted data are extracted according to the data names. In some embodiments, if two consecutive identifiers $areidentified, one identifier $maybe resolved.
Fig. 4 shows a schematic flowchart of data parsing in a method for formatting data contained in a text according to an embodiment of the present application.
In some embodiments, the reformatting, by the controller, the first data type of the target data at the position corresponding to the data index into a second data type to obtain a second text includes: traversing the first text, and determining the positions of the first identifier and the second identifier; intercepting a character string between the first identifier and the second identifier, and analyzing and acquiring a first data format of target data contained in the character string; and replacing the target data from the first data format to the second data format.
For example, after the device provided by the present application is started, the controller first reads the edit text, that is, reads the first text and edits and adds the corresponding data index; the controller sets the Index initial value to 0; the controller traverses the first text to query for an identifier contained in the text, which may be implemented as $, for example;
the controller judges whether the added identifier is contained or not when traversing each datum; if the identifier is contained, reading the identifier position as a start position start, and then setting Index to start + 1;
the controller continuously judges whether the pointer position contains an identifier or not, and if the pointer position contains the identifier, the position of the identifier is read as an end position end;
and then intercepting the character string between the start position start and the end position end by the controller for analysis, setting the pointer to be end +1, and continuously traversing the first text to search the data index of the second target data.
In some embodiments, when a plurality of target data are contained in the first text, the controller adds a corresponding number of data indexes to determine the positions of the plurality of target data in the first text.
In some embodiments, after the controller intercepts the string between the first identifier and the second identifier by traversing the first text, the controller is further configured to: continuing to traverse the first text after the second identifier; and acquiring two identifiers of the data index corresponding to the second target data, and intercepting a character string between the two identifiers.
For example, after the controller acquires the first target data position of the first text, the controller continues to determine the second data index and the corresponding second target data through the added identifier, so as to acquire the data type of the second target data, and if the data type of the target data is different from the target data type, the data type of the second target data is replaced and rewritten, so that the formatting of the first text is realized, and the second text is obtained.
In step 303, the second text containing the target data as a second data type is displayed.
And the controller controls the user interface to display the second text to obtain the output content after obtaining the formatted second text.
And the controller rewrites the data analyzed from the first text into the first text according to the target data type, namely the second data type, covers the data name in the previous text and generates a formatted second text.
Fig. 5 shows a schematic flowchart of formatting data included in the text according to an embodiment of the present application.
In some embodiments, when a user needs to output a product number, whether circle finding is successful, and a circle radius included in the first text, the user needs to manually package three items of data, namely the product number, whether circle finding is successful, and the circle radius;
then, a user needs to write a formatted character string "% n,% n,% f", wherein "% n corresponds to an integer and"% f corresponds to a floating point number;
and finally, formatting the data in the data packet through the formatting character string to generate a text.
The method and the device have the advantages that the identification of the target data to be formatted can be realized by constructing the data index; furthermore, by constructing the identifier, the target data to be formatted can be quickly positioned, the processes of manually generating a data packet and compiling a formatted character string by a user are omitted, the text is directly compiled, and the flexibility and the usability of text formatting can be improved.
Moreover, those skilled in the art will appreciate that aspects of the present application may be illustrated and described in terms of several patentable species or situations, including any new and useful combination of processes, machines, manufacture, or materials, or any new and useful improvement thereon. Accordingly, various aspects of the present application may be embodied entirely in hardware, entirely in software (including firmware, resident software, micro-code, etc.) or in a combination of hardware and software. The above hardware or software may be referred to as "data blocks," modules, "" engines, "" units, "" components, "or" systems. Furthermore, aspects of the present application may be represented as a computer product, including computer readable program code, embodied in one or more computer readable media.
The computer storage medium may comprise a propagated data signal with computer program code embodied therewith, for example, on baseband or as part of a carrier wave. The propagated signal may take any of a variety of forms, including electromagnetic, optical, etc., or any suitable combination. A computer storage medium may be any computer-readable medium that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code located on a computer storage medium may be propagated over any suitable medium, including radio, cable, fiber optic cable, RF, or the like, or any combination of the preceding.
Computer program code required for the operation of various portions of the present application may be written in any one or more programming languages, including an object oriented programming language such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C + +, C #, VB.NET, Python, and the like, a conventional programming language such as C, Visual Basic, Fortran 2003, Perl, COBOL 2002, PHP, ABAP, a dynamic programming language such as Python, Ruby, and Groovy, or other programming languages, and the like. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any network format, such as a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet), or in a cloud computing environment, or as a service, such as a software as a service (SaaS).
It is to be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that an article or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the use of the phrase "comprising a. -. said" to define an element does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
It is to be understood that the present application is not limited to what has been described above, and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (12)

1. An apparatus for formatting data contained in text, comprising:
a display for displaying a user interface containing text;
a controller configured to:
adding a data index into a first text, wherein the data index is used for acquiring the position of target data in the first text, the data index comprises a data name and an identifier, and the target data is of a first data type;
reformatting and writing the first data type of the target data at the position corresponding to the data index into a second data type to obtain a second text;
controlling the user interface to display the second text containing the target data as a second data type.
2. The apparatus of claim 1, wherein the controller adds a data index to the first text to obtain the location of the target data in the first text, and wherein the identifier comprises:
a first identifier for identifying a start of the data index, and a second identifier for identifying an end of the data index.
3. The apparatus according to claim 2, wherein the controller adds a data index to the first text to obtain a position of the target data in the first text, and specifically comprises the controller:
inserting the data name of the data index into the left side of the target data of the first text;
inserting a first identifier to the left of the data name and a second identifier to the right of the target data.
4. The apparatus according to claim 1, wherein the controller reformats and writes the first data type of the target data at the location corresponding to the data index into a second data type to obtain a second text, and specifically comprises the controller:
traversing the first text, and determining the positions of the first identifier and the second identifier;
intercepting a character string between the first identifier and the second identifier, and analyzing and acquiring a first data format of target data contained in the character string;
and replacing the target data from the first data format to the second data format.
5. The apparatus according to claim 1 or 4, wherein when a plurality of target data are included in the first text, the controller adds a corresponding number of data indexes to determine positions of the plurality of target data in the first text.
6. The apparatus of claim 4, wherein after the controller intercepts the string between the first identifier and the second identifier through the first text, the controller is further configured to:
continuing to traverse the first text after the second identifier;
and acquiring two identifiers of the data index corresponding to the second target data, and intercepting a character string between the two identifiers.
7. A method for formatting data contained in text, the method comprising:
adding a data index into a first text, wherein the data index is used for acquiring the position of target data in the first text, the data index comprises a data name and an identifier, and the target data is of a first data type;
reformatting and writing the first data type of the target data at the position corresponding to the data index into a second data type to obtain a second text;
displaying the second text containing the target data as a second data type.
8. The method of claim 7, wherein adding a data index to the first text obtains a location of the target data in the first text, wherein the identifier comprises:
a first identifier for identifying a start of the data index, and a second identifier for identifying an end of the data index.
9. The method for formatting data included in a text according to claim 8, wherein adding a data index to the first text to obtain a position of the target data in the first text specifically includes:
inserting the data name of the data index into the left side of the target data of the first text;
inserting a first identifier to the left of the data name and a second identifier to the right of the target data.
10. The method for formatting data included in a text according to claim 7, wherein reformatting the first data type of the target data at the position corresponding to the data index into a second data type to obtain a second text specifically includes:
traversing the first text, and determining the positions of the first identifier and the second identifier;
intercepting a character string between the first identifier and the second identifier, and analyzing and acquiring a first data format of target data contained in the character string;
and replacing the target data from the first data format to the second data format.
11. The method according to claim 7 or 10, wherein when a plurality of target data are contained in the first text, a corresponding number of data indexes are added to determine the positions of the plurality of target data in the first text.
12. The method of claim 10, wherein after traversing the first text to intercept a string between the first identifier and the second identifier, the method further comprises:
continuing to traverse the first text after the second identifier;
and acquiring two identifiers of the data index corresponding to the second target data, and intercepting a character string between the two identifiers.
CN202011547395.9A 2020-12-24 2020-12-24 Device and method for formatting data contained in text Pending CN112560395A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011547395.9A CN112560395A (en) 2020-12-24 2020-12-24 Device and method for formatting data contained in text

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011547395.9A CN112560395A (en) 2020-12-24 2020-12-24 Device and method for formatting data contained in text

Publications (1)

Publication Number Publication Date
CN112560395A true CN112560395A (en) 2021-03-26

Family

ID=75032454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011547395.9A Pending CN112560395A (en) 2020-12-24 2020-12-24 Device and method for formatting data contained in text

Country Status (1)

Country Link
CN (1) CN112560395A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101925895A (en) * 2007-12-13 2010-12-22 谷歌公司 Generic format for efficient transfer data
CN106469158A (en) * 2015-08-17 2017-03-01 杭州海康威视系统技术有限公司 Method of data synchronization and device
CN107015948A (en) * 2017-03-16 2017-08-04 武汉斗鱼网络科技有限公司 A kind of log information formatting method and system
CN109240884A (en) * 2018-08-30 2019-01-18 郑州云海信息技术有限公司 A kind of system file display methods and device
CN109325009A (en) * 2018-09-19 2019-02-12 亚信科技(成都)有限公司 The method and device of log parsing
CN110688347A (en) * 2019-09-24 2020-01-14 Oppo广东移动通信有限公司 File storage method, file storage device and terminal equipment
CN111783401A (en) * 2020-07-23 2020-10-16 网易(杭州)网络有限公司 Character string processing method and device, computer storage medium and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101925895A (en) * 2007-12-13 2010-12-22 谷歌公司 Generic format for efficient transfer data
CN106469158A (en) * 2015-08-17 2017-03-01 杭州海康威视系统技术有限公司 Method of data synchronization and device
CN107015948A (en) * 2017-03-16 2017-08-04 武汉斗鱼网络科技有限公司 A kind of log information formatting method and system
CN109240884A (en) * 2018-08-30 2019-01-18 郑州云海信息技术有限公司 A kind of system file display methods and device
CN109325009A (en) * 2018-09-19 2019-02-12 亚信科技(成都)有限公司 The method and device of log parsing
CN110688347A (en) * 2019-09-24 2020-01-14 Oppo广东移动通信有限公司 File storage method, file storage device and terminal equipment
CN111783401A (en) * 2020-07-23 2020-10-16 网易(杭州)网络有限公司 Character string processing method and device, computer storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN109634598B (en) Page display method, device, equipment and storage medium
CN106598612B (en) Operation method and system for data table in database
US9195456B2 (en) Managing a catalog of scripts
US20240103928A1 (en) Information processing method and apparatus for animation resource, device, medium and product
CN112445693A (en) Page update detection method, device, equipment and storage medium
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN111428165A (en) Three-dimensional model display method and device and electronic equipment
WO2023273700A1 (en) Interaction window display method and apparatus, device, and storage medium
US8701086B2 (en) Simplifying analysis of software code used in software systems
CN110502317B (en) Transaction management method and device
CN108694172B (en) Information output method and device
CN113485744A (en) Code synchronization method and device
CN112560395A (en) Device and method for formatting data contained in text
CN115167822A (en) Branch code merging method, device, equipment and storage medium
CN111124541A (en) Configuration file generation method, device, equipment and medium
CN116028062A (en) Target code generation method, NPU instruction display method and device
CN115562686A (en) Lightweight packaging method, system, terminal and storage medium for Springboot project
CN115328736A (en) Probe deployment method, device, equipment and storage medium
CN111209075B (en) Multilingual interface maintenance method, system, storage medium and intelligent device
CN113361286A (en) Information prompting method and device
CN113127408A (en) Data conversion method and device
CN111651531A (en) Data import method, device, equipment and computer storage medium
CN112711400B (en) View processing method, device and storage medium
CN117112021B (en) Route configuration generation method, device, equipment and computer readable storage medium
CN110633181B (en) Visual display method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination