CN116909688B - Database calling method and device, storage medium and electronic equipment - Google Patents

Database calling method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116909688B
CN116909688B CN202311185304.5A CN202311185304A CN116909688B CN 116909688 B CN116909688 B CN 116909688B CN 202311185304 A CN202311185304 A CN 202311185304A CN 116909688 B CN116909688 B CN 116909688B
Authority
CN
China
Prior art keywords
character
database
preset
mapping library
library
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311185304.5A
Other languages
Chinese (zh)
Other versions
CN116909688A (en
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 Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202311185304.5A priority Critical patent/CN116909688B/en
Publication of CN116909688A publication Critical patent/CN116909688A/en
Application granted granted Critical
Publication of CN116909688B publication Critical patent/CN116909688B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • G06F9/45512Command shells
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to a database calling method, a device, a storage medium and electronic equipment, and relates to the technical field of databases, wherein the method comprises the following steps: the method comprises the steps that firstly, an instruction script of a business system on a first database is intercepted, wherein the first database is a database before transformation; then, carrying out character splitting on the instruction script to obtain a first character; then, inquiring a second character corresponding to the first character in a preset mapping library; and finally, replacing the first character with the second character to generate a control script, wherein the control script is used for realizing the call to a second database, and the second database is a modified database. By adopting the technical scheme, when the database is modified, the service data of the service system is not required to be modified, and only the command script output by the service system is required to be subjected to character replacement, so that the workload of database modification is greatly reduced, and meanwhile, the phenomenon of missing modification is reduced by carrying out character replacement on the command script, so that the unactuated script is conveniently found.

Description

Database calling method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of database technologies, and in particular, to a method and an apparatus for invoking a database, a storage medium, and an electronic device.
Background
Along with the advancement of the data process, each service system respectively establishes a database suitable for the service, and the information in the database is called through the instruction information in the generated script.
With the increase of database transformation requirements, the service system needs to synchronously realize the call of the transformed database. The existing method for realizing the call of the database information before and after transformation needs to convert each piece of service data sent to the database by the service system, so that each piece of converted service data meets the call requirement of the transformed database. However, the method needs to face extremely large conversion workload, is extremely easy to miss, and is difficult to ensure the reliability of database call.
Disclosure of Invention
In view of this, the present application provides a database calling method, a device, a storage medium and an electronic apparatus, which mainly aims to solve the technical problem that after a database is modified, a service code generated by a service system needs to be synchronously modified, and a large amount of modification workload is easy to generate.
In a first aspect, the present application provides a database calling method, including:
intercepting an instruction script of a business system on a first database, wherein the first database is a database before transformation;
performing character splitting on the instruction script to obtain a first character;
inquiring a second character corresponding to the first character in a preset mapping library;
and replacing the first character with the second character to generate a control script, wherein the control script is used for realizing the call to a second database, and the second database is a modified database.
In a second aspect, the present application provides a database calling device, including:
the intercepting module is used for intercepting an instruction script of the business system on a first database, wherein the first database is a database before transformation;
the splitting module is used for splitting the characters of the instruction script to obtain a first character;
the query module is used for querying a second character corresponding to the first character in a preset mapping library;
the generation module is used for replacing the first character with the second character to generate a control script, wherein the control script is used for realizing the call to a second database, and the second database is a modified database.
In a third aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the database calling method of the first aspect.
In a fourth aspect, the present application provides an electronic device, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, where the processor implements the database calling method according to the first aspect when executing the computer program.
By means of the technical scheme, the database calling method, the device, the storage medium and the electronic equipment are compared with the existing scheme that after the database is reformed, business data of a business system are required to be reformed one by one synchronously, script instructions can be split into first characters, the first characters are replaced, second characters are generated, control scripts generated by the second characters can be used for calling the reformed second database, the technical scheme of the application only needs to replace the instructions scripts, the whole business data of the business system are not required to be reformed one by one, and accordingly reforming workload is reduced. Specifically, the instruction script of the service system to the first database can be intercepted first, and the first database is a database before transformation; then, carrying out character splitting on the instruction script to obtain a first character; then, inquiring a second character corresponding to the first character in a preset mapping library; and finally, replacing the first character with the second character to generate a control script, wherein the control script is used for realizing the call to a second database, and the second database is a modified database. By applying the technical scheme, the script instruction output by the service system can be directly subjected to first character replacement, and the reconstructed control script can realize the call of the second database through the corresponding relation between the first character and the second character. By adopting the technical scheme, when the database is modified, the service data of the service system is not required to be modified, and only the command script output by the service system is required to be subjected to character replacement, so that the workload of database modification is greatly reduced, and meanwhile, the phenomenon of missing modification is reduced by carrying out character replacement on the command script, so that the unactuated script is conveniently found.
The foregoing description is only an overview of the technical solutions of the present application, and may be implemented according to the content of the specification in order to make the technical means of the present application more clearly understood, and in order to make the above-mentioned and other objects, features and advantages of the present application more clearly understood, the following detailed description of the present application will be given.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic flow diagram of a database call according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a second character query process according to an embodiment of the present application;
fig. 3 shows a schematic structural diagram of a database calling device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in more detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other.
In order to improve the technical problems that the traditional lens shading correction mode is high in calculation complexity and high in calculation power consumption, the efficiency of image processing can be affected, and the requirement on equipment hardware is high. The embodiment provides an image processing method, as shown in fig. 1, which can be applied to an end side of an image processing device (such as an intelligent terminal of a smart phone, a tablet computer, an unmanned aerial vehicle, an intelligent robot, etc.), and the method includes:
step 101, intercepting an instruction script of a service system on a first database, wherein the first database is a database before transformation.
In this embodiment, the instruction script sent by the service system is intercepted. The instruction script is used for realizing the calling of the first database. That is, in this embodiment, the service system itself is not modified, and the instruction script output by the service system is still for calling the first database.
And 102, carrying out character splitting on the instruction script to obtain a first character.
After the script instructions are intercepted, the characters are further split. The structural query language SQL of the script instructions can be split into words, symbols, functions, fixed sentences and the like of characters. Still further, the split first character may be used to represent stored data, stored view, etc. of the first database.
Step 103, in the preset mapping library, inquiring a second character corresponding to the first character.
After splitting the script instruction, after extracting the first character, the instruction difference between the first database and the second database is utilized, so that in order to realize the call to the second database through the instruction script of the first database, the script difference between the first database and the second database needs to be confirmed, namely, the second character corresponding to the split first character is queried. And the specific query position is a second character with mapping corresponding relation with the first character through a preset mapping library.
And 104, replacing the first character with the second character to generate a control script, wherein the control script is used for realizing the call to a second database, and the second database is a modified database.
After the corresponding relation between the first character and the second character is confirmed, the first character is replaced by the second character, a new control script is generated, and the second database is called according to the control script. It should be noted that, in this embodiment, similar control scripts exist in the first database and the second database, that is, by replacing one or some control characters in the scripts, the two databases may be invoked respectively. For example, as shown in table 1, table 1 shows a schematic representation of the correspondence between the first character and the second character, when the first database, for example, the mysql native library, is the group-concat, and when the native library word represented by the first character of the instruction script for calling the function group is the group-concat, then the first character is replaced by the second character vm-concat, that is, the adaptation library word in the figure, so that the call to the second database, for example, the function group corresponding to the dream DM database can be realized.
TABLE 1
By adopting the technical scheme, the database is transformed, the service data of the service system is not required to be transformed, the command script output by the service system is subjected to character replacement according to the difference of the scripts between the first database and the second database, the workload of database transformation is greatly reduced, and meanwhile, the command script is subjected to character replacement, so that the uncorrupted script is conveniently found, and the phenomenon of transformation omission is reduced.
Further, in one possible embodiment, before querying the second character corresponding to the first character in the preset mapping library, the method further includes:
identifying a service type of a service system; determining a target preset mapping library in a plurality of service mapping libraries corresponding to the service types;
in a preset mapping library, inquiring a second character corresponding to the first character comprises the following steps:
and inquiring a second character corresponding to the first character in the target preset mapping library.
Before the second character corresponding to the first character is queried, a preset mapping library needs to be determined first. The specific confirmation mode is determined according to the service type of the service system. By way of example, the service type may be the industry to which it belongs, such as: the service of industries such as electric power, medical treatment or finance, or the determination of the service type can be realized according to the functions realized by a service system supported by a database, and the service type is exemplified by a relational service and relational database MySQL, a document service and document database MongoDB or a structural service and column structured database HBASE. Each type of service system may correspond to at least one service mapping library, and a target preset mapping library is determined in the service mapping libraries, wherein the target preset mapping library corresponds to a first character of the current instruction script and supports a corresponding relation between the first database and the second database.
In the embodiment, a scheme for selecting a target preset mapping library is disclosed, so that the query of the second character is realized. Specifically, the selection of the target preset mapping library is determined according to the service type of the service system. A business system may be simultaneously connected to multiple databases, and the type of business implemented by the business system is also related to the database type, and at the same time, the type of business of the business system is also related to the industry being implemented, and the specific type of business may be confirmed by the industry type. By determining a specific target preset database in the specific type of service mapping library, the second character is queried, so that the service mapping library can be clearly classified, the quick query of the characters can be realized when the character query is performed, and the query efficiency is improved.
Further, in a possible embodiment, in the target preset mapping library, querying a second character corresponding to the first character includes:
inquiring a second character corresponding to the first character in a preset cache mapping library; if the second character does not exist in the preset cache mapping library, inquiring the second character in the total preset mapping library, wherein the preset cache mapping library is a part of the total preset mapping library.
In the embodiment, the target preset mapping library is divided into a preset cache mapping library and a total preset mapping library. The preset cache mapping library is a partial cache library of the total preset mapping library, namely, partial data in the total preset mapping library is extracted, and the preset cache mapping library is independently built. The data stored in the preset cache mapping library is common data for character query. Therefore, in the process of inquiring the second character, the common data is stored in the preset cache mapping library, and the stored data is less than the total preset mapping library, so that the quick inquiry of the second character can be realized, and the second character inquiry is carried out in the total preset mapping library only when the inquiry of the second character cannot be realized in the preset cache mapping library. Therefore, according to the technical scheme, under the condition that the service system outputs more instructions, the common characters can be quickly identified, so that the overall character searching efficiency is improved, and the overall working efficiency of the service system is improved.
Meanwhile, in combination with the above embodiment, fig. 2 is presented in this embodiment, and fig. 2 shows a schematic diagram of a second character query process, where after a target preset mapping library (homologous combination mapping library) is selected and successfully adapted in a plurality of service mapping libraries, the first character (native word) is further adapted and searched through a preset cache mapping library, and after the search is successful, the second character (adaptation word) is output. If the second character does not exist in the target preset mapping library, further performing adaptation and searching of the second character in the total preset mapping library (the original mapping library), and outputting the second character (the adaptation word) after the searching is successful.
Further, in a possible embodiment, the establishing of the total preset mapping library includes:
determining all instruction scripts of the service system within a first preset time; identifying a plurality of first characters contained in the overall instruction script; confirming a plurality of second characters corresponding to the plurality of first characters respectively by utilizing the corresponding relation between the first database and the second database; establishing a plurality of groups of character key value pairs according to the corresponding relation between the first characters and the second characters; and establishing a total preset mapping library by utilizing the character key value pairs.
In the embodiment, specific explanation is made for the establishment of the total preset mapping library, specifically, key value pairs formed by the first character and the second character corresponding to each other in the first preset time are recorded and are arranged into the library. In the process of establishing the total preset mapping library, the service system needs to consider the instruction script of all functions of the first database, and accurately extract and record the first character of the instruction script. Meanwhile, in order to realize the call to the second database, the second character corresponding to the first character is also required to be defined, so that the establishment of the key value pair is realized. By adopting the technical scheme of the embodiment, the conversion basis of the first character and the second character can be established, the first character can be split after the instruction script is received, and the query of the second character is quickly realized, so that the establishment of the control script is quickly realized, and the calling rate of the second database is improved.
Further, in a possible embodiment, the establishing of the preset cache mapping library includes:
counting the occurrence frequency of each group of character key value pairs occurring in a first preset time to generate a frequency result; sequencing the frequency results to generate a frequency sequence; and selecting a preset number of frequency sequences according to the sequence from high to low, and taking character key value pairs corresponding to the selected frequency sequences as a preset cache mapping library.
After the establishment of the total preset database is implemented, the embodiment further discloses an establishment step of the preset cache mapping library, and as can be seen from the content of the previous embodiment, the preset cache mapping library is a partial cache library of the total preset mapping library, and the stored data is the common data for performing character query, so that the data in the pre-stored cache mapping library is selected according to the use frequency. Specifically, the occurrence frequency is counted by using the character key value pairs established when the total preset database is established, and each occurrence of the character key value pairs means that the service system outputs a corresponding instruction script once to generate a use frequency and generate a frequency result. And sequencing the frequency results of each key value pair to generate a frequency sequence, and establishing a preset cache mapping library according to the frequency sequence from high to low. For example, a frequency sequence corresponding to a key value of the previous 1000 of the frequency result may be selected to generate a preset cache mapping library. Wherein the number of key-value pairs selected may be modified according to the service requirements or the hardware configuration of the system.
The embodiment proposes that a preset cache mapping library is built according to the occurrence frequency of character key value pairs occurring in a first preset time. Under the condition that the content of a database connected with a service system is continuously increased, the variety of instruction scripts output by the service system is gradually increased. For each database, there is a main function of each database, that is, most of script instructions can split a part of identical first characters, and the first characters can be regarded as common characters. Therefore, in order to realize the output of the instruction script by the service system and the quick call to the second database, the embodiment proposes to establish the preset cache mapping library so as to store the common characters of the database, so that the quick query to the second characters corresponding to the first characters is realized, and the query speed is improved.
In one possible embodiment, if the second character does not exist in the preset cache mapping library, after the second character corresponding to the first character is queried in the total preset mapping library, the method further includes:
taking the first character which does not have the second character as a missing character, and counting the frequency of the missing character to obtain the missing frequency; calculating the miss proportion value of the miss frequency to all the first characters in the second preset time; and if the miss proportion value exceeds the preset proportion value, updating the preset cache mapping library.
Aiming at the possible situation that the second character does not exist when the first character searches the second character in the preset cache mapping library, the technical scheme of the embodiment further provides a technical scheme for counting missed characters. Because the stored data in the preset cache mapping library is the common data for inquiring characters, the preset cache mapping library needs to be ensured to meet the searching requirement of the first characters with a certain proportion. Therefore, the first character corresponding to the second character is searched by the preset cache mapping library to count, the frequency of missing characters is counted, the missing proportion value in the second preset time period is counted, and if the missing proportion value exceeds a certain value, the fact that the key value pair in the preset cache mapping library cannot represent the common key value pair can be considered, and the preset cache mapping library needs to be updated. Alternatively, the miss ratio value P is calculated as follows:
(1)
wherein T is the total number of successful searches of the preset cache mapping library and the total preset mapping library, and D is the total number of successful searches of the total preset mapping library.
The embodiment proposes a related technical scheme for updating the preset cache mapping library, and judges whether the quick extraction of the common characters can be realized in the preset cache mapping library, so that whether the quick conversion of the instruction script of the service system can be successfully implemented by the preset cache mapping library is realized. In combination with the content of the embodiment, in the process of continuously expanding the database connected with the service system, the instruction script is continuously enriched, and the judgment of the rapid extraction of the preset cache mapping library is performed, so that a basis is provided for updating the preset cache mapping library, and the reliability of the rapid query of the preset cache mapping library on the commonly used first characters is continuously ensured.
In a possible embodiment, in the preset mapping library, querying a second character corresponding to the first character includes:
identifying a first database type of a first database; identifying a second database type of a second database; determining a preset mapping library according to the type corresponding relation between the first database type and the second database type; and inquiring a second character corresponding to the first character in a preset mapping library.
In this embodiment, a second character query process is further provided, and when implementing the query of the second character, it is required to be clear that the accuracy of the query must be implemented by first ensuring a preset mapping library storing the accurate correspondence between the first character and the second character. In order to accurately select the preset mapping library, the embodiment further provides that accurate selection of the preset mapping library is realized through a type relationship between the first database and the second database. It should be appreciated that different databases are of different kinds, e.g. Oracl, mysql etc. format databases, storing different types of content. The correspondence between the first database and the second database may be the same kind of database or may be different kinds of database. Aiming at the two databases capable of realizing script conversion, the two databases are related in type necessarily, so that the embodiment provides that the accuracy of the second character corresponding to the first character query is further ensured according to the type corresponding relation between the two databases, so that the accuracy of the preset mapping library is realized.
Further, as a specific implementation of the method shown in fig. 1, this embodiment provides a database calling device, as shown in fig. 3, including: the system comprises an intercepting module 31, a splitting module 32, a querying module 33 and a generating module 34.
The intercepting module 31 is configured to intercept an instruction script of the service system on a first database, where the first database is a database before transformation;
a splitting module 32, configured to split the characters of the instruction script to obtain a first character;
a query module 33, configured to query, in a preset mapping library, a second character corresponding to the first character;
and the generating module 34 is configured to replace the first character with the second character, and generate a control script, where the control script is used to implement a call to a second database, and the second database is a modified database.
In a specific application scenario, the query module 33 is further configured to:
identifying a service type of the service system;
determining a target preset mapping library in a plurality of service mapping libraries corresponding to the service types
The query module 33 is specifically configured to:
and inquiring a second character corresponding to the first character in the target preset mapping library.
In a specific application scenario, the query module 33 is specifically configured to:
inquiring a second character corresponding to the first character in a preset cache mapping library;
if the second character does not exist in the preset cache mapping library, inquiring the second character in a total preset mapping library, wherein the preset cache mapping library is a part of the total preset mapping library.
In a specific application scenario, the building of the total preset mapping library includes:
determining all instruction scripts of the service system within a first preset time;
identifying a plurality of first characters contained in the overall instruction script;
confirming a plurality of second characters corresponding to the plurality of first characters respectively by utilizing the corresponding relation between the first database and the second database;
establishing a plurality of groups of character key value pairs according to the corresponding relation between the first characters and the second characters;
and establishing the total preset mapping library by utilizing the character key value pairs.
In a specific application scenario, the establishment of the preset cache mapping library comprises the following steps:
counting the occurrence frequency of each group of character key value pairs occurring in the first preset time to generate a frequency result;
sequencing the frequency results to generate a frequency sequence;
and selecting a preset number of frequency sequences according to the sequence from high to low, and taking the character key value pairs corresponding to the selected frequency sequences as the preset cache mapping library.
In a specific application scenario, the database calling device further comprises an updating device 45;
updating means 35, configured to count the frequency of the missed characters by using the first character corresponding to the second character as the missed character, so as to obtain the missed frequency;
calculating the miss proportion value of the miss frequency to all the first characters in the second preset time;
and if the miss proportion value exceeds a preset proportion value, updating the preset cache mapping library.
In a specific application scenario, the query module 33 is specifically configured to:
identifying a first database type of the first database;
identifying a second database type of the second database;
determining a preset mapping library according to the type corresponding relation between the first database type and the second database type;
and inquiring a second character corresponding to the first character in the preset mapping library.
It should be noted that, for other corresponding descriptions of each functional unit related to the image processing apparatus provided in this embodiment, reference may be made to the corresponding descriptions in fig. 1, and no further description is given here.
Based on the above method shown in fig. 1, correspondingly, the present embodiment further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the above method shown in fig. 1.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.), and includes several instructions for causing a computer device (may be a personal computer, a server, or a network device, etc.) to perform the method of each implementation scenario of the present application.
Based on the method shown in fig. 1 and the virtual device embodiment shown in fig. 3, in order to achieve the above objects, the embodiment of the present application further provides an electronic device, such as an intelligent terminal of a smart phone, a tablet computer, an unmanned aerial vehicle, an intelligent robot, etc., where the device includes a storage medium and a processor; a storage medium storing a computer program; a processor for executing a computer program to implement the method as described above and shown in fig. 1.
Optionally, the entity device may further include a user interface, a network interface, a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, and so on. The user interface may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), etc.
It will be appreciated by those skilled in the art that the above-described physical device structure provided in this embodiment is not limited to this physical device, and may include more or fewer components, or may combine certain components, or may be a different arrangement of components.
The storage medium may also include an operating system, a network communication module. The operating system is a program that manages the physical device hardware and software resources described above, supporting the execution of information handling programs and other software and/or programs. The network communication module is used for realizing communication among all components in the storage medium and communication with other hardware and software in the information processing entity equipment.
Through the description of the above embodiments, those skilled in the art can clearly understand that the script instruction can be split into the first character, the first character is replaced, the second character is generated, the control script generated by the second character can realize the call of the transformed second database, and by adopting the technical scheme of the application, only the instruction script is required to be replaced, the whole business data of the business system is not required to be transformed one by one, and the transformation workload is reduced. Specifically, the instruction script of the service system to the first database can be intercepted first, and the first database is a database before transformation; then, carrying out character splitting on the instruction script to obtain a first character; then, inquiring a second character corresponding to the first character in a preset mapping library; and finally, replacing the first character with the second character to generate a control script, wherein the control script is used for realizing the call to a second database, and the second database is a modified database. By applying the technical scheme, the script instruction output by the service system can be directly subjected to first character replacement, and the reconstructed control script can realize the call of the second database through the corresponding relation between the first character and the second character. By adopting the technical scheme, when the database is modified, the service data of the service system is not required to be modified, and only the command script output by the service system is required to be subjected to character replacement, so that the workload of database modification is greatly reduced, and meanwhile, the phenomenon of missing modification is reduced by carrying out character replacement on the command script, so that the unactuated script is conveniently found.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the application to enable one skilled in the art to understand or practice the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A database calling method, comprising:
intercepting an instruction script of a business system on a first database, wherein the first database is a database before transformation;
performing character splitting on the instruction script to obtain a first character;
identifying a service type of the service system; determining a target preset mapping library in a plurality of service mapping libraries corresponding to the service types;
in a preset mapping library, inquiring a second character corresponding to the first character comprises the following steps: and in the target preset mapping library, inquiring a second character corresponding to the first character, wherein the second character comprises: inquiring a second character corresponding to the first character in a preset cache mapping library; if the second character does not exist in the preset cache mapping library, inquiring the second character in a total preset mapping library, wherein the preset cache mapping library is a partial library of the total preset mapping library;
and replacing the first character with the second character to generate a control script, wherein the control script is used for realizing the call to a second database, and the second database is a modified database.
2. The method of claim 1, wherein the establishing of the total preset mapping library comprises:
determining all instruction scripts of the service system within a first preset time;
identifying a plurality of first characters contained in the overall instruction script;
confirming a plurality of second characters corresponding to the plurality of first characters respectively by utilizing the corresponding relation between the first database and the second database;
establishing a plurality of groups of character key value pairs according to the corresponding relation between the first characters and the second characters;
and establishing the total preset mapping library by utilizing the character key value pairs.
3. The method of claim 2, wherein the establishing of the preset cache map library comprises:
counting the occurrence frequency of each group of character key value pairs occurring in the first preset time to generate a frequency result;
sequencing the frequency results to generate a frequency sequence;
and selecting a preset number of frequency sequences according to the sequence from high to low, and taking the character key value pairs corresponding to the selected frequency sequences as the preset cache mapping library.
4. The method of claim 3, wherein if the second character does not exist in the preset cache map library, after querying a total preset map library for the second character corresponding to the first character, the method further comprises:
taking the first character which does not exist and corresponds to the second character as a missing character, and counting the frequency of the missing character to obtain the missing frequency;
calculating the miss proportion value of the miss frequency to all the first characters in the second preset time;
and if the miss proportion value exceeds a preset proportion value, updating the preset cache mapping library.
5. The method of claim 1, wherein the querying the second character corresponding to the first character in the preset mapping library includes:
identifying a first database type of the first database;
identifying a second database type of the second database;
determining a preset mapping library according to the type corresponding relation between the first database type and the second database type;
and inquiring a second character corresponding to the first character in the preset mapping library.
6. A database recall device, comprising:
the intercepting module is used for intercepting an instruction script of the business system on a first database, wherein the first database is a database before transformation;
the splitting module is used for splitting the characters of the instruction script to obtain a first character;
the query module is used for identifying the service type of the service system;
determining a target preset mapping library in a plurality of service mapping libraries corresponding to the service types;
in a preset mapping library, inquiring a second character corresponding to the first character comprises the following steps: and in the target preset mapping library, inquiring a second character corresponding to the first character, wherein the second character comprises: inquiring a second character corresponding to the first character in a preset cache mapping library; if the second character does not exist in the preset cache mapping library, inquiring the second character in a total preset mapping library, wherein the preset cache mapping library is a partial library of the total preset mapping library;
the generation module is used for replacing the first character with the second character to generate a control script, wherein the control script is used for realizing the call to a second database, and the second database is a modified database.
7. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of any one of claims 1 to 5.
8. An electronic device comprising a storage medium, a processor and a computer program stored on the storage medium and executable on the processor, characterized in that the processor implements the method of any one of claims 1 to 5 when executing the computer program.
CN202311185304.5A 2023-09-14 2023-09-14 Database calling method and device, storage medium and electronic equipment Active CN116909688B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311185304.5A CN116909688B (en) 2023-09-14 2023-09-14 Database calling method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311185304.5A CN116909688B (en) 2023-09-14 2023-09-14 Database calling method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN116909688A CN116909688A (en) 2023-10-20
CN116909688B true CN116909688B (en) 2024-01-26

