SQL file updating method, device and electronic device

By constructing a list of executing files and automatically detecting the update information, the problem of easy omissions when developers are easily leaked when multi -person collaboration updates the SQL file, and improves the efficiency and accuracy of SQL file updates.

CN116483849BActive Publication Date: 2025-01-24北京合思信息技术有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310507380.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-06
Publication Date
2025-01-24
Estimated Expiration
2043-05-06

AI Technical Summary

Technical Problem

In a software system, when multiple R&D personnel update SQL files at the same time, it is easy to ignore or miss the SQL files to be updated, resulting in inefficient updates.

Method used

By obtaining the update information of SQL files in different databases, build a list of execution files, mark the update status, and automatically detect and perform update operations based on the creation time and update time of the update information to avoid repeated updates.

Benefits of technology

It improves the update efficiency of SQL files, ensures that all SQL files to be updated can be updated accurately, and reduces the risk of human omissions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116483849B_ABST
    Figure CN116483849B_ABST
Patent Text Reader

Abstract

The present application provides a SQL file update method, device and electronic device; the method is applied to a server connected to multiple databases, including: obtaining update information of SQL files in different databases, writing the creation time and the file name of the corresponding SQL file in the update information into an execution file list, and marking the state of the update information as an unupdated state in the execution file list; obtaining an update execution instruction for the target file name corresponding to the unupdated 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 so, executing the corresponding update operation on the corresponding SQL file according to the update content corresponding to the target file name. The method can avoid repeated execution of the same update operation and improve the efficiency of executing update operations on SQL files.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of databases, and in particular to a SQL file updating method, device and electronic device. Background Art

[0002] At present, many software systems or internal enterprise systems developed by enterprises or software development companies need to be updated. There are many functional modules involved in the system. When each functional module needs to be updated, the executed SQL files also need to be updated. With the increase in update requirements, a single requirement often requires multiple R&D personnel to develop at the same time. Different R&D personnel directly store the SQL files to be updated locally and perform update operations when the corresponding SQL files need to be updated. Due to the large number of SQL files stored locally and the difficulty in viewing, R&D personnel often ignore or omit the SQL files to be updated during the update. Therefore, once omitted, the update efficiency of the SQL file will be affected. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a SQL file updating method, device and electronic device to solve the above-mentioned problems existing in the prior art and improve the updating efficiency of the SQL file.

[0004] In a first aspect, a SQL file update method is provided, which is applied to a server connected to multiple databases. The method may include:

[0005] Obtain update information of SQL files in different databases, the update information including update content, creation time of the update information, file name of the corresponding SQL file and update operation;

[0006] Write the creation time and the file name of the corresponding SQL file in the update information into the execution file list, and mark the status of the update information as unupdated in the execution file list; the execution file list includes the update time and the corresponding file name of the historical update information;

[0007] Obtaining an update execution instruction for a target file name corresponding to a non-updated state in the execution file list;

[0008] 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;

[0009] If so, a corresponding update operation is performed on the corresponding SQL file according to the update content corresponding to the target file name.

[0010] In a possible implementation, after performing a corresponding update operation on a corresponding SQL file, the method further includes:

[0011] If the corresponding update operation is successfully executed, the time of executing the update operation is determined as the updated time of the update information, the updated time of the update information is written into the execution file list, and the status of the corresponding update information is marked as the updated status in the execution file list;

[0012] If the corresponding update operation fails, a prompt message indicating that the corresponding update operation cannot be performed is displayed.

[0013] In a possible implementation, before performing a corresponding update operation on a corresponding SQL file according to the update content corresponding to the target file name, the method further includes:

[0014] Detect whether there is a specified database name in the update information corresponding to the target file name;

[0015] If yes, then according to the update content corresponding to the target file name, a corresponding update operation is performed on the corresponding SQL file, including:

[0016] Determine to match the name of the database corresponding to the target file name with the specified database name;

[0017] If the match is successful, determine to perform a corresponding update operation on the corresponding SQL file in the database corresponding to the successfully matched database name according to the update content corresponding to the target file name;

