CN116483849A - SQL file updating method and device and electronic equipment - Google Patents

SQL file updating method and device and electronic equipment Download PDF

Info

Publication number
CN116483849A
CN116483849A CN202310507380.7A CN202310507380A CN116483849A CN 116483849 A CN116483849 A CN 116483849A CN 202310507380 A CN202310507380 A CN 202310507380A CN 116483849 A CN116483849 A CN 116483849A
Authority
CN
China
Prior art keywords
file
update
sql
updating
execution
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
CN202310507380.7A
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.)
Beijing Hesi Information Technology Co Ltd
Original Assignee
Beijing Hesi Information 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 Beijing Hesi Information Technology Co Ltd filed Critical Beijing Hesi Information Technology Co Ltd
Priority to CN202310507380.7A priority Critical patent/CN116483849A/en
Publication of CN116483849A publication Critical patent/CN116483849A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/23Updating
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a SQL file updating method, a SQL file updating device and electronic equipment; the method is applied to a server connected with a plurality of databases and comprises the following steps: acquiring update information of SQL files in different databases, writing creation time in the update information and file names of the corresponding SQL files into an execution file list, and marking the state of the update information in the execution file list as an un-updated state; acquiring an update execution instruction of a target file name corresponding to an un-updated state in an execution file list; detecting whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name; if yes, corresponding updating operation is executed on the corresponding SQL file according to the updating content corresponding to the target file name. The method can avoid repeated execution of the same updating operation and improve the efficiency of executing the updating operation on the SQL file.

Description