Family

ID=88353545

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311185304.5A Active CN116909688B (en) 2023-09-14 2023-09-14 Database calling method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116909688B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104346377A (en) * 2013-07-31 2015-02-11 克拉玛依红有软件有限责任公司 Method for integrating and exchanging data on basis of unique identification
CN108121757A (en) * 2017-11-10 2018-06-05 广州优视网络科技有限公司 A kind of method of data synchronization, device, system, computing device and storage medium
CN108388599A (en) * 2018-02-01 2018-08-10 平安科技(深圳)有限公司 Electronic device, Data Migration and call method and storage medium
WO2019148720A1 (en) * 2018-02-01 2019-08-08 平安科技(深圳)有限公司 Electronic device, data storage method and storage medium
CN111625510A (en) * 2020-05-25 2020-09-04 广东电网有限责任公司 Multi-source data sharing system and method based on cloud mapping
CN112527815A (en) * 2020-12-02 2021-03-19 平安医疗健康管理股份有限公司 Script migration method and device for database, computer equipment and storage medium
CN112800034A (en) * 2021-03-23 2021-05-14 杭州沃趣科技股份有限公司 Database replacement method, device, medium and equipment based on grammar compatible conversion
CN113986880A (en) * 2021-10-29 2022-01-28 平安国际智慧城市科技股份有限公司 Database adaptation method, device, equipment and storage medium of business system
CN114297274A (en) * 2021-12-03 2022-04-08 南方电网大数据服务有限公司 Big data extraction method and device, computer equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104346377A (en) * 2013-07-31 2015-02-11 克拉玛依红有软件有限责任公司 Method for integrating and exchanging data on basis of unique identification
CN108121757A (en) * 2017-11-10 2018-06-05 广州优视网络科技有限公司 A kind of method of data synchronization, device, system, computing device and storage medium
CN108388599A (en) * 2018-02-01 2018-08-10 平安科技(深圳)有限公司 Electronic device, Data Migration and call method and storage medium
WO2019148720A1 (en) * 2018-02-01 2019-08-08 平安科技(深圳)有限公司 Electronic device, data storage method and storage medium
CN111625510A (en) * 2020-05-25 2020-09-04 广东电网有限责任公司 Multi-source data sharing system and method based on cloud mapping
CN112527815A (en) * 2020-12-02 2021-03-19 平安医疗健康管理股份有限公司 Script migration method and device for database, computer equipment and storage medium
CN112800034A (en) * 2021-03-23 2021-05-14 杭州沃趣科技股份有限公司 Database replacement method, device, medium and equipment based on grammar compatible conversion
CN113986880A (en) * 2021-10-29 2022-01-28 平安国际智慧城市科技股份有限公司 Database adaptation method, device, equipment and storage medium of business system
CN114297274A (en) * 2021-12-03 2022-04-08 南方电网大数据服务有限公司 Big data extraction method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN116909688A (en) 2023-10-20

