CN111177484A - System and method for loading and managing different data sources and format character string resource files - Google Patents
System and method for loading and managing different data sources and format character string resource files Download PDFInfo
- Publication number
- CN111177484A CN111177484A CN201911250027.5A CN201911250027A CN111177484A CN 111177484 A CN111177484 A CN 111177484A CN 201911250027 A CN201911250027 A CN 201911250027A CN 111177484 A CN111177484 A CN 111177484A
- Authority
- CN
- China
- Prior art keywords
- character string
- resource
- loading
- string resource
- different
- 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
Links
- 238000011068 loading method Methods 0.000 title claims abstract description 58
- 238000000034 method Methods 0.000 title claims abstract description 20
- 238000004458 analytical method Methods 0.000 claims abstract description 17
- 238000002347 injection Methods 0.000 claims abstract description 6
- 239000007924 injection Substances 0.000 claims abstract description 6
- 238000007726 management method Methods 0.000 claims description 22
- 230000004044 response Effects 0.000 claims description 18
- 230000000977 initiatory effect Effects 0.000 claims description 5
- 239000000284 extract Substances 0.000 claims 1
- 230000001419 dependent effect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/90335—Query processing
Abstract
The invention discloses a loading management system and a method for different data sources and format character string resource files, wherein a character string resource memory comprises the following components: the key and the value obtained by analyzing the character string resource analyzer are stored; string resource loader: the method comprises the following steps that different implementation classes are injected in an interface mode in a dependent injection mode, so that loading of different data sources is realized; the character string resource analyzer: the method exists in the form of an interface, and different implementation classes are injected in a mode depending on injection, so that the analysis of character string records with different formats and forms is realized, and keys and values are separated. By using the management system, the loader and the parser only need to be written once according to actual conditions, then the multiplexing can be continuously carried out, and in the using process, except for initializing and selecting different loaders and parsers, the using modes are all consistent.
Description
Technical Field
The invention relates to loading and management of character string resource files of different data sources and data formats, in particular to a loading management system and method supporting different data sources and format character string resource files.
Background
The currently disclosed universal character string resource file loading scheme is single in form, most of the schemes are based on the implementation mode of a simple character string file, and if a company product always follows a scheme from project establishment to the end, the scheme can be adopted without using multiple frames. However, if a project is loaded for historical reasons and aiming at different data sources and character string resource files in data formats, many sets of schemes need to be maintained simultaneously, and because the modes are not uniform, the maintenance and the adaptation are difficult. Some frames load character strings are text files with custom formats in the loaded items, some frames load through databases (such as MySQL, Oracle and SQL Server), and some frames load in a JSON reading mode. It is even more cumbersome if cross-company collaboration is also involved.
The mainstream schemes in the market are single schemes. For a plurality of schemes with different forms adopted in a project, redesign is needed to support mixed implementation and expansion of the multiple schemes.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a loading management system and method for different data sources and format character string resource files aiming at the defects of the prior art. Method for loading and managing character string resource files of different data sources and data formats by using a set of unified method
The technical scheme of the invention is as follows:
a loading management system for different data sources and format character string resource files comprises a character string resource container, wherein the character string resource container is provided with a character string resource memory, a character string resource loader and a character string resource analyzer; string resource memory: the key and the value obtained by analyzing the character string resource analyzer are stored; string resource loader: exist in the form of the interface, through depending on the way of pouring into, pour into different implementation classes, thus realize the loading to different data sources, the data source includes: files, databases, network interfaces; the character string resource analyzer: the method exists in the form of an interface, and different implementation classes are injected in a mode depending on injection, so that the analysis of character string records with different formats and forms is realized, and keys and values are separated.
The loading management system, the character string resource loader, the loader for presetting different data sources according to the characteristics of the data sources, comprises:
a file resource loader:
loading the file character string resource by using a loading mode of a file stream through a file path;
a database loader:
different database drivers are used for connecting various databases through the connection configuration of the databases, so that the loading of character string resources in a database table is realized;
web interface resource loader:
and initiating an HTTP request through the Web interface, and acquiring the character string resource from the HTTP response to load the character string resource returned by the Web server interface.
In the loading management system, different resolvers are preset in the character string resource resolver, the format of the character string resource resolver is resolved to obtain keys and values according to the character string record type transmitted to the character string resource resolver, and the key and the value are returned to the character string resource storage after the universal character string record is extracted.
In the loading management system, the different resolvers include:
separator string parser:
the separator character string resolver splits character strings on two sides of the separator to obtain keys and values, constructs the keys and the values into a universal character string recording object and returns the universal character string recording object to the character string resource storage;
the database table records parser:
the character string records loaded by the database character string loader are all general table type records, and the database table record analyzer can analyze keys and values in the type records to form general character string record objects and then return the general character string record objects to the character string resource storage;
the Web interface responds the resolver:
analyzing the character string record obtained from the HTTP response; and aiming at different formats of the character strings in the response, automatically analyzing keys and values in the records in the corresponding formats according to needs, constructing a universal character string record object, and returning the universal character string record object to the character string resource memory.
A loading management method for different data sources and format character string resource files adopts the loading management system, and comprises the following steps:
step 1: initializing a character string resource container, and selecting an applicable character string resource loader and an applicable character string resource analyzer aiming at a data source;
step 2: the character string resource loader calls different loading methods to load all character string resource records from a data source;
and step 3: calling different analysis methods in a character string resource analyzer to analyze each loaded resource record, and analyzing to obtain a key and a value;
and 4, step 4: storing the keys and values obtained by analyzing each resource record into a character string resource memory one by one;
and 5: when in use, the corresponding value is obtained from the character string resource memory by transferring the key into the character string resource memory.
In the loading management method, in step 2, the character string resource loader calls different loading methods, including one of the following loading methods:
the file resource loading method comprises the following steps:
loading the file character string resource by using a loading mode of a file stream through a file path;
the database loading method comprises the following steps:
different database drivers are used for connecting various databases through the connection configuration of the databases, so that the loading of character string resources in a database table is realized;
the Web interface resource loading method comprises the following steps:
and initiating an HTTP request through the Web interface, and acquiring the character string resource from the HTTP response to load the character string resource returned by the Web server interface.
In the loading management method, in step 3, different parsing methods in the string resource parser are called, and the different parsing methods include one of the following:
the separator character string analysis method comprises the following steps:
the separator character string analysis method is characterized in that character strings on two sides of a separator are split to obtain keys and values, and the keys and the values are constructed into a universal character string recording object and then returned to a character string resource storage;
the database table record analysis method comprises the following steps:
the character string records loaded by the database character string loading method are all general table type records, and the database table record analysis method can analyze keys and values in the type records to form a general character string record object and then return the general character string record object to a character string resource storage;
the Web interface response analysis method comprises the following steps:
analyzing the character string record obtained from the HTTP response; and aiming at different formats of the character strings in the response, automatically analyzing keys and values in the records in the corresponding formats according to needs, constructing a universal character string record object, and returning the universal character string record object to the character string resource memory.
By adopting the scheme, the invention designs a unified extensible configurable multi-data-source multi-format character string resource loading scheme.
Drawings
FIG. 1 is a schematic diagram of a load management system architecture;
FIG. 2 is a schematic diagram of a string resource loader assembly;
FIG. 3 is a schematic diagram of a delimiter string parser assembly;
Detailed Description
The present invention will be described in detail with reference to specific examples.
Referring to fig. 1-3, a loading management system supporting different data sources and format string resource files includes a string resource container provided with a string resource memory, a string resource loader, and a string resource parser;
string resource memory: the key and the value obtained by the analysis of the resource analyzer are stored; string resource loader: existing in the form of an interface, different implementation classes can be injected in a manner of injection dependence, so as to realize loading of different data sources, for example: files, databases, network interfaces, and the like. The character string resource analyzer: the method exists in an interface form, and different implementation classes can be injected in a mode depending on injection, so that the analysis of character string records with different formats and forms is realized, and keys and values are separated.
The character string resource loader presets loading methods of different data sources according to the characteristics of the data sources, and comprises the following steps:
a file resource loader:
through a file path, for example, a file string resource can be loaded in a loading mode similar to a file stream.
Database (MySQL, Oracle) loader:
through the connection configuration of the databases, different database drivers can be used for connecting various databases, and the loading of the character string resources in the database table is realized.
Web interface resource loader:
and initiating an HTTP request through the Web interface, and acquiring the character string resource from the HTTP response to load the character string resource returned by the Web server interface.
Besides the above common loading methods, different resource loaders can be realized in an extended manner for different scenes.
The character string resource analyzer is preset with various different analyzing methods, according to the character string record types transmitted to the character string resource analyzer, the format of the character string resource analyzer is analyzed to obtain keys and values, and the universal character string records are extracted and returned to the character string resource memory. The following are common:
separator string parser:
delimiters can be customized according to the stored file format, for example: -, _ and the like. The separator character string resolver splits character strings on two sides of a separator to obtain keys and values, constructs a universal character string recording object and returns the universal character string recording object to a character string resource storage.
The database table records parser:
the character string records loaded by the database character string loader are all general table type records, and the database table record analyzer can analyze keys and values in the type records to form general character string record objects and then return the general character string record objects to the character string resource storage.
The Web interface responds the resolver:
and analyzing the character string record obtained from the HTTP response. The character string in the response may be in a JSON format or an XML format, and the key and the value in the record in the corresponding format can be automatically analyzed according to the requirement, so that the character string is constructed into a universal character string record object and then returned to the character string resource storage.
In addition to the above common schemes, different resource resolvers may be implemented for different scenarios.
The working process is as follows:
step 1: initializing a character string resource container, and selecting an applicable character string resource loader and an applicable character string resource analyzer aiming at a data source; for example, selecting a file resource loader or a database (MySQL, Oracle) loader or a Web interface resource loader, and correspondingly, selecting a separator string parser or a database table record parser or a Web interface response parser;
step 2: calling a loading method, and loading all character string resource records from a data source by a character string resource loader;
and step 3: calling a character string resource analyzer to analyze each loaded resource record, and analyzing to obtain a key and a value;
and 4, step 4: storing the keys and values obtained by analyzing each resource record into a resource memory one by one;
and 5: when in use, the key is transferred into the resource memory, and the corresponding value is obtained from the resource memory;
by using the management system, the loader and the parser only need to be written once according to actual conditions, then the multiplexing can be continuously carried out, and in the using process, except for initializing and selecting different loaders and parsers, the using modes are all consistent. If the MySQL and Oracle databases exist in the project at the same time, the concept of the database table is universal, and only different loaders need to be written for the two databases respectively, and the parser of one table needs to be written. If the database storage character string resource is too burdensome and troublesome, the database storage character string resource can be stored in a mode of replacing a common text file, so that only a written file loader and a written file parser need to be replaced during initialization, and no modification is needed in any other place.
It will be understood that modifications and variations can be made by persons skilled in the art in light of the above teachings and all such modifications and variations are intended to be included within the scope of the invention as defined in the appended claims.
Claims (7)
1. A loading management system for different data sources and format character string resource files is characterized by comprising a character string resource container, wherein the character string resource container is provided with a character string resource memory, a character string resource loader and a character string resource analyzer; string resource memory: the key and the value obtained by analyzing the character string resource analyzer are stored; string resource loader: exist in the form of the interface, through depending on the way of pouring into, pour into different implementation classes, thus realize the loading to different data sources, the data source includes: files, databases, network interfaces; the character string resource analyzer: the method exists in the form of an interface, and different implementation classes are injected in a mode depending on injection, so that the analysis of character string records with different formats and forms is realized, and keys and values are separated.
2. The loading management system of claim 1, wherein the string resource loader, which presets the loaders of different data sources according to the characteristics of the data sources, comprises:
a file resource loader:
loading the file character string resource by using a loading mode of a file stream through a file path;
a database loader:
different database drivers are used for connecting various databases through the connection configuration of the databases, so that the loading of character string resources in a database table is realized;
web interface resource loader:
and initiating an HTTP request through the Web interface, and acquiring the character string resource from the HTTP response to load the character string resource returned by the Web server interface.
3. The loading management system of claim 1, wherein the string resource parser is preset with different parsers, and implements parsing of the format thereof to obtain "keys" and "values" according to the type of the string record transferred to the string resource parser, extracts the universal string record, and returns the universal string record to the string resource storage.
4. The load management system of claim 3, wherein the different resolvers comprise:
separator string parser:
the separator character string resolver splits character strings on two sides of the separator to obtain keys and values, constructs the keys and the values into a universal character string recording object and returns the universal character string recording object to the character string resource storage;
the database table records parser:
the character string records loaded by the database character string loader are all general table type records, and the database table record analyzer can analyze keys and values in the type records to form general character string record objects and then return the general character string record objects to the character string resource storage;
the Web interface responds the resolver:
analyzing the character string record obtained from the HTTP response; and aiming at different formats of the character strings in the response, automatically analyzing keys and values in the records in the corresponding formats according to needs, constructing a universal character string record object, and returning the universal character string record object to the character string resource memory.
5. A loading management method for different data sources and format character string resource files is characterized in that: the load management system of claim 1, further comprising:
step 1: initializing a character string resource container, and selecting an applicable character string resource loader and an applicable character string resource analyzer aiming at a data source;
step 2: the character string resource loader calls different loading methods to load all character string resource records from a data source;
and step 3: calling different analysis methods in a character string resource analyzer to analyze each loaded resource record, and analyzing to obtain a key and a value;
and 4, step 4: storing the keys and values obtained by analyzing each resource record into a character string resource memory one by one;
and 5: when in use, the corresponding value is obtained from the character string resource memory by transferring the key into the character string resource memory.
6. The load management method according to claim 5, wherein: in step 2, the character string resource loader calls different loading methods, including one of the following loading methods:
the file resource loading method comprises the following steps:
loading the file character string resource by using a loading mode of a file stream through a file path;
the database loading method comprises the following steps:
different database drivers are used for connecting various databases through the connection configuration of the databases, so that the loading of character string resources in a database table is realized;
the Web interface resource loading method comprises the following steps:
and initiating an HTTP request through the Web interface, and acquiring the character string resource from the HTTP response to load the character string resource returned by the Web server interface.
7. The load management method according to claim 5, wherein: in step 3, different parsing methods in the string resource parser are called, and the different parsing methods include one of the following:
the separator character string analysis method comprises the following steps:
the separator character string analysis method is characterized in that character strings on two sides of a separator are split to obtain keys and values, and the keys and the values are constructed into a universal character string recording object and then returned to a character string resource storage;
the database table record analysis method comprises the following steps:
the character string records loaded by the database character string loading method are all general table type records, and the database table record analysis method can analyze keys and values in the type records to form a general character string record object and then return the general character string record object to a character string resource storage;
the Web interface response analysis method comprises the following steps:
analyzing the character string record obtained from the HTTP response; and aiming at different formats of the character strings in the response, automatically analyzing keys and values in the records in the corresponding formats according to needs, constructing a universal character string record object, and returning the universal character string record object to the character string resource memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911250027.5A CN111177484A (en) | 2019-12-09 | 2019-12-09 | System and method for loading and managing different data sources and format character string resource files |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911250027.5A CN111177484A (en) | 2019-12-09 | 2019-12-09 | System and method for loading and managing different data sources and format character string resource files |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111177484A true CN111177484A (en) | 2020-05-19 |
Family
ID=70655403
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911250027.5A Pending CN111177484A (en) | 2019-12-09 | 2019-12-09 | System and method for loading and managing different data sources and format character string resource files |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111177484A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103929321A (en) * | 2013-01-15 | 2014-07-16 | 腾讯科技(深圳)有限公司 | Log processing method and device |
CN107341135A (en) * | 2017-05-24 | 2017-11-10 | 中国科学院信息工程研究所 | A kind of analytic method and instrument towards generic text form |
CN108073391A (en) * | 2016-11-11 | 2018-05-25 | 阿里巴巴集团控股有限公司 | A kind of JSON character strings transmission, the method and apparatus of processing |
CN108921712A (en) * | 2018-06-13 | 2018-11-30 | 泰康保险集团股份有限公司 | Data processing method, device, medium and electronic equipment |
CN109814870A (en) * | 2018-12-26 | 2019-05-28 | 东软集团股份有限公司 | Data analysis method, device, storage medium and electronic equipment |
CN110347440A (en) * | 2019-06-24 | 2019-10-18 | 北京人大金仓信息技术股份有限公司 | Data method and system are quickly loaded to database based on multi-course concurrency and plug-in unit |
-
2019
- 2019-12-09 CN CN201911250027.5A patent/CN111177484A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103929321A (en) * | 2013-01-15 | 2014-07-16 | 腾讯科技(深圳)有限公司 | Log processing method and device |
CN108073391A (en) * | 2016-11-11 | 2018-05-25 | 阿里巴巴集团控股有限公司 | A kind of JSON character strings transmission, the method and apparatus of processing |
CN107341135A (en) * | 2017-05-24 | 2017-11-10 | 中国科学院信息工程研究所 | A kind of analytic method and instrument towards generic text form |
CN108921712A (en) * | 2018-06-13 | 2018-11-30 | 泰康保险集团股份有限公司 | Data processing method, device, medium and electronic equipment |
CN109814870A (en) * | 2018-12-26 | 2019-05-28 | 东软集团股份有限公司 | Data analysis method, device, storage medium and electronic equipment |
CN110347440A (en) * | 2019-06-24 | 2019-10-18 | 北京人大金仓信息技术股份有限公司 | Data method and system are quickly loaded to database based on multi-course concurrency and plug-in unit |
Non-Patent Citations (1)
Title |
---|
朱树强: "海量异构海洋数据集成系统的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110908997B (en) | Data blood relationship construction method and device, server and readable storage medium | |
US8918447B2 (en) | Methods, apparatus, systems and computer readable mediums for use in sharing information between entities | |
US9535965B2 (en) | System and method for specifying metadata extension input for extending data warehouse | |
US9047392B2 (en) | System and method for conversion of JMS message data into database transactions for application to multiple heterogeneous databases | |
US7096231B2 (en) | Export engine which builds relational database directly from object model | |
CN110083650B (en) | Metadata self-discovery-based automatic generation method for data query interface | |
CN110134671B (en) | Traceability application-oriented block chain database data management system and method | |
US20100228764A1 (en) | Offline Validation of Data in a Database System for Foreign Key Constraints | |
US7925002B2 (en) | Administering multiple target ACD systems | |
US20010039540A1 (en) | Method and structure for dynamic conversion of data | |
CN106951430A (en) | Account table querying method and device | |
KR20060045622A (en) | Extraction, transformation and loading designer module of a computerized financial system | |
CN103067483A (en) | Remote data increment synchronization method and device based on data package | |
US8880463B2 (en) | Standardized framework for reporting archived legacy system data | |
WO2012155643A1 (en) | Method for implementing configuration console based on database, configuration console, and system | |
CN111367975B (en) | Multi-protocol data conversion processing method and device | |
US20030140058A1 (en) | Method and apparatus for sharing information between applications using common objects | |
CN110198327B (en) | Data transmission method and related equipment | |
CN105117441A (en) | Data work order processing method and system | |
US20040167905A1 (en) | Content management portal and method for managing digital assets | |
CN110941629B (en) | Metadata processing method, apparatus, device and computer readable storage medium | |
CN106599015A (en) | Data service management system and method | |
CN109522528A (en) | A kind of word document is converted to the method that can calculate automatically html document | |
CN112699183A (en) | Data processing method, system, readable storage medium and computer equipment | |
CN109947739B (en) | Data source management 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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200519 |