SQL file updating method and device and electronic equipment
Technical Field
The present invention relates to the field of databases, and in particular, to a method and an apparatus for updating an SQL file, and an electronic device.
Background
At present, many software systems or enterprise internal systems developed by enterprises or software development companies have the situation that the software systems or the enterprise internal systems need to be updated, functional modules involved in the system are more, and when each functional module needs to be updated, executed SQL files also need to be updated. With the increase of update demands, a single demand often requires multiple developers to develop at the same time, different developers directly store the SQL file to be updated locally, and when the corresponding SQL file needs to be updated, update operation is executed. Because of the large number of the SQL files stored locally, difficulty in viewing and other factors, research and development personnel tend to ignore or miss the SQL files to be updated during updating. Thus, once missed, the update efficiency of the SQL file is affected.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method, an apparatus, and an electronic device for updating an SQL file, so as to solve the above problems in the prior art, and improve the update efficiency of the SQL file.
In a first aspect, an SQL file update method is provided, which is applied to a server connected to a plurality of databases, and the method may include:
acquiring update information of SQL files in different databases, wherein the update information comprises update contents, creation time of the update information, file names of corresponding SQL files and update operation;
writing the creation time in the update information and the file name of the corresponding SQL file into an execution file list, and marking the state of the update information in the execution file list as an un-updated state; the execution file list comprises updated time of the history update information and corresponding file names;
acquiring an update execution instruction of a target file name corresponding to an un-updated state in the execution file list;
detecting whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name;
if yes, corresponding updating operation is executed on the corresponding SQL file according to the updating content corresponding to the target file name.
In one possible implementation, after performing the respective update operation on the respective SQL file, the method further comprises:
if the corresponding updating operation is successfully executed, determining the time for executing the updating operation as the updated time of the updating information, writing the updated time of the updating information into the executing file list, and marking the state of the corresponding updating information in the executing file list as the updated state;
if the corresponding updating operation is failed to be executed, the prompt information that the corresponding updating operation cannot be executed is displayed.
In one possible implementation, before performing the corresponding update operation on the corresponding SQL file according to the update content corresponding to the target file name, the method further includes:
detecting whether the appointed database name exists in the update information corresponding to the target file name;
if yes, executing corresponding updating operation on the corresponding SQL file according to the updating content corresponding to the target file name, wherein the updating operation comprises the following steps:
determining to match the name of the database corresponding to the target file name with the designated database name;
if the matching is successful, determining that the corresponding updating operation is executed on the corresponding SQL file according to the updating content corresponding to the target file name in the database corresponding to the successfully matched database name;
if the matching fails, prompt information that corresponding updating operation cannot be executed in the appointed database is displayed.
In one possible implementation, after the corresponding update operation is performed successfully, the method further includes:
detecting whether file names corresponding to the same non-updated state exist in the execution file list, wherein the file names correspond to the same non-updated state and are earlier than the creation time of the update information corresponding to the target file name;
if the file name exists, determining to delete the corresponding file name in the execution file list, and deleting the updated content corresponding to the corresponding file name.
In one possible implementation, after obtaining the update execution indication of the target file name corresponding to the non-updated state in the execution file list, the method further includes:
if the obtained user ID for sending the update execution instruction is successfully matched with the obtained user ID for sending the update information of SQL files in different databases, whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name is detected.
In one possible implementation, after the user ID sending the update execution indication matches the user ID sending the update information for the SQL file in the different database successfully, the method further includes:
detecting an update state corresponding to the target file name in the execution file list;
if the update status is not updated, detecting whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name.
In a second aspect, an SQL file update apparatus is provided, which is applied to a server connected to a plurality of databases, and may include:
the system comprises an acquisition unit, a storage unit and a storage unit, wherein the acquisition unit is used for acquiring update information of SQL files in different databases, and the update information comprises update contents, creation time of the update information, file names of corresponding SQL files and update operation;
the writing unit is used for writing the creation time in the update information and the file name of the corresponding SQL file into an execution file list, and marking the state of the update information as an un-updated state in the execution file list; the execution file list comprises updated time of the history update information and corresponding file names;
the acquiring unit is further configured to acquire an update execution instruction for a target file name corresponding to an un-updated state in the execution file list;
the detection unit is used for detecting whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name; if yes, corresponding updating operation is executed on the corresponding SQL file according to the updating content corresponding to the target file name.
The detection unit is also used for detecting the result of the corresponding SQL file to execute the corresponding updating operation;
if the corresponding updating operation is successfully executed, determining the time for executing the updating operation as the updated time of the updating information, writing the updated time of the updating information into the executing file list, and marking the state of the corresponding updating information in the executing file list as the updated state;
if the corresponding updating operation is failed to be executed, the prompt information that the corresponding updating operation cannot be executed is displayed.
In a third aspect, an electronic device is provided, the electronic device comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory are in communication with each other via the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of the above first aspects when executing a program stored on a memory.
In a fourth aspect, a computer-readable storage medium is provided, in which a computer program is stored which, when being executed by a processor, carries out the method steps of any of the first aspects.
The application provides a SQL file updating method, a SQL file updating device and electronic equipment; the method is applied to a server connected with a plurality of databases and comprises the following steps: acquiring update information of SQL files in different databases, writing creation time in the update information and file names of the corresponding SQL files into an execution file list, and marking the state of the update information in the execution file list as an un-updated state; acquiring an update execution instruction of a target file name corresponding to an un-updated state in an execution file list; detecting whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name; if yes, corresponding updating operation is executed on the corresponding SQL file according to the updating content corresponding to the target file name. The method can avoid repeated execution of the same updating operation and improve the efficiency of executing the updating operation on the SQL file.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a system architecture diagram provided in an embodiment of the present application, to which the SQL file updating method of the present application is applied;
FIG. 2 is a flowchart of an SQL file updating method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an SQL file update apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments of the present application without making any inventive effort, are intended to be within the scope of the present application.
The method for updating the SQL file provided in the embodiment of the present application may be applied to a system architecture shown in fig. 1, and as shown in fig. 1, the system may include: at least one client terminal, at least one database, and a server.
The server is respectively in communication connection with each client terminal and each database, wherein the server can be a physical server, can be a server cluster or a distributed system formed by a plurality of physical servers, and can also be a cloud server for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDNs), basic cloud computing services such as big data and artificial intelligent platforms, and the like.
Each database may store a plurality of SQL files, and different databases may store the same SQL file or different SQL files. The SQL file refers to a database script file.
The user using the client may be a developer. The client Terminal may be a Mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet personal computer (PAD), or other User Equipment (UE), a handheld device, a car-mounted device, a wearable device, a computing device, or other processing device connected to a wireless modem, a Mobile Station (MS), a Mobile Terminal (Mobile Terminal), or the like. The client terminals and the server may be directly or indirectly connected through wired or wireless communication, which is not limited herein.
At present, research and development personnel need to directly store the SQL file to be updated locally through the client terminal, and when the corresponding SQL file needs to be updated, the updating operation is executed in the corresponding database. Because of the large number of the SQL files stored locally, difficulty in viewing and other factors, research and development personnel tend to ignore or miss the SQL files to be updated during updating. Thus, once missed, the efficiency of SQL file updates is affected.
In order to solve the above-mentioned problems, the present application provides a method for updating an SQL file, which constructs an execution file list by an update content in update information of the SQL file, a creation time of the update information, an updated time of the update information, a file name of a corresponding SQL file, and an update operation, and determines whether to execute the update operation according to the update content in the corresponding update information by a relationship between the creation time and the updated time in the file list. By the method, repeated execution of the same updating operation can be avoided, and the updating efficiency of the SQL file and the accuracy of the updating operation of the SQL file are improved.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it being understood that the preferred embodiments described herein are for illustration and explanation only, and are not intended to limit the present application, and embodiments and features of embodiments of the present application may be combined with each other without conflict.
Fig. 2 is a flowchart of a method for updating an SQL file according to an embodiment of the present application. As shown in fig. 2, the method may include:
step S210, obtaining update information of SQL files in different databases.
The update information may include update content, creation time of the update information, file name of the corresponding SQL file, user ID, update operation, and designated database name, among others.
Specifically, the developer can encode the update information according to the customized encoding sequence.
For example: e20220329_1741_101_update_st_export_info.
E is a server identifier; 20220329 is Table 2022, 3, 29; 1741 is 17 min 41; 101 is a developer number 101; update is an update operation; st_export_info is the filename; update_st_export_info represents the data of the table that needs to be updated.
The developer can send the encoded update information to the server through the client terminal, so that the server can acquire the update information of SQL files in different databases.
The method can define the update information, can clearly record that a research and development personnel submits specific operation on data in a certain table or file at a certain time, and the server can store the update information according to the recorded information, so that the traceability and accuracy of the stored data are improved.
Step S220, writing the creation time in the update information and the file name of the corresponding SQL file into an execution file list, and marking the state of the update information in the execution file list as an un-updated state.
The execution file list may include, among other things, a creation time of the update information, an updated time of the history update information and a corresponding file name, a user ID, etc.
Specifically, the server writes the encoded update information into an extrafiledirectory of the code root directory, where extrafiledirectory is an execution file list.
The server marks the state of the updated information as an un-updated state in the execution file list, and sorts the file names according to the creation time sequence in the updated information. This approach can prevent dependencies between SQL files.
The method can collect the acquired updated information and the historical updated information.
In one example, the list of execution files may be as shown in Table 1.
TABLE 1
File name Status of Creation time Updated time User ID Database name
A-1 Not updated Time1 Empty space 101 Database 1/database 2
A-1 Updated Time2 Time21 103 Database 1/database 2
A-3 Not updated Time3 Empty space 101 Database 2/database 3
A-1 Not updated Time4 Empty space 102 Database 1/database 2
Step S230, obtaining an update execution instruction for the target file name corresponding to the un-updated state in the execution file list.
Specifically, the developer may send an update execution instruction of the target file name to the server through the client terminal, so that the server obtains the update execution instruction of the current target file name.
In some embodiments, the server matches the user ID that sent the update execution indication with the user ID that sent the update information for the SQL file in the different database, which was obtained separately;
if the matching is successful, step S240 is performed.
If the matching fails, prompt information that the updating operation cannot be executed according to the updating execution instruction is displayed.
In combination with table 1, for example, if the user ID for transmitting the update execution instruction is 101, and the user ID for transmitting the update information to the SQL file in the different database is 101, it indicates that the user ID matching is successful, step S240 is executed.
If the user ID for sending the update execution instruction is 101, and the user ID for sending the update information of the SQL files in different databases is 103, indicating that the user ID fails to match, displaying prompt information that the update operation cannot be executed according to the update execution instruction.
The method is to determine the identity of the developer by judging whether the user ID for transmitting the update information is consistent with the user ID for transmitting the update execution instruction. The method can ensure the safety and reliability of updating the SQL file in the database.
In some embodiments, after obtaining the update execution indication of the target file name corresponding to the non-updated state in the execution file list, the method may further include:
and detecting an update state corresponding to the target file name in the execution file list.
If the updated state is updated, prompt information that the update operation cannot be executed on the updated information of the updated state is displayed.
If the update status is not updated, step S240 is performed.
In combination with table 1, for example, the state corresponding to the update information with the file name a-1 for which the update execution instruction is acquired this time is the updated state. Since the server detects that the update state of the update information is the updated state, the prompt information that the update operation cannot be performed on the update information of the updated state is displayed.
Step S240, updating the SQL file corresponding to the target file name based on the creation time of the update information corresponding to the target file name in the execution file list and the updated time corresponding to the same file name.
Specifically, whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name is detected;
if yes, corresponding updating operation is executed on the corresponding SQL file according to the updating content corresponding to the target file name.
If not, displaying prompt information that corresponding updating operation cannot be executed on the corresponding SQL file according to the updating content corresponding to the target file name.
In connection with table 1, for example, the current update execution instruction is to execute a corresponding update operation according to the update content corresponding to the update information with the creation Time of Time1 of the file name a-1. Since the creation Time1 is earlier than the updated Time21 of the update information of the same file name, the prompt information that the corresponding update operation cannot be performed on the corresponding SQL file according to the update content corresponding to the target file name is displayed.
In some embodiments, before performing the corresponding update operation on the corresponding SQL file according to the update content corresponding to the target file name, the method may further include:
detecting whether the appointed database name exists in the update information corresponding to the target file name;
if not, determining that the corresponding SQL files are respectively updated in the databases according to the update contents corresponding to the target file names, and executing corresponding update operations on the corresponding SQL files.
If yes, determining the update content corresponding to the target file name in the designated database, and executing the corresponding update operation on the corresponding SQL file, which may include:
determining to match the name of the database corresponding to the target file name with the designated database name;
if the matching is successful, determining the updating content corresponding to the target file name in the database corresponding to the designated database name, and executing corresponding updating operation on the corresponding SQL file.
If the matching fails, prompt information that corresponding updating operation cannot be executed in the appointed database is displayed.
In connection with table 1, for example: in the update information, there is a use database 1, in which the database 1 specifies a database name.
The server matches the database 1 with the database name of the database corresponding to the target file name.
If the matching is successful, determining the updating content corresponding to the target file name in the database 1, and executing corresponding updating operation on the corresponding SQL file.
In some embodiments, the method may further comprise:
if the corresponding updating operation is successfully executed, determining the time for executing the updating operation as the updated time of the updating information, writing the updated time of the updating information into an execution file list, and marking the state of the corresponding updating information in the execution file list as the updated state.
If the corresponding updating operation is failed to be executed, the prompt information that the corresponding updating operation cannot be executed is displayed.
In some embodiments, after the corresponding update operation is performed successfully, the method may further include:
detecting whether a file name corresponding to the same non-updated state which is earlier than the creation time of the update information corresponding to the target file name exists in the execution file list;
if the file name exists, determining to delete the corresponding file name in the execution file list, and deleting the updated content corresponding to the file name.
If not, determining that the related deleting operation is not needed.
In some embodiments, the method may further comprise:
the manner in which the developer deletes the target update information for the SQL file in the different databases may include:
in the first way, the developer deletes the updated content corresponding to the target updated information, and sends the target updated information of the SQL file in the different databases to the server again through the client, so that the server returns to execute step S210 to step S240.
According to the method, by sending the update information with empty update content, the condition that research and development personnel cancel the update content in the update information according to the target can be simply and conveniently met, corresponding update operation is carried out on corresponding SQL files, and the working efficiency of the research and development personnel is improved.
In the second mode, the developer sends the update information corresponding to the same file name after the creation time of the target update information of the SQL file in the different databases, and sends the update execution instruction of the update information in the execution file list to the server through the client, so that the server returns to execute the steps S210 to S240. The server performs steps S210 to S240.
And deleting the file name of the target update information earlier than the creation time of the update information in the execution file list after the server successfully executes the corresponding update operation on the corresponding SQL file according to the update content in the update information, and deleting the update content corresponding to the file name.
This approach is applicable to update information that exists later than the target update information creation time. By the method, the research and development personnel can delete the updated content of the target updated information without performing related operations on the target updated information, and execute corresponding updating operations on the corresponding SQL file according to the updated content in the current updated information.
The application provides a SQL file updating method, a SQL file updating device and electronic equipment; the method is applied to a server connected with a plurality of databases and comprises the following steps: acquiring update information of SQL files in different databases, writing creation time in the update information and file names of the corresponding SQL files into an execution file list, and marking the state of the update information in the execution file list as an un-updated state; acquiring an update execution instruction of a target file name corresponding to an un-updated state in an execution file list; detecting whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name; if yes, corresponding updating operation is executed on the corresponding SQL file according to the updating content corresponding to the target file name. The method can avoid repeated execution of the same updating operation and improve the efficiency of executing the updating operation on the SQL file.
Corresponding to the method, the embodiment of the application also provides an SQL file updating device, as shown in fig. 3, which comprises:
the obtaining unit 310 is configured to obtain update information of SQL files in different databases, where the update information includes update content, creation time of the update information, file name of the corresponding SQL file, and update operation.
A writing unit 320, configured to write the creation time in the update information and the file name of the corresponding SQL file into the execution file list, and mark the state of the update information in the execution file list as an un-updated state; the execution file list includes updated times of the history update information and corresponding file names.
The obtaining unit 310 is further configured to obtain an update execution instruction for a target file name corresponding to the non-updated state in the execution file list.
A detecting unit 330, configured to detect whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name; if yes, corresponding updating operation is executed on the corresponding SQL file according to the updating content corresponding to the target file name.
The functions of each functional unit of the SQL file updating apparatus provided in the foregoing embodiments of the present application may be implemented through the foregoing method steps, so specific working processes and beneficial effects of each unit in the SQL file updating apparatus provided in the embodiments of the present application are not repeated herein.
The embodiment of the present application further provides an electronic device, as shown in fig. 4, including a processor 410, a communication interface 420, a memory 430, and a communication bus 440, where the processor 410, the communication interface 420, and the memory 430 complete communication with each other through the communication bus 440.
A memory 430 for storing a computer program;
the processor 410 is configured to execute the program stored in the memory 430, and implement the following steps:
and acquiring the update information of the SQL files in different databases, wherein the update information comprises update contents, creation time of the update information, file names of the corresponding SQL files and update operation.
Writing the creation time in the update information and the file name of the corresponding SQL file into an execution file list, and marking the state of the update information in the execution file list as an un-updated state; the execution file list includes updated times of the history update information and corresponding file names.
Acquiring an update execution instruction of a target file name corresponding to an un-updated state in an execution file list;
and detecting whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name.
If yes, corresponding updating operation is executed on the corresponding SQL file according to the updating content corresponding to the target file name.
The communication bus mentioned above may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
Since the implementation manner and the beneficial effects of the solution to the problem of each device of the electronic apparatus in the foregoing embodiment may be implemented by referring to each step in the embodiment shown in fig. 2, the specific working process and the beneficial effects of the electronic apparatus provided in the embodiment of the present application are not repeated herein.
In yet another embodiment provided herein, a computer readable storage medium is provided, in which instructions are stored, which when run on a computer, cause the computer to perform the SQL file update method described in any of the above embodiments.
In yet another embodiment provided herein, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform the SQL file update method of any of the above embodiments.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted to embrace the preferred embodiments and all such variations and modifications as fall within the scope of the embodiments herein.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if such modifications and variations of the embodiments in the present application fall within the scope of the claims and the equivalents thereof in the embodiments of the present application, such modifications and variations are also intended to be included in the embodiments of the present application.
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. Indeed, the features and functions of two or more of the elements described above may be embodied in one element in accordance with embodiments of the present application. Conversely, the features and functions of one unit described above may be further divided into a plurality of units to be embodied.
Furthermore, although the operations of the methods of the present application are depicted in the drawings in a particular order, this is not required to or suggested that these operations must be performed in this particular order or that all of the illustrated operations must be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.