Similar Documents

Publication Publication Date Title
CN107609056B (en) Question and answer processing method and device based on picture recognition
US11934371B2 (en) Data processing method and apparatus, and computer-readable storage medium
US8838550B1 (en) Readable text-based compression of resource identifiers
CN107832035B (en) Voice input method of intelligent terminal
US11630825B2 (en) Method and system for enhanced search term suggestion
US20140181084A1 (en) Type-ahead search optimization
CN113297269A (en) Data query method and device
CN113127125B (en) Page automatic adaptation method, device, equipment and storage medium
CN116909688B (en) Database calling method and device, storage medium and electronic equipment
US7088341B2 (en) System and method for inputting special characters
KR20100067629A (en) Method, apparatus and computer program product for providing an input order independent character input mechanism
CN110266834B (en) Area searching method and device based on internet protocol address
CN109697234B (en) Multi-attribute information query method, device, server and medium for entity
CN114611039B (en) Analysis method and device of asynchronous loading rule, storage medium and electronic equipment
CN116361287A (en) Path analysis method, device and system
CN101727204A (en) Character input system on communication terminal, character input method on communication terminal and communication terminal
CN115422270A (en) Information processing method and device
CN114463068A (en) Data processing method and device
CN105991400B (en) Group searching method and device
CN110147531B (en) Method, device and storage medium for identifying similar text content
CN114116699A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN111368298B (en) Virus file identification method, device, equipment and storage medium
CN114116877B (en) Data conversion method, device, computer equipment and medium
CN116010350B (en) Binary log retrieval method, system, equipment and storage medium
CN113239001A (en) Data storage 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
GR01 Patent grant
GR01 Patent grant