[0018] If the match fails, a prompt message will be displayed indicating that the corresponding update operation cannot be performed in the specified database.

[0019] In a possible implementation, after the corresponding update operation is successfully performed, the method further includes:

[0020] Detect whether there is a file name corresponding to the same unupdated state that is earlier than the creation time of the update information corresponding to the target file name in the execution file list;

[0021] If it exists, it is determined to delete the corresponding file name in the execution file list, and delete the update content corresponding to the corresponding file name.

[0022] In a possible implementation, after obtaining the update execution instruction for the target file name corresponding to the unupdated state in the execution file list, the method further includes:

[0023] If the user ID obtained for sending the update execution instruction successfully matches the user ID obtained for sending update information for SQL files in different databases, it is detected 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.

[0024] In a possible implementation, after the user ID that sends the update execution instruction successfully matches the user ID that sends the update information for the SQL files in different databases, the method further includes:

[0025] Detecting the update status corresponding to the target file name in the executable file list;

[0026] If the update status is not updated, it is detected 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.

[0027] In a second aspect, a SQL file updating device is provided, which is applied to a server connected to multiple databases, and the device may include:

[0028] An acquisition unit, used to acquire update information of SQL files in different databases, wherein the update information includes update content, creation time of the update information, file name of the corresponding SQL file and update operation;

[0029] A writing unit, used to write the creation time and the file name of the corresponding SQL file in the update information into an execution file list, and mark the status of the update information as an unupdated status in the execution file list; the execution file list includes the update time and the corresponding file name of the historical update information;

[0030] The acquisition unit is further used to acquire an update execution instruction for a target file name corresponding to a non-updated state in the execution file list;

[0031] The detection unit is used 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 so, perform a corresponding update operation on the corresponding SQL file according to the update content corresponding to the target file name.

[0032] The detection unit is also used to detect the result of the corresponding SQL file executing the corresponding update operation;

[0033] If the corresponding update operation is successfully executed, the time of executing the update operation is determined as the updated time of the update information, the updated time of the update information is written into the execution file list, and the status of the corresponding update information is marked as the updated status in the execution file list;

[0034] If the corresponding update operation fails, a prompt message indicating that the corresponding update operation cannot be performed is displayed.

[0035] 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 communicate with each other via the communication bus;

[0036] Memory, used to store computer programs;

[0037] The processor is used to implement any method step described in the first aspect when executing the program stored in the memory.

[0038] In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.

[0039] The present application provides a SQL file update method, device and electronic device; the method is applied to a server connected to multiple databases, including: obtaining update information of SQL files in different databases, writing the creation time and the file name of the corresponding SQL file in the update information into an execution file list, and marking the state of the update information as an unupdated state in the execution file list; obtaining an update execution instruction for the target file name corresponding to the unupdated 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 so, executing the corresponding update operation on the corresponding SQL file according to the update content corresponding to the target file name. The method can avoid repeated execution of the same update operation and improve the efficiency of executing update operations on SQL files. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 A system architecture diagram of an embodiment of the present application to which the SQL file updating method of the present application is applied;

[0042] Figure 2 A flowchart of a SQL file update method provided in an embodiment of the present application;

[0043] Figure 3 A schematic diagram of the structure of an SQL file updating device provided in an embodiment of the present application;

[0044] Figure 4A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0046] A method for updating an SQL file provided in an embodiment of the present application can be applied to Figure 1 In the system architecture shown in Figure 1 As shown, the system may include: at least one client terminal, at least one database and a server.

[0047] The server is communicated with each client terminal and each database respectively. The server can be a physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), as well as big data and artificial intelligence platforms.

[0048] Each database can store multiple SQL files, and different databases can store the same SQL file or different SQL files. The SQL file refers to the database script file.

[0049] Among them, the user using the client can be a research and development personnel. The client terminal can be a user equipment (UE) such as a mobile phone, a smart phone, a laptop, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a handheld device, a vehicle-mounted device, a wearable device, a computing device or other processing equipment connected to a wireless modem, a mobile station (MS), a mobile terminal, etc. Each client terminal can be directly or indirectly connected to the server through a wired or wireless communication method, which is not limited in this application.