Claims (10)

1. A method for updating an SQL file applied to a server connected to a plurality of databases, the method comprising:
acquiring update information of SQL files in different databases, wherein the update information comprises update contents, creation time of the update information, file names of corresponding SQL files and update operation;
writing the creation time in the update information and the file name of the corresponding SQL file into an execution file list, and marking the state of the update information in the execution file list as an un-updated state; the execution file list comprises updated time of the history update information and corresponding file names;
acquiring an update execution instruction of a target file name corresponding to an un-updated state in the execution file list;
detecting whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name;
if yes, corresponding updating operation is executed on the corresponding SQL file according to the updating content corresponding to the target file name.
2. The method of claim 1, wherein after performing the respective update operation on the respective SQL file, the method further comprises:
if the corresponding updating operation is successfully executed, determining the time for executing the updating operation as the updated time of the updating information, writing the updated time of the updating information into the executing file list, and marking the state of the corresponding updating information in the executing file list as the updated state;
if the corresponding updating operation is failed to be executed, the prompt information that the corresponding updating operation cannot be executed is displayed.
3. The method of claim 1, wherein before performing the respective update operation on the respective SQL file according to the update content corresponding to the target file name, the method further comprises:
detecting whether the appointed database name exists in the update information corresponding to the target file name;
if yes, executing corresponding updating operation on the corresponding SQL file according to the updating content corresponding to the target file name, wherein the updating operation comprises the following steps:
determining to match the name of the database corresponding to the target file name with the designated database name;
if the matching is successful, determining that the corresponding updating operation is executed on the corresponding SQL file according to the updating content corresponding to the target file name in the database corresponding to the successfully matched database name;
if the matching fails, prompt information that corresponding updating operation cannot be executed in the appointed database is displayed.
4. The method of claim 2, wherein after performing the respective update operation is successful, the method further comprises:
detecting whether file names corresponding to the same non-updated state exist in the execution file list, wherein the file names correspond to the same non-updated state and are earlier than the creation time of the update information corresponding to the target file name;
if the file name exists, determining to delete the corresponding file name in the execution file list, and deleting the updated content corresponding to the corresponding file name.
5. The method of claim 1, wherein after obtaining the update execution indication for the target file name corresponding to the non-updated state in the execution file list, the method further comprises:
if the obtained user ID for sending the update execution instruction is successfully matched with the obtained user ID for sending the update information of SQL files in different databases, whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name is detected.
6. The method of claim 5, wherein after the user ID sending the update execution indication matches the user ID sending the update information for the SQL file in the different database successfully, the method further comprises:
detecting an update state corresponding to the target file name in the execution file list;
if the update status is not updated, detecting whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name.
7. An SQL file update apparatus for use with a server connected to a plurality of databases, the apparatus comprising:
the system comprises an acquisition unit, a storage unit and a storage unit, wherein the acquisition unit is used for acquiring update information of SQL files in different databases, and the update information comprises update contents, creation time of the update information, file names of corresponding SQL files and update operation;
the writing unit is used for writing the creation time in the update information and the file name of the corresponding SQL file into an execution file list, and marking the state of the update information as an un-updated state in the execution file list; the execution file list comprises updated time of the history update information and corresponding file names;
the acquiring unit is further configured to acquire an update execution instruction for a target file name corresponding to an un-updated state in the execution file list;
the detection unit is used for detecting whether the creation time of the update information corresponding to the target file name in the execution file list is later than the updated time corresponding to the same file name; if yes, corresponding updating operation is executed on the corresponding SQL file according to the updating content corresponding to the target file name.
8. The apparatus of claim 7, wherein the detecting unit is further configured to detect a result of the corresponding SQL file performing the corresponding update operation;
if the corresponding updating operation is successfully executed, determining the time for executing the updating operation as the updated time of the updating information, writing the updated time of the updating information into the executing file list, and marking the state of the corresponding updating information in the executing file list as the updated state;
if the corresponding updating operation is failed to be executed, the prompt information that the corresponding updating operation cannot be executed is displayed.
9. An electronic device, characterized in that the electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are in communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-6 when executing a program stored on a memory.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-6.
CN202310507380.7A 2023-05-06 2023-05-06 SQL file updating method and device and electronic equipment Pending CN116483849A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310507380.7A CN116483849A (en) 2023-05-06 2023-05-06 SQL file updating method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310507380.7A CN116483849A (en) 2023-05-06 2023-05-06 SQL file updating method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN116483849A true CN116483849A (en) 2023-07-25

