CN112948529A - Dynamic text reading and writing method and device, electronic equipment and medium - Google Patents

Dynamic text reading and writing method and device, electronic equipment and medium Download PDF

Info

Publication number
CN112948529A
CN112948529A CN202110349108.1A CN202110349108A CN112948529A CN 112948529 A CN112948529 A CN 112948529A CN 202110349108 A CN202110349108 A CN 202110349108A CN 112948529 A CN112948529 A CN 112948529A
Authority
CN
China
Prior art keywords
text
language
database
operation instruction
dynamic text
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
CN202110349108.1A
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202110349108.1A priority Critical patent/CN112948529A/en
Publication of CN112948529A publication Critical patent/CN112948529A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • G06F16/316Indexing structures
    • G06F16/322Trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • 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/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • 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/36Creation of semantic tools, e.g. ontology or thesauri
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/42Data-driven translation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Machine Translation (AREA)

Abstract

The embodiment of the invention discloses a dynamic text reading and writing method, a dynamic text reading and writing device, electronic equipment and a medium. The method comprises the following steps: determining an initial database operation instruction for reading and writing a language version of a dynamic text in an application; generating a target database operation instruction according to a preset language version comparison table and the initial database operation instruction; and executing the text reading and writing operation of the multi-language version of the dynamic text through the database engine according to the target database operation instruction. The invention relates to the field of big data, and can achieve the technical effects of hiding the details of multi-language text storage and access, adapting various applications and relational databases up and down and reducing development cost by executing the technical scheme.

Description