[0050] Currently, developers need to store the SQL files to be updated directly locally through the client terminal. When the corresponding SQL files need to be updated, the update operation is performed in the corresponding database. Due to the large number of SQL files stored locally and the difficulty in viewing, developers often ignore or miss the SQL files to be updated during the update. Therefore, once missed, the efficiency of SQL file update will be affected.

[0051] In order to solve the above problems, the present application provides a method for updating an SQL file, which constructs an execution file list through the update content in the update information of the SQL file, the creation time of the update information, the updated time of the update information, the file name of the corresponding SQL file, and the update operation, and determines whether to execute the update operation according to the update content in the corresponding update information through the relationship between the creation time and the updated time in the file list. In this way, the same update operation can be avoided from being executed repeatedly, and the update efficiency of the SQL file and the accuracy of executing the update operation on the SQL file can be improved.

[0052] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.

[0053] Figure 2 A flowchart of a method for updating an SQL file provided in an embodiment of the present application. Figure 2 As shown, the method may include:

[0054] Step S210: Obtain update information of SQL files in different databases.

[0055] 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 specified database name, etc.

[0056] Specifically, the R&D personnel can encode the update information according to a custom encoding sequence.

[0057] For example: E20220329_1741_101_update_st_export_info.sql.

[0058] Among them, E is the server ID; 20220329 is the table March 29, 2022; 1741 is 17:41; 101 is the 101st developer; update is the update operation; st_export_info is the file name; update_st_export_info means that the data in the st_export_info table needs to be updated.

[0059] The R&D personnel can send the encoded update information to the server through the client terminal, so that the server can obtain the update information of the SQL files in different databases.

[0060] This method can define update information and clearly record the specific operations submitted by a developer on the data in a table or file at a certain time. The server can also store the update information based on the recorded information, thereby improving the traceability and accuracy of the stored data.

[0061] Step S220: Write the creation time and the file name of the corresponding SQL file in the update information into the execution file list, and mark the status of the update information as not updated in the execution file list.

[0062] The execution file list may include the creation time of the update information, the update time of the historical update information, the corresponding file name, the user ID, etc.

[0063] Specifically, the server writes the encoded update information into the executeFileDirectory of the code root directory, where executeFileDirectory is an execution file list.

[0064] The server marks the status of the updated information as not updated in the execution file list and sorts the file names according to the creation time in the update information. This method can prevent dependencies between SQL files.

[0065] This method can summarize the acquired update information and historical update information.

[0066] In one example, the execution file list may be as shown in Table 1.

[0067] Table 1

[0068] file name state Creation time Updated time User ID Database Name A-1 Not updated Time1 null 101 Database 1 / Database 2 A-1 Updated Time2 Time21 103 Database 1 / Database 2 A-3 Not updated Time3 null 101 Database 2 / Database 3 A-1 Not updated Time4 null 102 Database 1 / Database 2

[0069] Step S230: Obtain an update execution instruction for the target file name corresponding to the unupdated state in the execution file list.

[0070] Specifically, the R&D personnel may send the 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 target file name this time.

[0071] In some embodiments, the server matches the respectively acquired user IDs of sending update execution instructions with the user IDs of sending update information for SQL files in different databases;

[0072] If the match is successful, execute step S240.

[0073] If the matching fails, a prompt message is displayed indicating that the update operation cannot be performed according to the update execution instruction.

[0074] In conjunction with Table 1, for example, if the user ID sending the update execution instruction is 101, and the user ID sending the update information for the SQL files in different databases is 101, indicating that the user ID matches successfully, step S240 is executed.

[0075] If the user ID sending the update execution instruction is 101, and the user ID sending the update information for the SQL files in different databases is 103, indicating that the user ID matching fails, a prompt message indicating that the update operation cannot be performed according to the update execution instruction is displayed.

[0076] This method determines the identity of the developer by judging whether the user ID that sends the update information is consistent with the user ID that sends the update execution instruction. This method can ensure the security and reliability of updating the SQL file in the database.