Family

ID=87226802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310507380.7A Pending CN116483849A (en) 2023-05-06 2023-05-06 SQL file updating method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN116483849A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6507834B1 (en) * 1999-12-22 2003-01-14 Ncr Corporation Method and apparatus for parallel execution of SQL from stored procedures
CN106997223A (en) * 2016-01-25 2017-08-01 姜洪军 Mobile visual field
CN108536752A (en) * 2018-03-13 2018-09-14 北京信安世纪科技有限公司 A kind of method of data synchronization, device and equipment
KR20230014433A (en) * 2021-07-21 2023-01-30 주식회사 디씨지 Foreign language learning management system and method based on artificial intelligence
CN115730008A (en) * 2022-11-10 2023-03-03 阿里云计算有限公司 Log analysis method, data synchronization system, electronic device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6507834B1 (en) * 1999-12-22 2003-01-14 Ncr Corporation Method and apparatus for parallel execution of SQL from stored procedures
CN106997223A (en) * 2016-01-25 2017-08-01 姜洪军 Mobile visual field
CN108536752A (en) * 2018-03-13 2018-09-14 北京信安世纪科技有限公司 A kind of method of data synchronization, device and equipment
KR20230014433A (en) * 2021-07-21 2023-01-30 주식회사 디씨지 Foreign language learning management system and method based on artificial intelligence
CN115730008A (en) * 2022-11-10 2023-03-03 阿里云计算有限公司 Log analysis method, data synchronization system, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN108196878B (en) Method and device for generating application program installation package, electronic equipment and storage medium
CN107633016B (en) Data processing method and device and electronic equipment
CN114465998A (en) Multi-device file transmission method and device, terminal device and readable storage medium
CN109408309B (en) Multi-terminal testing method and device
CN110647463B (en) Method and device for restoring test breakpoint and electronic equipment
CN111221742A (en) Test case updating method and device, storage medium and server
CN111400178A (en) Automatic interface number making method and device, computer equipment and storage medium
CN108429636B (en) Method and device for positioning abnormal system and electronic equipment
CN110427538B (en) Data query method, data storage method, data query device, data storage device and electronic equipment
CN116483849A (en) SQL file updating method and device and electronic equipment
CN115390939B (en) Service processing method and system
CN111444253A (en) Data import method and device, computer readable storage medium and computer equipment
CN114579171A (en) Code processing method and device, computer equipment and storage medium
CN115438723A (en) Data fusion method, device, equipment and storage medium
CN111400245B (en) Art resource migration method and device
CN114625751A (en) Data tracing query method and device based on block chain
CN111367634A (en) Information processing method, information processing device and terminal equipment
CN112686759A (en) Account checking monitoring method, device, equipment and medium
CN114818645B (en) Automatic report generation method, device, equipment and medium based on data body
CN113900959B (en) Software testing method, device, equipment and storage medium
CN114900531B (en) Data synchronization method, device and system
CN114153830B (en) Data verification method and device, computer storage medium and electronic equipment
CN112380203B (en) Data comparison method, device and storage medium
CN112966764B (en) Pattern comparison method and device
CN117215624A (en) Metadata change method and device in low-code platform, electronic equipment and 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