Dynamic text reading and writing method and device, electronic equipment and medium
Technical Field
The embodiment of the invention relates to the field of big data, in particular to a dynamic text reading and writing method, a dynamic text reading and writing device, electronic equipment and a medium.
Background
At present, dynamic texts in websites or application contents are generated at the operation period of websites, so that a multi-language internationalization processing scheme is more complex, and at present, two processing modes are generally available. In the method for translating the dynamic text in real time by the client or the browser, the readability of the real-time translated text is poor, and a maintainer of a website or an application cannot update and improve the translation quality and only depends on the improvement of translation software. However, the currently common server-side processing mode, either a database-based and table-based mode or an internationalized site reconstruction mode, requires modification and adaptation of the original server side or database, which undoubtedly increases the research and development difficulty and research and development cost. Therefore, there is a need for a multilingual dynamic text reading and writing method that does not require modification and adaptation of the original server or database, and reduces the research and development difficulty and research and development cost.
Disclosure of Invention
The embodiment of the invention provides a dynamic text reading and writing method, a dynamic text reading and writing device, electronic equipment and a dynamic text reading and writing medium, so that the technical effects of hiding the details of multi-language text storage and access, vertically adapting to various applications and relational databases and reducing the development cost are achieved.
In a first aspect, an embodiment of the present invention provides a dynamic text reading and writing method, where the method includes:
determining an initial database operation instruction for reading and writing a language version of a dynamic text in an application;
generating a target database operation instruction according to a preset language version comparison table and the initial database operation instruction;
and executing the text reading and writing operation of the multi-language version of the dynamic text through the database engine according to the target database operation instruction.
In a second aspect, an embodiment of the present invention further provides a dynamic text reading/writing device, where the device includes:
the instruction determining module is used for determining an initial database operation instruction for reading and writing the language version of the dynamic text in the application;
the instruction generation module is used for generating a target database operation instruction according to a preset language version comparison table and the initial database operation instruction;
and the operation execution module is used for executing the text read-write operation of the multi-language version of the dynamic text through the database engine according to the target database operation instruction.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
storage means for storing one or more programs;
the one or more programs are executed by the one or more processors, such that the one or more processors implement a method of dynamic text reading and writing as provided in any embodiment of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the dynamic text reading and writing method provided in any embodiment of the present invention.
The embodiment of the invention provides a dynamic text reading and writing method, wherein an intermediate component deployed between databases firstly determines an initial database operation instruction for reading and writing a language version of a dynamic text in the application, then generates a target database operation instruction according to a preset language version comparison table and the initial database operation instruction, and finally executes text reading and writing operation of a multi-language version of the dynamic text through a database engine according to the target database operation instruction.
By adopting the technical scheme, the intermediate component converts the reading and writing operation of the dynamic text into the operation instruction of the initial database, then generates the operation instruction of the target database by the configured language version comparison table and the operation instruction of the initial database, transmits the operation instruction of the target database corresponding to the writing or reading operation to the database, and only executes the instruction by the database engine, so that the writing and reading of the texts of the dynamic text and the dynamic text in different language versions can be completed, the modification operation of the application and the operation rule of the database is not needed, the database is executed only by modifying the operation instruction of the database, the reading and writing requirements of the dynamic text are completed, the storage and access details of the multi-language text can be hidden, the multi-language text can be vertically adapted to the multiple applications and the relational database, and the technical effect of reducing the development cost is achieved.
The above summary of the present invention is merely an overview of the technical solutions of the present invention, and the present invention can be implemented in accordance with the content of the description in order to make the technical means of the present invention more clearly understood, and the above and other objects, features, and advantages of the present invention will be more clearly understood.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart of a dynamic text reading and writing method according to an embodiment of the present application;
FIG. 2 is a block diagram of an intermediate dynamic text read/write component according to an embodiment of the present disclosure;
fig. 3 is a flowchart of another dynamic text reading and writing method provided in the second embodiment of the present application;
fig. 4 is a write flow timing diagram of another dynamic text read/write method according to the second embodiment of the present application;
fig. 5 is a flowchart of another dynamic text reading and writing method provided in the third embodiment of the present application;
fig. 6 is a timing chart of a reading process of another dynamic text reading and writing method provided in the third embodiment of the present application;
fig. 7 is a schematic structural diagram of a dynamic text reading/writing device according to a fourth embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present application.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a dynamic text reading and writing method provided in an embodiment of the present invention, where the method is applicable to a situation where dynamic text reading and writing are performed on a database through an application or a client interface, and the method is executed by a dynamic text reading and writing apparatus, where the apparatus is implemented by software and/or hardware, and can be integrated in an electronic device. As shown in fig. 1, the dynamic text reading and writing method in this embodiment includes the following steps:
the dynamic texts in the website or the application contents are generated during the operation period of the website, so that multi-language internationalization is more complicated, because the readability of the real-time translation mode of the dynamic texts on the webpage and the application end is poor, the quality is difficult to control, the translation of the dynamic texts on most application end interfaces is realized through the processing mode of the server database end at present, but the original service needs to be modified and adapted no matter the mode of database division and table division or the mode of reconstructing an internationalized site, and the research and development difficulty and the research and development cost are increased undoubtedly. In addition, the text is stored in a database or table dividing mode often with too large granularity, for example, only one attribute in a certain model needs to be expanded into a multi-language version, and the database or table dividing mode is heavy and heavy, which wastes storage space. Therefore, reading and writing of the dynamic text of the client interface can be completed between the application end and the database end by developing the intermediate component.
S110, determining an initial database operation instruction for reading and writing the language version of the dynamic text in the application.
Wherein an intermediate component deployed between the application and the database determines an initial database operation instruction to read or write a linguistic version of dynamic text input by an application or client interface user. The language version of the input dynamic text is read or written, which can be that a user inputs an original dynamic text in a certain language, the original dynamic text needs to be translated into texts in other languages, and the texts and the original dynamic text are written into a database; or the original dynamic text in a certain language input by the user, the user needs to query (read) the translation text of the original dynamic text in other languages from the database. The database operation instruction may be an SQL statement in SQL syntax, and may specify a corresponding operation on the database, and illustratively, the SQL database operation instruction "Insert int Table (Columns) Values (Values _ ZH)" means that "Values _ ZH" is written in the address "Columns".
In an alternative of the present embodiment, it may be combined with one or more of the alternatives of the present embodiment. Before determining the initial database operation instruction for processing the language version of the dynamic text in the application, the method may further include: configuring the language version of the dynamic text to generate a language version comparison table; the language version comparison table comprises a mapping relation between the text language type and the logical model of the database adapted by the text language type.
As shown in fig. 2, the intermediate component may include a module language version module, each language corresponds to a corresponding text data table one by one, the language version comparison table may include a list of text language types, and the other list is a logical model adapted to the database corresponding to the text language type, that is, a logical position in the database.
In an alternative of the present embodiment, it may be combined with one or more of the alternatives of the present embodiment. In a dynamic text writing stage, the initial database operation instruction comprises a database writing operation instruction obtained by converting the dynamic text writing operation; in the dynamic text reading stage, the initial database operation instruction comprises a database reading operation instruction obtained by converting the dynamic text reading operation.
When the dynamic text is written on an application or a client, the intermediate component converts the operation of writing the dynamic text into a database writing operation instruction; when an application or client is performing dynamic text reading, the intermediate component converts the dynamic text reading operation into a database reading operation instruction.
And S120, generating a target database operation instruction according to the preset language version comparison table and the initial database operation instruction.
The intermediate component generates a target database operation instruction according to the pre-configured language version comparison table and the initial database operation instruction, wherein the target database operation instruction can be a write operation instruction and a read operation instruction. As shown in fig. 2, the text input/output processing module converts the writing and reading operations of the dynamic text into the operation command of the target database.
And S130, executing the text reading and writing operation of the multi-language version of the dynamic text through the database engine according to the target database operation instruction.
The intermediate component transmits the target database operation instruction to the database engine according to the target database operation instruction, and executes the text read-write operation of the multi-language version of the dynamic text through the database engine. As shown in fig. 2, the database engine executes the database operation instruction, finds out the physical location corresponding to the language N and the data N in the language comparison table from the database, and completes the writing and reading of the dynamic text of the multi-language version.
According to the technical scheme of the embodiment, the intermediate component converts the reading and writing operation of the dynamic text into the operation instruction of the initial database, then the configured language version comparison table and the operation instruction of the initial database generate the operation instruction of the target database, the operation instruction of the target database corresponding to the writing or reading operation is transmitted to the database, the instruction is executed only by the database engine, the writing and reading of the dynamic text and the text of different language versions of the dynamic text can be completed, the modification operation of the application and the operation rule of the database is not needed, the database is executed only by modifying the operation instruction of the database, the reading and writing requirements of the dynamic text are completed, the details of storing and accessing of the multi-language text can be hidden, the multi-language text can be adapted to the multiple applications and the relational database up and down, and the technical effect of reducing the development cost is achieved.
Example two
Fig. 3 is a flowchart of another dynamic text reading and writing method provided in the second embodiment of the present application. Embodiments of the present invention are further optimized on the basis of the above-mentioned embodiments, and the embodiments of the present invention may be combined with various alternatives in one or more of the above-mentioned embodiments. As shown in fig. 3, the dynamic text reading and writing method provided in the embodiment of the present invention may include the following steps:
s310, determining an initial database operation instruction for reading and writing the language version of the dynamic text in the application.
And S320, in the dynamic text writing stage, analyzing the database writing operation instruction into a grammar tree corresponding to the writing operation.
In the stage of writing the multilingual dynamic text into the database, the database writing operation instruction needs to be firstly analyzed into the syntax tree corresponding to the writing operation in the intermediate component, as shown in fig. 4, the intermediate component may include an SQL syntax analysis module, and the SQL database operation instruction corresponding to the written or modified text operation is analyzed into the corresponding syntax tree, so that the target database operation instruction can be further obtained.
S330, replacing and/or adding the grammar tree node corresponding to the writing operation according to the preset language version comparison table and the dynamic text of at least one language version acquired by translation.
The intermediate component replaces or/and appends syntax tree nodes corresponding to the writing operation according to a preset language version comparison table and at least one dynamic text of the language version obtained through translation, and the syntax tree nodes can be all nodes corresponding to the dynamic text and the language version.
In an alternative of the present embodiment, it may be combined with one or more of the alternatives of the present embodiment. Wherein, according to the pre-configured language version comparison table and the text of at least one language version obtained by translation, the syntax tree node corresponding to the write operation is replaced and/or added, and the method comprises the following steps of A1-A3:
step A1, organizing the text of the at least one language version and the dynamic text into a language text dictionary.
Step A2, determining the language comparison table item of the at least one language version in the language version comparison table according to the target language text dictionary.
And A3, replacing and/or adding the grammar tree node corresponding to the write operation according to the comparison table item of the at least one language version.
The intermediate component organizes an original dynamic text and a text of at least one language version obtained by translation to form a language text dictionary of the dynamic text, and then determines a language comparison Table item of at least one language version in a language version comparison Table according to the language text dictionary, wherein the physical position of text data corresponding to each language in the language comparison Table is the comparison Table item of each language, and exemplarily, the language comparison Table items related to an Insert Table (Columns) Values (Values _ ZH) "instruction are { Table: [ { Chinese: Table _ ZH }, { English: Table _ EN } ] }". Table _ ZH is the physical position of the Chinese text in the comparison Table, and Table _ EN is the physical position of the English text in the comparison Table. And finally, replacing or adding the nodes of the syntax tree according to the comparison table entry of each language version.
In an alternative of the present embodiment, it may be combined with one or more of the alternatives of the present embodiment. Before replacing and/or appending the syntax tree node corresponding to the write operation, the method may further include: and extracting the dynamic text in the grammar tree corresponding to the writing operation, and translating the extracted dynamic text into the text of at least one language version.
The intermediate component extracts an original dynamic text from a grammar tree corresponding to the writing operation, translates the extracted dynamic text into a text of at least one language version, and can obtain the original dynamic text and the text of at least one language version.
In an alternative of the present embodiment, it may be combined with one or more of the alternatives of the present embodiment. And the dynamic text of the at least one language version is obtained by translating the dynamic text by dynamic translation software which can be updated in real time.
In an alternative of the present embodiment, it may be combined with one or more of the alternatives of the present embodiment. Wherein after translating the extracted dynamic text into text of at least one language version, the method further comprises: and displaying the text of the at least one language version to the client so as to manually review and modify the dynamic text of the at least one language version at the client.
After the dynamic text translation is completed, the intermediate component displays the translated text of at least one language version to an application interface or a client, so that a user can manually review and modify the dynamic text of at least one language version at the client, can select to modify and optimize the text, and can also select to accept automatically translated text.
By adopting the technical scheme, the dynamic text of at least one language version is manually checked and modified on the client interface, and the dynamic translation software capable of being updated in real time is adopted, so that the efficiency of reading the translated text is improved, and the effect of improving the accuracy of the translation result of the automatic translation software is achieved.
S340, converting the syntax tree after the replacement and/or additional processing into the target database operation instruction.
The intermediate component converts the syntax tree after the replacement and/or additional processing into a target database operation instruction, as shown in fig. 4, converts the syntax tree through a syntax parsing module, and converts the syntax tree after the replacement and addition of the nodes into the target database operation instruction. For example, the original write database operation instruction may be "Insert Into Table (Columns) Values (Values _ ZH)", and the target database operation instruction after replacement and conversion may be "Insert Into Table _ ZH (Columns) Values (Values _ ZH); insert Into Table _ EN (columns) Values (Values _ EN); "the original text is the chinese text value _ ZH, and the original text and the english text value _ EN after translation are written.
And S350, executing text read-write operation of the multi-language version of the dynamic text through the database engine according to the target database operation instruction.
In an alternative of the present embodiment, it may be combined with one or more of the alternatives of the present embodiment. According to the target database operation instruction, executing text read-write operation of the multi-language version of the dynamic text through a database engine, wherein the text read-write operation comprises the following steps: and writing the dynamic text and the text of at least one language version obtained by translating the dynamic text into the database through a database engine according to the database writing operation instruction.
According to the technical scheme of the embodiment, an initially obtained database writing operation instruction is analyzed into a grammar tree corresponding to the writing operation through an intermediate component, nodes of the grammar tree are replaced and/or added according to a language version comparison table and dynamic texts of other language versions obtained through translation, the processed grammar tree is converted into a target database operation instruction, finally, the dynamic texts and texts of at least one language version obtained through translation of the dynamic texts are written into a database through a database engine according to the target database operation instruction, granularity controllable multi-language text storage of two granularities of a table level and a field level is provided through the grammar tree and a pre-configured language version comparison table, the intermediate component upwards applies hidden multi-language text storage and access details, adapts to various intrusion relational databases downwards without a service end code and a database driving code, the effect of the invisible and non-sensible multi-language read-write service is provided.
EXAMPLE III
Fig. 5 is a flowchart of another dynamic text reading and writing method provided in the third embodiment of the present application. Embodiments of the present invention are further optimized on the basis of the above-mentioned embodiments, and the embodiments of the present invention may be combined with various alternatives in one or more of the above-mentioned embodiments. As shown in fig. 5, the dynamic text reading and writing method provided in the embodiment of the present invention may include the following steps:
s510, determining an initial database operation instruction for reading and writing the language version of the dynamic text in the application.
S520, in the dynamic text reading stage, analyzing the database reading operation instruction into a syntax tree corresponding to the reading operation; and determining the current language environment required by the application corresponding to the client.
In the reading stage of the dynamic text, the intermediate component analyzes the database reading operation instruction into a syntax tree corresponding to the reading operation, determines a current language environment required by the application of the current client interface, can be a web interface, and detects the background language of the web interface where the current user is located. As shown in fig. 6, after the syntax parsing module of the intermediate component parses the original database operation instruction into a syntax tree, the text input output module determines the language environment of the client interface. Illustratively, the initial database read operation instruction "Select Columns From Table Where Condition",
and S530, replacing the grammar tree nodes corresponding to the reading operation according to the current language environment and the pre-configured language version comparison table.
And the intermediate component replaces the syntax tree node corresponding to the read operation instruction of the database according to the language environment of the current client and a preset language version comparison table.
In an alternative of the present embodiment, it may be combined with one or more of the alternatives of the present embodiment. Wherein, replacing the syntax tree node corresponding to the read operation according to the current language environment and the pre-configured language version comparison table may include steps B1-B2:
step B1, determining the language version comparison table item of the current language in the language version comparison table according to the current language environment.
And step B2, replacing the grammar tree node corresponding to the read operation according to the language version comparison table item of the current language.
The intermediate component determines a language version comparison table item of the current language in the language version comparison table according to the current language environment, and replaces the syntax tree node corresponding to the reading operation according to the language version comparison table item of the current language.
And S540, converting the syntax tree after the replacement processing into the target database operation instruction.
For example, if the current language context is english, the converted target database operation command is "Select Columns From Table _ EN Where Condition".
And S550, executing the text reading and writing operation of the multi-language version of the dynamic text through the database engine according to the target database operation instruction.
In an alternative of the present embodiment, it may be combined with one or more of the alternatives of the present embodiment. Wherein, according to the target database operation instruction, executing the text read-write operation of the multi-language version of the dynamic text through the database engine, and may further include: and reading out the text of the current language corresponding to the dynamic text from the database through a database engine according to the database reading-out operation instruction.
In the technical scheme of the embodiment, in the dynamic text reading stage, a database reading operation instruction is analyzed into a syntax tree corresponding to the reading operation and a current language environment required by the application corresponding to the client is determined through an intermediate component, a comparison table item of the current language environment is determined according to the language environment and a language version comparison table, a syntax tree node of the reading operation is replaced, the replaced syntax tree is converted into the database reading operation instruction and is executed by a database engine, the dynamic text reading (query) result under the current language environment is completed, granularity controllable multi-language text storage of two granularities of a table level and a field level is provided through the syntax tree and a pre-configured language version comparison table, the intermediate component upwards applies hidden multi-language text storage and access details upwards, adapts to various intrusion relational databases downwards without a service end code and a database driving code, the effect of the invisible and non-sensible multi-language read-write service is provided.
Example four
Fig. 7 is a schematic structural diagram of a dynamic text reading/writing device according to a fourth embodiment of the present invention. The device can be applied to the situation of dynamic text multilingual reading and writing of a database through an application or client interface, can be realized by software and/or hardware, and is integrated in an electronic device. The device is used for realizing the dynamic text reading and writing method provided by the embodiment. As shown in fig. 7, the dynamic text read/write apparatus provided in this embodiment includes:
an instruction determining module 710, configured to determine an initial database operation instruction for reading and writing a language version of a dynamic text in an application;
the instruction generating module 720 is configured to generate a target database operation instruction according to a preconfigured language version comparison table and the initial database operation instruction;
and the operation execution module 730 is configured to execute, by the database engine, a text read-write operation of the multilingual version of the dynamic text according to the target database operation instruction.
On the basis of the foregoing embodiment, optionally, the instruction determining module 710 is configured to:
configuring the language version of the dynamic text to generate a language version comparison table; the language version comparison table comprises a mapping relation between the text language type and the logical model of the database adapted by the text language type.
On the basis of the foregoing embodiment, optionally, the instruction determining module 710 is further configured to:
in a dynamic text writing stage, the initial database operation instruction comprises a database writing operation instruction obtained by converting the dynamic text writing operation;
in the dynamic text reading stage, the initial database operation instruction comprises a database reading operation instruction obtained by converting the dynamic text reading operation.
On the basis of the foregoing embodiment, optionally, the instruction generating module 720 is configured to:
in the dynamic text writing stage, a database writing operation instruction is analyzed into a syntax tree corresponding to the writing operation;
replacing and/or adding grammar tree nodes corresponding to the writing operation according to a preset language version comparison table and at least one language version dynamic text obtained by translation;
and converting the syntax tree after the replacement and/or addition processing into the target database operation instruction.
On the basis of the foregoing embodiment, optionally, the instruction generating module 720 is further configured to:
organizing the text of the at least one language version and the dynamic text into a language text dictionary;
determining a language comparison table item of the at least one language version in the language version comparison table according to the target language text dictionary;
and replacing and/or adding the grammar tree node corresponding to the write operation according to the comparison table entry of the at least one language version.
On the basis of the foregoing embodiment, optionally, the instruction generating module 720 is further configured to:
and extracting the dynamic text in the grammar tree corresponding to the writing operation, and translating the extracted dynamic text into the text of at least one language version.
On the basis of the foregoing embodiment, optionally, the instruction generating module 720 is further configured to:
and displaying the text of the at least one language version to the client so as to manually review and modify the dynamic text of the at least one language version at the client.
On the basis of the foregoing embodiment, optionally, the operation executing module 730 is configured to:
and writing the dynamic text and the text of at least one language version obtained by translating the dynamic text into the database through a database engine according to the database writing operation instruction.
On the basis of the foregoing embodiment, optionally, the instruction generating module 720 is further configured to:
and the dynamic text of the at least one language version is obtained by translating the dynamic text by dynamic translation software which can be updated in real time.
On the basis of the foregoing embodiment, optionally, the instruction generating module 720 is further configured to:
in the dynamic text reading stage, analyzing the database reading operation instruction into a syntax tree corresponding to the reading operation; determining a current language environment required by the application corresponding to the client;
replacing the grammar tree nodes corresponding to the read operation according to the current language environment and a pre-configured language version comparison table;
and converting the syntax tree after the replacement processing into the target database operation instruction.
On the basis of the foregoing embodiment, optionally, the instruction generating module 720 is further configured to:
determining a language version comparison table item of the current language in the language version comparison table according to the current language environment;
and replacing the grammar tree node corresponding to the read operation according to the language version comparison table entry of the current language.
On the basis of the foregoing embodiment, optionally, the operation executing module 730 is further configured to:
and reading out the text of the current language corresponding to the dynamic text from the database through a database engine according to the database reading-out operation instruction.
The dynamic text reading and writing device provided by the embodiment of the invention can execute the dynamic text reading and writing method provided by any embodiment of the invention, has corresponding functions and beneficial effects of executing the dynamic text reading and writing method, and the detailed process refers to the related operations of the dynamic text reading and writing method in the embodiment.
EXAMPLE five
Fig. 8 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present application. The embodiment of the application provides electronic equipment, and the dynamic text reading and writing device provided by the embodiment of the application can be integrated in the electronic equipment. As shown in fig. 8, the present embodiment provides an electronic device 800, which includes: one or more processors 820; the storage 810 is configured to store one or more programs, and when the one or more programs are executed by the one or more processors 820, the one or more processors 820 are enabled to implement the dynamic text reading and writing method provided in the embodiment of the present application, where the method includes:
determining an initial database operation instruction for reading and writing a language version of a dynamic text in an application;
generating a target database operation instruction according to a preset language version comparison table and the initial database operation instruction;
and executing the text reading and writing operation of the multi-language version of the dynamic text through the database engine according to the target database operation instruction.
Of course, those skilled in the art can understand that the processor 820 also implements the technical solution of the dynamic text reading and writing method provided in any embodiment of the present application.
The electronic device 800 shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 8, the electronic device 800 includes a processor 820, a storage 810, an input device 830, and an output device 840; the number of the processors 820 in the electronic device may be one or more, and one processor 820 is taken as an example in fig. 8; the processor 820, the storage 810, the input 830, and the output 840 in the electronic device may be connected by a bus or other means, such as the bus 850 in fig. 8.
The storage device 810 is a computer-readable storage medium, and can be used to store software programs, computer-executable programs, and module units, such as program instructions corresponding to the dynamic text reading and writing method in the embodiment of the present application.
The storage device 810 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the storage 810 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, storage 810 may further include memory located remotely from processor 820, which may be connected via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 830 may be used to receive input numbers, character information, or voice information, and generate key signal inputs related to user settings and function control of the electronic apparatus. The output device 840 may include a display screen, a speaker, and other electronic devices.
The electronic equipment provided by the embodiment of the application can achieve the technical effects of hiding the details of multi-language text storage and access, adapting to various applications and relational databases up and down, and reducing development cost.
EXAMPLE six
An embodiment of the present invention provides a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, is configured to perform a dynamic text reading and writing method, where the method includes:
determining an initial database operation instruction for reading and writing a language version of a dynamic text in an application;
generating a target database operation instruction according to a preset language version comparison table and the initial database operation instruction;
and executing the text reading and writing operation of the multi-language version of the dynamic text through the database engine according to the target database operation instruction.
Optionally, the program, when executed by the processor, may be further configured to perform a dynamic text reading and writing method provided in any embodiment of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a flash Memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. A computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take a variety of forms, including, but not limited to: an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. 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 case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including 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 using an Internet service provider).
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (15)