[0077] In some embodiments, after obtaining an update execution instruction for a target file name corresponding to a non-updated state in the execution file list, the method may further include:

[0078] Check the update status of the target file name in the execution file list.

[0079] If the update status is updated, a prompt message is displayed indicating that the update operation cannot be performed on the update information in the updated status.

[0080] If the update status is not updated, step S240 is executed.

[0081] In conjunction with Table 1, for example, the update information of the file named A-1 for which the update execution instruction is obtained this time corresponds to the updated state. Since the server detects that the update information has the updated state, it displays a prompt message indicating that the update operation cannot be performed on the updated information in the updated state.

[0082] Step S240: Update 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.

[0083] Specifically, it is detected 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;

[0084] If so, the corresponding update operation is performed on the corresponding SQL file according to the update content corresponding to the target file name.

[0085] If not, a prompt message is displayed indicating that the corresponding update operation cannot be performed on the corresponding SQL file according to the update content corresponding to the target file name.

[0086] In conjunction with Table 1, for example, the update execution instruction is to execute the corresponding update operation according to the update content corresponding to the update information with the file name A-1 and the creation time Time1. Since the creation time Time1 is earlier than the updated time Time21 of the update information with the same file name, a prompt message is displayed indicating that the corresponding update operation cannot be executed on the corresponding SQL file according to the update content corresponding to the target file name.

[0087] In some embodiments, before performing a corresponding update operation on a corresponding SQL file according to the update content corresponding to the target file name, the method may further include:

[0088] Check whether the update information corresponding to the target file name contains the specified database name;

[0089] If not, it is determined that in each database, a corresponding update operation is performed on the corresponding SQL file according to the update content corresponding to the target file name.

[0090] If yes, then determine in the specified database to perform a corresponding update operation on the corresponding SQL file according to the update content corresponding to the target file name, which may include:

[0091] Make sure to match the name of the database corresponding to the target file name with the specified database name;

[0092] If the match is successful, it is determined that a corresponding update operation is performed on a corresponding SQL file in a database corresponding to the specified database name according to the update content corresponding to the target file name.

[0093] If the match fails, a prompt message will be displayed indicating that the corresponding update operation cannot be performed in the specified database.

[0094] In conjunction with Table 1, for example, the update information contains use database 1, where database 1 specifies the name of a database.

[0095] The server matches database 1 with the database name of the database corresponding to the target file name.

[0096] If the match is successful, it is determined that in database 1, a corresponding update operation is performed on the corresponding SQL file according to the update content corresponding to the target file name.

[0097] In some embodiments, the method may further include:

[0098] If the corresponding update operation is successfully executed, the time of executing the update operation is determined as the updated time of the update information, the updated time of the update information is written into the execution file list, and the status of the corresponding update information is marked as the updated status in the execution file list.

[0099] If the corresponding update operation fails, a prompt message indicating that the corresponding update operation cannot be performed is displayed.

[0100] In some embodiments, after the corresponding update operation is successfully performed, the method may further include:

[0101] Check whether there is a file name corresponding to the same unupdated state that is earlier than the creation time of the update information corresponding to the target file name in the execution file list;

[0102] If it exists, it is determined to delete the corresponding file name in the execution file list, and delete the update content corresponding to the file name.

[0103] If it does not exist, no deletion is required.

[0104] In some embodiments, the method may further include:

[0105] The methods that developers can use to delete the target update information of SQL files in different databases in the server include:

[0106] Method 1: The developer deletes the update content corresponding to the target update information, and resends the target update information of the SQL files in different databases to the server through the client, so that the server returns to execute steps S210 to S240.

[0107] This method is to send an update message with empty update content, which can simply and conveniently meet the needs of R&D personnel to cancel the update content in the target update message, perform corresponding update operations on the corresponding SQL file, and improve the work efficiency of R&D personnel.

[0108] In the second method, the developer sends the update information corresponding to the same file name later than the creation time of the target update information of the SQL files in 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 steps S210 to S240. The server executes steps S210 to S240.

[0109] After the server successfully executes the corresponding update operation on the corresponding SQL file according to the update content in the update information, the server deletes the file name of the target update information earlier than the creation time of the update information in the execution file list, and deletes the update content corresponding to the file name.