1. A dynamic text reading and writing method, performed by an intermediary component deployed between an application and a database, the method comprising:
determining an initial database operation instruction for reading and writing a language version of a dynamic text in an application;
generating a target database operation instruction according to a preset language version comparison table and the initial database operation instruction;
and executing the text reading and writing operation of the multi-language version of the dynamic text through the database engine according to the target database operation instruction.
2. The method of claim 1, prior to determining the initial database operation instructions for processing the linguistic version of the dynamic text in the application, further comprising:
configuring the language version of the dynamic text to generate a language version comparison table; the language version comparison table comprises a mapping relation between the text language type and the logical model of the database adapted by the text language type.
3. The method of claim 1,
in a dynamic text writing stage, the initial database operation instruction comprises a database writing operation instruction obtained by converting the dynamic text writing operation;
in the dynamic text reading stage, the initial database operation instruction comprises a database reading operation instruction obtained by converting the dynamic text reading operation.
4. The method of claim 3, wherein generating the target database operation instruction according to the pre-configured language version comparison table and the initial database operation instruction comprises:
in the dynamic text writing stage, a database writing operation instruction is analyzed into a syntax tree corresponding to the writing operation;
replacing and/or adding grammar tree nodes corresponding to the writing operation according to a preset language version comparison table and at least one language version dynamic text obtained by translation;
and converting the syntax tree after the replacement and/or addition processing into the target database operation instruction.
5. The method of claim 4, wherein replacing and/or appending the syntax tree node corresponding to the write operation according to the pre-configured language version comparison table and the text of the at least one language version obtained by translation comprises:
organizing the text of the at least one language version and the dynamic text into a language text dictionary;
determining a language comparison table item of the at least one language version in the language version comparison table according to the target language text dictionary;
and replacing and/or adding the grammar tree node corresponding to the write operation according to the comparison table entry of the at least one language version.
6. The method of claim 4, further comprising, before replacing and/or appending the syntax tree node corresponding to the write operation:
and extracting the dynamic text in the grammar tree corresponding to the writing operation, and translating the extracted dynamic text into the text of at least one language version.
7. The method of claim 6, further comprising, after translating the extracted dynamic text into at least one language version of text:
and displaying the text of the at least one language version to the client so as to manually review and modify the dynamic text of the at least one language version at the client.
8. The method of claim 4, wherein performing, by the database engine, the text read-write operation of the multilingual version of the dynamic text according to the target database operation instruction comprises:
and writing the dynamic text and the text of at least one language version obtained by translating the dynamic text into the database through a database engine according to the database writing operation instruction.
9. The method of claim 6, wherein the dynamic text of the at least one language version is translated by dynamic translation software that is updatable in real time.
10. The method of claim 1, wherein generating target database operation instructions according to the pre-configured language version comparison table and the initial database operation instructions comprises:
in the dynamic text reading stage, analyzing the database reading operation instruction into a syntax tree corresponding to the reading operation; determining a current language environment required by the application corresponding to the client;
replacing the grammar tree nodes corresponding to the read operation according to the current language environment and a pre-configured language version comparison table;
and converting the syntax tree after the replacement processing into the target database operation instruction.
11. The method of claim 10, wherein replacing the syntax tree node corresponding to the read operation according to the current language environment and the pre-configured language version lookup table comprises:
determining a language version comparison table item of the current language in the language version comparison table according to the current language environment;
and replacing the grammar tree node corresponding to the read operation according to the language version comparison table entry of the current language.
12. The method of claim 10, wherein performing, by the database engine, the reading and writing of the text of the multilingual version of the dynamic text according to the target database operation command further comprises:
and reading out the text of the current language corresponding to the dynamic text from the database through a database engine according to the database reading-out operation instruction.
13. A dynamic text reading/writing apparatus, comprising:
the instruction determining module is used for determining an initial database operation instruction for reading and writing the language version of the dynamic text in the application;
the instruction generation module is used for generating a target database operation instruction according to a preset language version comparison table and the initial database operation instruction;
and the operation execution module is used for executing the text read-write operation of the multi-language version of the dynamic text through the database engine according to the target database operation instruction.
14. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of dynamic text read and write of any of claims 1-12.
15. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method for dynamic text read-write according to any one of claims 1 to 12.
CN202110349108.1A 2021-03-31 2021-03-31 Dynamic text reading and writing method and device, electronic equipment and medium Pending CN112948529A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110349108.1A CN112948529A (en) 2021-03-31 2021-03-31 Dynamic text reading and writing method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110349108.1A CN112948529A (en) 2021-03-31 2021-03-31 Dynamic text reading and writing method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN112948529A true CN112948529A (en) 2021-06-11

Family

ID=76231579

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110349108.1A Pending CN112948529A (en) 2021-03-31 2021-03-31 Dynamic text reading and writing method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN112948529A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115269627A (en) * 2022-05-27 2022-11-01 上海迈伺通健康科技有限公司 Method, system, apparatus and storage medium for operating database using Chinese instruction

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115269627A (en) * 2022-05-27 2022-11-01 上海迈伺通健康科技有限公司 Method, system, apparatus and storage medium for operating database using Chinese instruction

Similar Documents

Publication Publication Date Title
US10776567B2 (en) Method for compiling page data, method, device and storage medium for page rendering
CN106775725B (en) Visual configuration editing method and device
CN108446313B (en) Data format conversion method and device
CN105518633B (en) More equipment in Web server system, application and development auxiliary system, the multi-language support method in Web server system, Web server system support method and application and development householder method
KR20220002823A (en) Method, device and electronic equipment for deploying operators in deep learning framework
US20120072831A1 (en) Method for creating a multi-lingual web page
CN111831384B (en) Language switching method, device, equipment and storage medium
CN110968601A (en) Data query processing method and device
CN106354483B (en) Data processing method and device and electronic equipment
CN112905179A (en) Mobile terminal H5 page generation method and device, electronic equipment and storage medium
CN112306620B (en) Multi-language loading method and device for user-defined form control
CN110968305A (en) Small program visualization generation method, device, device and storage medium
CN112269576A (en) Component display method and device, server and storage medium
CN114138244A (en) Method and device for automatically generating model files, storage medium and electronic equipment
CN116028028B (en) Request function generation method, device, equipment and storage medium
CN113468204A (en) Data query method, device, equipment and medium
CN110377371B (en) Style sheet system management method based on Web tag
CN112130952A (en) Multi-language display method, device, equipment and product
CN112948529A (en) Dynamic text reading and writing method and device, electronic equipment and medium
US11853685B2 (en) Transformation of resource files using mapped keys for tracking content location
CN118502857A (en) Interactive processing method, device, equipment, medium and program product of user interface
CN118278361A (en) Document generation method, device, electronic equipment and medium
CN112764718A (en) Method and device for multi-end use of codes, storage medium and electronic equipment
CN114489639A (en) File generation method, device, device and storage medium
CN114661402A (en) Interface rendering method and device, electronic equipment and computer readable 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