[0110] This method is suitable for update information that is later than the creation time of the target update information. In this way, developers do not need to perform relevant operations on the target update information. The server will delete the update content of the target update information and perform corresponding update operations on the corresponding SQL file based on the update content in the current update information. This method saves developers time and improves their work efficiency.

[0111] The present application provides a SQL file update method, device and electronic device; the method is applied to a server connected to multiple databases, including: obtaining update information of SQL files in different databases, writing the creation time and the file name of the corresponding SQL file in the update information into an execution file list, and marking the state of the update information as an unupdated state in the execution file list; obtaining an update execution instruction for the target file name corresponding to the unupdated 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 so, executing the corresponding update operation on the corresponding SQL file according to the update content corresponding to the target file name. The method can avoid repeated execution of the same update operation and improve the efficiency of executing update operations on SQL files.

[0112] Corresponding to the above method, the embodiment of the present application also provides a SQL file updating device, such as Figure 3 As shown, the device comprises:

[0113] The acquisition unit 310 is used to acquire 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.

[0114] The writing unit 320 is used to write the creation time and the file name of the corresponding SQL file in the update information into the execution file list, and mark the status of the update information as unupdated in the execution file list; the execution file list includes the updated time and corresponding file name of the historical update information.

[0115] The acquisition unit 310 is further configured to acquire an update execution instruction for a target file name corresponding to a non-updated state in the execution file list.

[0116] The detection unit 330 is used 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 so, perform a corresponding update operation on the corresponding SQL file according to the update content corresponding to the target file name.

[0117] The functions of each functional unit of the SQL file updating device provided in the above embodiment of the present application can be realized through the above method steps. Therefore, the specific working process and beneficial effects of each unit in the SQL file updating device provided in the embodiment of the present application are not repeated here.

[0118] The present application also provides an electronic device, such as Figure 4 As shown, it includes a processor 410 , a communication interface 420 , a memory 430 and a communication bus 440 , wherein the processor 410 , the communication interface 420 , and the memory 430 communicate with each other via the communication bus 440 .

[0119] Memory 430, for storing computer programs;

[0120] The processor 410 is used to execute the program stored in the memory 430 to implement the following steps:

[0121] Get the update information of SQL files in different databases, including the update content, creation time of the update information, file name of the corresponding SQL file and update operation.

[0122] The creation time and the file name of the corresponding SQL file in the update information are written into the execution file list, and the status of the update information is marked as not updated in the execution file list; the execution file list includes the updated time and corresponding file name of the historical update information.

[0123] Get an update execution instruction for the target file name corresponding to the unupdated state in the execution file list;

[0124] Check 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.

[0125] If so, the corresponding update operation is performed on the corresponding SQL file according to the update content corresponding to the target file name.

[0126] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0127] The communication interface is used for communication between the above electronic device and other devices.

[0128] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0129] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0130] The implementation methods and beneficial effects of the components of the electronic device in the above embodiments to solve the problems can be seen in Figure 2 The various steps in the illustrated embodiment are implemented, therefore, the specific working process and beneficial effects of the electronic device provided by the embodiment of the present application are not repeated here.

[0131] In another embodiment provided by the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer executes the SQL file updating method described in any one of the above embodiments.

[0132] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the SQL file updating method described in any one of the above embodiments.

[0133] Those skilled in the art will appreciate that the embodiments in the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt a complete hardware embodiment, a complete software embodiment, or a form of an embodiment combining software and hardware. Moreover, the present application may adopt a form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0134] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0135] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0137] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.

[0138] Obviously, those skilled in the art can make various changes and modifications to the embodiments in the present application without departing from the spirit and scope of the embodiments in the present application. Thus, if these modifications and variations of the embodiments in the present application fall within the scope of the claims and their equivalents in the embodiments of the present application, the embodiments of the present application are also intended to include these modifications and variations.

[0139] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0140] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

Claims

1. A SQL file update method, characterized in that: Applied to a server connected to multiple databases, the method comprises: Obtain update information of SQL files in different databases, the update information including update content, creation time of the update information, file name of the corresponding SQL file and update operation; Write the creation time and the file name of the corresponding SQL file in the update information into the execution file list, and mark the status of the update information as unupdated in the execution file list; the execution file list includes the update time and the corresponding file name of the historical update information; Obtaining an update execution instruction for a target file name corresponding to a non-updated state in the execution file list; 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, then perform corresponding update operation on the corresponding SQL file according to the update content corresponding to the target file name; The method further comprises: Delete the target update information of the SQL file in the database, including: Obtain current update information of the SQL file in the corresponding database, and return to the execution step: obtain update information of the SQL file in the different database; wherein the creation time in the current information is later than the target creation time of the target update information of the SQL file in the database.

2. The method according to claim 1, characterized in that After performing the corresponding update operation on the corresponding SQL file, the method further includes: If the corresponding update operation is successfully executed, the time of executing the update operation is determined as the updated time of the update information, the updated time of the update information is written into the execution file list, and the status of the corresponding update information is marked as the updated status in the execution file list; If the corresponding update operation fails, a prompt message indicating that the corresponding update operation cannot be performed is displayed.

3. The method according to claim 1, characterized in that Before performing a corresponding update operation on a corresponding SQL file according to the update content corresponding to the target file name, the method further includes: Detect whether there is a specified database name in the update information corresponding to the target file name; If yes, then according to the update content corresponding to the target file name, a corresponding update operation is performed on the corresponding SQL file, including: Determine to match the name of the database corresponding to the target file name with the specified database name; If the match is successful, determine to perform a corresponding update operation on the corresponding SQL file in the database corresponding to the successfully matched database name according to the update content corresponding to the target file name; If the match fails, a prompt message will be displayed indicating that the corresponding update operation cannot be performed in the specified database.

4. The method according to claim 2, characterized in that After the corresponding update operation is successfully executed, the method further includes: Detect whether there is a file name corresponding to the same unupdated state that is earlier than the creation time of the update information corresponding to the target file name in the execution file list; If it exists, it is determined to delete the corresponding file name in the execution file list, and delete the update content corresponding to the corresponding file name.

5. The method according to claim 1, characterized in that After obtaining the update execution instruction for the target file name corresponding to the unupdated state in the execution file list, the method further includes: If the user ID obtained for sending the update execution instruction successfully matches the user ID obtained for sending update information for SQL files in different databases, it is detected 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.

6. The method according to claim 5, characterized in that, After the user ID that sends the update execution instruction successfully matches the user ID that sends the update information of the SQL files in different databases, the method further includes: Detecting the update status corresponding to the target file name in the executable file list; If the update status is not updated, it is detected 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. A SQL file updating device, characterized in that: Applicable to a server connected to multiple databases, the device comprises: An acquisition unit, used to acquire update information of SQL files in different databases, wherein 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, used to write the creation time and the file name of the corresponding SQL file in the update information into an execution file list, and mark the status of the update information as an unupdated status in the execution file list; the execution file list includes the update time and the corresponding file name of the historical update information; The acquisition unit is further used to acquire an update execution instruction for a target file name corresponding to a non-updated state in the execution file list; A detection unit, 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 so, performing a corresponding update operation on the corresponding SQL file according to the update content corresponding to the target file name; The device further comprises: a deleting unit; The deleting unit is used to delete the target update information of the SQL file in the database, including: Obtain current update information of the SQL file in the corresponding database, and return to the execution step: obtain update information of the SQL file in the different database; wherein the creation time in the current information is later than the target creation time of the target update information of the SQL file in the database.

8. The device according to claim 7, characterized in that The detection unit is also used to detect the result of the corresponding SQL file executing the corresponding update operation; If the corresponding update operation is successfully executed, the time of executing the update operation is determined as the updated time of the update information, the updated time of the update information is written into the execution file list, and the status of the corresponding update information is marked as the updated status in the execution file list; If the corresponding update operation fails, a prompt message indicating that the corresponding update operation cannot be performed 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 communicate with each other via the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Data synchronization method, device and equipment

    CN108536752A