CN113779000A - Database updating method and system, storage medium and electronic device - Google Patents

Database updating method and system, storage medium and electronic device Download PDF

Info

Publication number
CN113779000A
CN113779000A CN202111344430.1A CN202111344430A CN113779000A CN 113779000 A CN113779000 A CN 113779000A CN 202111344430 A CN202111344430 A CN 202111344430A CN 113779000 A CN113779000 A CN 113779000A
Authority
CN
China
Prior art keywords
data
database
updating
preset
time
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.)
Granted
Application number
CN202111344430.1A
Other languages
Chinese (zh)
Other versions
CN113779000B (en
Inventor
庞世娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jindi Technology Co Ltd
Original Assignee
Beijing Jindi 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 Jindi Technology Co Ltd filed Critical Beijing Jindi Technology Co Ltd
Priority to CN202111344430.1A priority Critical patent/CN113779000B/en
Publication of CN113779000A publication Critical patent/CN113779000A/en
Application granted granted Critical
Publication of CN113779000B publication Critical patent/CN113779000B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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

Landscapes

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

Abstract

The invention provides a database updating method and system, a storage medium and an electronic device, wherein the method comprises the following steps: acquiring data updating request information of a target database; the data updating request information comprises user identity authentication information and data updating authentication information; updating data in the source database to a download database; according to the data updating request information, simultaneously verifying the user identity information and verifying whether the data in the target database needs to be updated; and if the verification is passed, updating the data in the updated download database to the target database. The database updating method and system, the storage medium and the electronic equipment provided by the invention adopt the parallel double thread to simultaneously verify the user identity information and verify whether the data in the target database needs to be updated, thereby shortening the verification time and improving the verification efficiency.

Description

Database updating method and system, storage medium and electronic device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a database updating method and system, a storage medium, and an electronic device.
Background
A Database (english name: Database) is a warehouse that organizes, stores, and manages data according to a data structure. Databases are of many types, and from the simplest tables storing various data to large database systems capable of storing mass data, the databases are widely applied in various aspects, such as mysql, Oracle and the like.
In the information-oriented society, various information resources are managed and utilized sufficiently and effectively, which is a precondition for scientific research and decision management. The database technology is a core part of various information systems such as a management information system, an office automation system, a decision support system and the like, and is an important technical means for scientific research and decision management. Therefore, how to update the data in the database efficiently, quickly, and accurately so as to provide the latest data for each system becomes a problem to be solved urgently.
Disclosure of Invention
The technical problems to be solved by the invention are how to improve the data updating efficiency of the target database, how to accurately acquire the newly added data and update the newly added data into the target database so as to improve the data updating efficiency and reduce the operating pressure of downloading the database. In order to solve the technical problem, embodiments of the present invention provide a database updating method and system, a storage medium, and an electronic device.
According to an aspect of an embodiment of the present invention, there is provided a database updating method, including:
acquiring data updating request information of a target database; the data updating request information comprises user identity authentication information and data updating authentication information;
updating data in the source database to a download database;
according to the data updating request information, simultaneously verifying the user identity information and verifying whether the data in the target database needs to be updated;
and if the verification is passed, updating the data in the updated download database to the target database.
Optionally, updating the data in the source database to the download database includes:
and acquiring preset time, and periodically updating the data in the source database to the download database by taking the preset time as a time interval, or acquiring preset time, and updating the data in the source database to the download database according to the preset time.
Optionally, periodically updating the data in the source database to the download database at a preset time interval, or acquiring a preset time and updating the data in the source database to the download database according to the preset time, where the updating includes:
respectively acquiring a first preset updating data time table of a downloading database and a second preset updating data time table of a source database;
respectively taking the time of the last updated data in the first preset updated data time table and the time of the last updated data in the second preset updated data time table as the starting time and the ending time, and extracting the data in the source database as the newly added data;
and updating the newly added data to the download database.
Optionally, updating the data in the source database to the download database includes:
monitoring whether the data in the source database is updated;
and if the data in the source database is updated, updating the data in the source database to the download database, or updating the data in the source database to the download database when the source database is idle.
Optionally, if the data in the source database is updated, updating the data in the source database to the download database, or updating the data in the source database to the download database when the source database is idle, includes:
acquiring a second preset updating data time table of the source database;
monitoring whether the second preset updating data time table is updated or not;
and if the second preset data updating schedule is updated, updating the data in the source database to the downloading database, or updating the data in the source database to the downloading database when the source database is idle.
Optionally, updating the data in the source database to the download database includes:
respectively acquiring a first preset updating data time table of a downloading database and a second preset updating data time table of a source database;
comparing the first preset updating data time table with the second preset updating data time table;
if the time of the last updated data in the first preset updated data time table is the same as the time of the last updated data in the second preset updated data time table, the download database is not updated;
and if the time for updating the data in the first preset data updating time table is different from the time for updating the data in the second preset data updating time table, updating the data in the source database to the downloading database.
Optionally, after the time of the last update data in the first preset update data schedule is different from the time of the last update data in the second preset update data schedule, the method further includes:
respectively taking the time of the last updated data in the first preset updated data time table and the time of the last updated data in the second preset updated data time table as the starting time and the ending time, and extracting the data in the source database as the newly added data;
and updating the newly added data to the download database.
Optionally, the simultaneously verifying the user identity information and verifying whether the data in the target database needs to be updated according to the data update request information includes: a first thread and a second thread in parallel;
the first thread is used for verifying whether the target database has the authority of updating data from the download database according to the user identity verification information;
the second thread is used for updating the verification information according to the data and verifying whether the data in the target database needs to be updated or not; wherein the data update verification information includes a third preset update data schedule.
Optionally, according to the data update request information, simultaneously verifying whether the user identity information and the data in the verification target database need to be updated, further comprising:
when the first thread and the second thread pass the verification, updating the data in the download database to a target database;
when any one of the first thread and the second thread fails to verify, the verification of the other thread is stopped at the same time, and the data in the target database is refused to be updated.
Optionally, the verifying whether the data in the target database needs to be updated according to the data update verification information includes:
acquiring a first preset updating data time table of a downloading database;
acquiring a third preset updating data time table according to the data updating verification information;
comparing the first preset update data schedule with the third preset update data schedule;
if the time for updating the data last in the first preset data updating time table is the same as the time for updating the data last in the third preset data updating time table, refusing to update the target database;
and if the time for updating the data in the first preset data updating time table is different from the time for updating the data in the third preset data updating time table, determining that the data in the target database needs to be updated.
Optionally, the verifying whether the data in the target database needs to be updated according to the data update verification information includes:
acquiring a second preset updating data time table of the source database;
acquiring a third preset updating data time table according to the data updating verification information;
comparing the second preset update data schedule with the third preset update data schedule;
if the time for updating the data in the second preset data updating time table is the same as the time for updating the data in the third preset data updating time table, refusing to update the data in the target database;
and if the time for updating the data in the second preset data updating time table is different from the time for updating the data in the third preset data updating time table, determining that the data in the target database needs to be updated.
Optionally, if the verification passes, updating the data in the updated download database to the target database, including:
respectively taking the time of the last updated data in the first preset updated data time table and the time of the last updated data in the third preset updated data time table as the starting time and the ending time, and extracting the data in the download database as the newly added data;
and updating the newly added data to the target database.
Optionally, the target database is a database of the client; the download database is a database of the FTP server; the source database is a database of a server or a database of a cloud big data platform.
According to another aspect of an embodiment of the present invention, there is provided a database update system including: the system comprises a client, a server and an FTP server; wherein,
the client is used for sending data updating request information for updating a target database of the client; the data updating request information comprises user identity authentication information and data updating authentication information;
the server is used for simultaneously verifying the user identity information and verifying whether the data in the target database needs to be updated according to the data updating request information, and updating the data in the source database of the server to a downloading database of the FTP server;
and the FTP server is used for updating the updated data in the download database of the FTP server to the target database of the client after the server determines that the verification is passed.
According to still another aspect of an embodiment of the present invention, there is provided a database update system including: the system comprises a client, a server, an FTP server and a cloud big data platform; wherein,
the client is used for sending data updating request information for updating a target database of the client; the data updating request information comprises user identity authentication information and data updating authentication information;
the server is used for simultaneously verifying the user identity information and verifying whether the data in the target database needs to be updated or not according to the data updating request information, and updating the data in the source database of the cloud big data platform to a downloading database of the FTP server;
the FTP server is used for updating the updated data in the download database of the FTP server to a target database of the client when the server determines that the verification is passed;
and the cloud big data platform is used for storing data in the source database.
According to yet another aspect of embodiments of the present invention, there is provided a computer-readable storage medium storing a computer program for executing the method according to any one of the above-mentioned embodiments of the present invention.
According to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus including: a processor; a memory for storing processor-executable instructions; and the processor is used for reading the executable instructions from the memory and executing the instructions to realize the method of any one of the above embodiments of the invention.
Based on the database updating method and system, the storage medium and the electronic device provided by the embodiments of the present invention, the parallel double thread is adopted to simultaneously verify the user identity information and verify whether the data in the target database needs to be updated, so that the verification time is shortened, the verification efficiency is improved, and the new data in the source database can be accurately updated to the download database by comparing the difference between the first preset update data time table and the second preset update data time table, so that the time for updating the download database is shortened, the efficiency is improved, the operating pressure for the source database during downloading the data can be reduced, and the download speed is improved.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent by describing in more detail embodiments of the present invention with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings, like reference numbers generally represent like parts or steps:
fig. 1 is a schematic flowchart of a database updating method according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a database update system according to an embodiment of the present invention;
FIG. 3 is a flow chart of a database update system according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of a database update system according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of another structure of a database update system according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Hereinafter, example embodiments according to the present invention will be described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of embodiments of the invention and not all embodiments of the invention, with the understanding that the invention is not limited to the example embodiments described herein.
It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
It will be understood by those of skill in the art that the terms "first," "second," and the like in the embodiments of the present invention are used merely to distinguish one element, step, device, module, or the like from another element, and do not denote any particular technical or logical order therebetween.
It should also be understood that in embodiments of the present invention, "a plurality" may refer to two or more and "at least one" may refer to one, two or more.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the invention may be generally understood as one or more, unless explicitly defined otherwise or stated to the contrary hereinafter.
In addition, the term "and/or" in the present invention is only one kind of association relationship describing the associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In the present invention, the character "/" generally indicates that the preceding and following related objects are in an "or" relationship.
It should also be understood that the description of the embodiments of the present invention emphasizes the differences between the embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Embodiments of the invention are operational with numerous other general purpose or special purpose computing system environments or configurations, and with numerous other electronic devices, such as terminal devices, computer systems, servers, etc. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as terminal devices, computer systems, servers, and the like, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, networked personal computers, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Exemplary method
Fig. 1 is a schematic flow chart of a database updating method according to an embodiment of the present invention, which can be applied to an electronic device, as shown in fig. 1, the method includes the following steps:
step S101: acquiring data updating request information of a target database; the data updating request information comprises user identity authentication information and data updating authentication information;
the target database may be a database of the client, and a person skilled in the art may select the target database according to actual needs, which is not limited herein.
The manner of obtaining the data update request information of the target database may be that the server actively obtains the data update request information of the target database, or that the client actively initiates the data update request information of the target database, which is not limited herein.
In an optional implementation manner, the server may preset an acquisition request time, and periodically access the target database of the client at an interval of the acquisition request time, for example, 30 seconds, to acquire data update request information of the target database; or, the server may preset an acquisition request time, and access the target database of the client at the acquisition request time (for example, 20 hours, that is, eight nights) to acquire data update request information of the target database; or, the server may monitor that the download database is idle, for example, when the download database does not update data, access the target database of the client to obtain the data update request information of the target database.
In another optional implementation, the client may actively send the data update request information of the target database to the server under the triggering operation of the user, so that the server obtains the data update request information of the target database, where the triggering operation of the user may be a triggering operation in the prior art, and is not limited herein; or, the client may preset a sending request time, and periodically send the data update request information of the target database to the server with the sending request time as a time interval, for example, 30 seconds as a time interval, so that the server obtains the data update request information of the target database; alternatively, the client may preset a sending request time, and send the data update request information of the target database to the server at the sending request time (for example, 20 th, that is, eight nights), so that the server obtains the data update request information of the target database.
It should be understood that the obtaining request time and the sending request time may be a time period, i.e. a time interval, or may be a time point, i.e. a moment, and those skilled in the art may select the time period according to actual needs, which is not limited herein.
Step S102: updating data in the source database to a download database;
the source database may be a database of a server or a database of a cloud big data platform, the download database may be a database of an FTP server, and a person skilled in the art may select the source database and the download database according to actual needs, which is not limited herein.
Optionally, the data in the source database refers to full data or newly added data; the full data refers to the full data in the source database, namely all data; newly added data is data different from the data in the downloaded database; those skilled in the art can select whether the data in the source database refers to the full amount of data or the new amount of data according to actual needs, which is not limited herein.
Specifically, if the data in the source database is the full data, updating the data in the source database to the download database means updating the full data in the source database to the download database, that is, updating all the data in the download database; if the data in the source database is the new data, updating the data in the source database to the download database means updating the new data in the source database to the download database, that is, updating the new data that is not included in the download database, and keeping the other data unchanged.
Optionally, there are five ways to update the data in the source database to the download database:
first, a preset time is obtained, and data in a source database is periodically updated to a download database at a time interval of the preset time.
And secondly, acquiring a preset time, and updating the data in the source database to the download database according to the preset time.
Thirdly, monitoring whether the data in the source database is updated; and if the data in the source database is updated, updating the data in the source database to the download database.
Fourthly, monitoring whether the data in the source database is updated; and if the data in the source database is updated, updating the data in the source database to the download database when the source database is idle.
Fifthly, respectively acquiring a first preset updating data time table of the downloading database and a second preset updating data time table of the source database; comparing the first preset updating data time table with the second preset updating data time table; if the time of the last updated data in the first preset updated data time table is the same as the time of the last updated data in the second preset updated data time table, the download database is not updated; and if the time for updating the data in the first preset data updating time table is different from the time for updating the data in the second preset data updating time table, updating the data in the source database to the downloading database.
The first and second ways of updating the data in the source database to the download database may specifically include: respectively acquiring a first preset updating data time table of a downloading database and a second preset updating data time table of a source database; respectively taking the time of the last updated data in the first preset updated data time table and the time of the last updated data in the second preset updated data time table as the starting time and the ending time, and extracting the data in the source database as the newly added data; and updating the newly added data to the download database.
The third and fourth ways of updating the data in the source database to the download database may specifically include: acquiring a second preset updating data time table of the source database; monitoring whether the second preset updating data time table is updated or not; and if the second preset data updating schedule is updated, updating the data in the source database to the downloading database, or updating the data in the source database to the downloading database when the source database is idle.
In a fifth way of updating the data in the source database to the download database, after the time of updating the data last in the first preset update data schedule is different from the time of updating the data last in the second preset update data schedule, the method further includes: respectively taking the time of the last updated data in the first preset updated data time table and the time of the last updated data in the second preset updated data time table as the starting time and the ending time, and extracting the data in the source database as the newly added data; and updating the newly added data to the download database.
It should be understood that, the five ways of updating the data in the source database to the download database are to automatically update the data in the source database to the download database, and of course, those skilled in the art may also manually update the data in the source database to the download database, which is not limited herein.
In the embodiment of the present invention, the steps S101 to S104 are not limited to the order of the steps, for example, the step S102 may be completed before the step S103 and the step S104, or the step S102 may be completed after the verification is passed in the step S104, and a person skilled in the art may select the step according to actual needs, which is not limited.
Step S103: according to the data updating request information, simultaneously verifying the user identity information and verifying whether the data in the target database needs to be updated;
preferably, step S103 is implemented by two parallel threads, specifically a first thread and a second thread; the first thread is used for verifying whether the target database has the authority of updating data from the download database according to the user identity verification information; the second thread is used for updating the verification information according to the data and verifying whether the data in the target database needs to be updated or not; wherein the data update verification information includes a third preset update data schedule.
Optionally, step S103 further includes: when the first thread and the second thread pass the verification, updating the data in the download database to a target database; when any one of the first thread and the second thread fails to verify, the verification of the other thread is stopped at the same time, and the data in the target database is refused to be updated.
In an optional embodiment, the second thread specifically includes: acquiring a first preset updating data time table of a downloading database; acquiring a third preset updating data time table according to the data updating verification information; comparing the first preset update data schedule with the third preset update data schedule; if the time for updating the data last in the first preset data updating time table is the same as the time for updating the data last in the third preset data updating time table, refusing to update the target database; and if the time for updating the data in the first preset data updating time table is different from the time for updating the data in the third preset data updating time table, determining that the data in the target database needs to be updated.
In another optional embodiment, the second thread specifically includes: acquiring a second preset updating data time table of the source database; acquiring a third preset updating data time table according to the data updating verification information; comparing the second preset update data schedule with the third preset update data schedule; if the time for updating the data in the second preset data updating time table is the same as the time for updating the data in the third preset data updating time table, refusing to update the data in the target database; and if the time for updating the data in the second preset data updating time table is different from the time for updating the data in the third preset data updating time table, determining that the data in the target database needs to be updated.
Step S104: and if the verification is passed, updating the data in the updated download database to the target database.
Optionally, after the verification is passed, updating the data in the updated download database to the target database, including: respectively taking the time of the last updated data in the first preset updated data time table and the time of the last updated data in the third preset updated data time table as the starting time and the ending time, and extracting the data in the download database as the newly added data; and updating the newly added data to the target database.
It should be noted that the verification pass in step S104 means that both the user identity information verification and whether the data in the target database needs to be updated are passed.
In the embodiment of the present invention, the first preset update data schedule is used to record the time for downloading the update data of the database, the second preset update data schedule is used to record the time for updating the data of the source database, the third preset update data schedule is used to record the time for updating the data of the target database, and three specific generation manners of the preset update data schedules are available for those skilled in the art, which is not limited herein.
Taking the downloaded database as the mysql database as an example, monitoring whether the mysql database has operations such as insert, update, delete, create and the like in real time; if yes, recording the current operation time, and recording the current operation time in a first preset updating data time table; if not, the first preset updating data time table is kept unchanged.
Similarly, if the source database is the mysql database, monitoring whether the operations such as insert, update, delete, create and the like exist in the mysql database in real time; if yes, recording the current operation time, and recording the current operation time in a second preset updating data time table; if not, the second preset updating data time table is kept unchanged.
Similarly, if the target database is the mysql database, monitoring whether the operations such as insert, update, delete and create exist in the mysql database in real time; if yes, recording the current operation time in a third preset updating data time table as data updating verification information, and sending the data updating verification information to the server side for verification; and if not, keeping the third preset updating data time table unchanged, and sending the third preset updating data time table to the server side for verification as data updating verification information.
It should be noted that the data update referred to in the embodiments of the present invention refers to any modification made to the data recorded in the database, and is not limited to the modification made to the data in the database by the insert, update, delete, create, etc. operations, and should not be construed as a limitation to the modification made to the data in the database by the update operation in mysql.
In addition, in order to quickly update the newly added data in the download database to the target database, when the data in the source database is updated to the download database, address (ID) fields for recording the newly added data may be respectively added in the first preset update data schedule and the second preset update data schedule, so that after the target database is determined to be updated by comparing the last updated time in the first preset update data schedule and the third preset update data schedule, the corresponding address field of the newly added data can be quickly found, and further, the target database can be quickly updated.
In the embodiment of the invention, two parallel threads are adopted to simultaneously verify whether the user identity information and the target database have the authority of updating data from the downloading database, so that the time spent in the verification process can be shortened, the verification efficiency is improved, the newly added data in the source database can be accurately updated into the downloading database by comparing the difference between the first preset updating data time table and the second preset updating data time table, the time for updating the downloading database is shortened, the efficiency is improved, the operating pressure brought to the source database when the data is downloaded can be reduced, and the downloading speed is improved.
Exemplary System
Fig. 2 is a schematic structural diagram of a database updating system according to an embodiment of the present invention. Fig. 3 is a flow chart of a database updating system according to an embodiment of the present invention. As shown in fig. 2 and 3, the database updating system includes: a client 10, a server 20 and an FTP server 30; the client 10 is configured to send data update request information for updating a target database of the client 10; the data updating request information comprises user identity authentication information and data updating authentication information; the server 20 is respectively connected with the client 10 and the FTP server 30, and is used for simultaneously verifying whether the user identity information and the data in the verification target database need to be updated according to the data update request information, and updating the data in the source database of the server 20 to the download database of the FTP server 30; and the FTP server 30 is connected with the client 10 and used for updating the data in the updated download database of the FTP server 30 to the target database of the client 10 after the server 20 determines that the verification is passed.
In the embodiment of the present invention, the server 20 uses the parallel first thread and second thread to complete the process of updating the request information according to the data, and simultaneously verifying the user identity information and verifying whether the data in the target database needs to be updated; the first thread is used for verifying whether the target database has the authority of updating data from the download database according to the user identity verification information; the second thread is used for updating the verification information according to the data and verifying whether the data in the target database needs to be updated or not; wherein the data update verification information includes a third preset update data schedule.
In order to shorten the verification time and improve the verification efficiency, when the server 20 verifies that the first thread and the second thread pass, the data in the download database is updated to the target database; when the server 20 verifies that either of the first thread and the second thread fails, the verification of the other thread is stopped at the same time, and the data in the target database is refused to be updated.
In an alternative embodiment, the server 20 is specifically configured to: acquiring a first preset updating data time table of a downloading database; acquiring a third preset updating data time table according to the data updating verification information; comparing the first preset update data schedule with the third preset update data schedule; if the time for updating the data last in the first preset data updating time table is the same as the time for updating the data last in the third preset data updating time table, refusing to update the target database; and if the time for updating the data in the first preset data updating time table is different from the time for updating the data in the third preset data updating time table, determining that the data in the target database needs to be updated.
In another alternative embodiment, the service end 20 is specifically configured to: acquiring a second preset updating data time table of the source database; acquiring a third preset updating data time table according to the data updating verification information; comparing the second preset update data schedule with the third preset update data schedule; if the time for updating the data in the second preset data updating time table is the same as the time for updating the data in the third preset data updating time table, refusing to update the data in the target database; and if the time for updating the data in the second preset data updating time table is different from the time for updating the data in the third preset data updating time table, determining that the data in the target database needs to be updated.
The server 20 updates the data in the source database to the download database of the FTP server 30 according to the following three optional embodiments:
in the first alternative embodiment, the server 20 is further configured to: and acquiring preset time, and periodically updating the data in the source database to the download database by taking the preset time as a time interval, or acquiring preset time, and updating the data in the source database to the download database according to the preset time.
In this alternative embodiment, the server 20 may specifically be configured to: respectively acquiring a first preset updating data time table of a downloading database and a second preset updating data time table of a source database; respectively taking the time of the last updated data in the first preset updated data time table and the time of the last updated data in the second preset updated data time table as the starting time and the ending time, and extracting the data in the source database as the newly added data; and updating the newly added data to the download database.
In a second optional embodiment, the server 20 is further specifically configured to: monitoring whether the data in the source database is updated; and if the data in the source database is updated, updating the data in the source database to the download database, or updating the data in the source database to the download database when the source database is idle.
In this alternative embodiment, the server 20 may specifically be configured to: acquiring a second preset updating data time table of the source database; monitoring whether the second preset updating data time table is updated or not; and if the second preset data updating schedule is updated, updating the data in the source database to the downloading database, or updating the data in the source database to the downloading database when the source database is idle.
In a third optional embodiment, the service end 20 is further specifically configured to: respectively acquiring a first preset updating data time table of a downloading database and a second preset updating data time table of a source database; comparing the first preset updating data time table with the second preset updating data time table; if the time of the last updated data in the first preset updated data time table is the same as the time of the last updated data in the second preset updated data time table, the download database is not updated; and if the time for updating the data in the first preset data updating time table is different from the time for updating the data in the second preset data updating time table, updating the data in the source database to the downloading database.
In this alternative embodiment, the server 20 may specifically be configured to: after the time for updating the data at last in the first preset data updating time table is determined to be different from the time for updating the data at last in the second preset data updating time table, taking the time for updating the data at last in the first preset data updating time table and the time for updating the data at last in the second preset data updating time table as the starting time and the ending time respectively, and extracting the data in the source database as the newly added data; and updating the newly added data to the download database.
Optionally, in the embodiment of the present invention, the FTP server 30 is specifically configured to: after the verification is passed, respectively taking the time of the last updated data in the first preset updated data time table and the time of the last updated data in the third preset updated data time table as the starting time and the ending time, and extracting the data in the download database as the newly added data; and updating the newly added data to the target database.
In addition, it should be understood that, as shown in fig. 3 and fig. 4, the download database that updates the data in the source database of the server 20 to the FTP server 30 may be selected by a person skilled in the art according to actual needs after the server 20 passes the verification or before the server 20 passes the verification, which is not limited herein.
Fig. 5 is another schematic structural diagram of a database updating system according to an embodiment of the present invention. As shown in fig. 5, the database update system includes: the system comprises a client 10, a server 20, an FTP server 30 and a cloud big data platform 40; the client 10 is configured to send data update request information for updating a target database of the client 10; the data updating request information comprises user identity authentication information and data updating authentication information; the server 20 is configured to simultaneously verify user identity information and whether data in a verification target database needs to be updated according to the data update request information, and update data in a source database of the cloud big data platform 40 to a download database of the FTP server 30; and the FTP server 30 is used for updating the updated data in the download database of the FTP server 30 to the target database of the client when the server 20 determines that the verification is passed.
It should be understood that, the server 20 updates the data in the source database of the cloud big data platform 40 to the download database of the FTP server 30, after the server 20 passes the verification, or before the server 20 passes the verification, and a person skilled in the art may select the download database according to actual needs, which is not limited herein.
As shown in fig. 2 and 5, the database update system shown in fig. 5 differs from the database update system shown in fig. 2 only in that: the database updating system shown in fig. 5 includes the cloud big data platform 40, and the source database thereof is located on the cloud big data platform 40, whereas the database updating system shown in fig. 2 does not include the cloud big data platform 40, and the source database thereof is located on the server 20. In addition to the above differences, the description of the database updating system shown in fig. 5 can refer to the description of the database updating system shown in fig. 2, and will not be repeated here.
In the database updating system of the present invention, the client, the server and the FTP server may be the client, the server and the FTP server in the prior art, and those skilled in the art can select the client, the server and the FTP server according to actual needs, which is not limited herein.
The database updating system provided by the above embodiment of the present invention adopts a parallel dual thread to simultaneously verify the user identity information and verify whether the data in the target database needs to be updated, thereby shortening the verification time and improving the verification efficiency, and it can also accurately update the newly added data in the source database to the download database by comparing the difference between the first preset update data time table and the second preset update data time table, thereby shortening the time for updating the download database, improving the efficiency, and at the same time, it can also reduce the operating pressure brought to the source database when downloading data, and improve the download speed.
The database updating system provided by the embodiment of the present invention corresponds to the database updating method provided by the embodiment of the present invention, and other descriptions can refer to the description of the database updating method provided by the embodiment of the present invention, and are not described herein again.
Exemplary electronic device
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. The electronic device may be either or both of the first device and the second device, or a stand-alone device separate from them that may communicate with the first device and the second device to receive the acquired input signals therefrom. FIG. 6 illustrates a block diagram of an electronic device in accordance with an embodiment of the disclosure. As shown in fig. 6, the electronic device 60 includes one or more processors 61 and a memory 62.
The processor 61 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
Memory 62 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by the processor 61 to implement the method of stress testing a server and/or other desired functions of the software program of the various embodiments of the present disclosure described above. In one example, the electronic device may further include: an input device 63 and an output device 64, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
The input device 63 may also include, for example, a keyboard, a mouse, and the like.
The output device 64 can output various information to the outside. The output devices 64 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, among others.
Of course, for simplicity, only some of the components of the electronic device relevant to the present disclosure are shown in fig. 6, omitting components such as buses, input/output interfaces, and the like. In addition, the electronic device may include any other suitable components, depending on the particular application.
Exemplary computer program product and computer-readable storage Medium
In addition to the above-described methods and apparatus, embodiments of the present disclosure may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the method of stress testing a server according to various embodiments of the present disclosure described in the "exemplary methods" section above of this specification.
The computer program product may write program code for carrying out operations for embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the steps in the method of stress testing a server according to various embodiments of the present disclosure described in the "exemplary methods" section above in this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing describes the general principles of the present disclosure in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present disclosure are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure is not intended to be limited to the specific details so described.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The block diagrams of devices, apparatuses, systems referred to in this disclosure are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the devices, apparatuses, and methods of the present disclosure, each component or step can be decomposed and/or recombined. These decompositions and/or recombinations are to be considered equivalents of the present disclosure. The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (17)

1. A database update method, the method comprising:
acquiring data updating request information of a target database; the data updating request information comprises user identity authentication information and data updating authentication information;
updating data in the source database to a download database;
according to the data updating request information, simultaneously verifying user identity information and verifying whether the data in the target database needs to be updated;
and if the verification is passed, updating the updated data in the download database to the target database.
2. The method of claim 1, wherein updating the data in the source database to the download database comprises:
and acquiring preset time, and periodically updating the data in the source database to the download database by taking the preset time as a time interval, or acquiring preset time, and updating the data in the source database to the download database according to the preset time.
3. The method according to claim 2, wherein the periodically updating the data in the source database to the download database at the preset time interval, or acquiring a preset time and updating the data in the source database to the download database according to the preset time comprises:
respectively acquiring a first preset updating data time table of the downloading database and a second preset updating data time table of the source database;
respectively taking the time of the last updated data in the first preset updated data time table and the time of the last updated data in the second preset updated data time table as the starting time and the ending time, and extracting the data in the source database as the newly added data;
and updating the newly added data to the download database.
4. The method of claim 1, wherein updating the data in the source database to the download database comprises:
monitoring whether the data in the source database is updated;
if the data in the source database is updated, updating the data in the source database to the download database, or updating the data in the source database to the download database when the source database is idle.
5. The method of claim 4, wherein the updating the data in the source database to the download database if the data in the source database is updated, or the updating the data in the source database to the download database when the source database is idle comprises:
acquiring a second preset updating data time table of the source database;
monitoring whether the second preset updating data schedule is updated or not;
if the second preset update data schedule is updated, updating the data in the source database to the download database, or updating the data in the source database to the download database when the source database is idle.
6. The method of claim 1, wherein updating the data in the source database to the download database comprises:
respectively acquiring a first preset updating data time table of the downloading database and a second preset updating data time table of the source database;
comparing the first preset update data schedule with the second preset update data schedule;
if the time of the last updated data in the first preset updated data time table is the same as the time of the last updated data in the second preset updated data time table, not updating the download database;
and if the time for updating the data in the source database is not the same as the time for updating the data in the second preset updating data time table, updating the data in the source database to the downloading database.
7. The method of claim 6, wherein if the time of the last update data in the first predetermined update data schedule is different from the time of the last update data in the second predetermined update data schedule, further comprising:
respectively taking the time of the last updated data in the first preset updated data time table and the time of the last updated data in the second preset updated data time table as the starting time and the ending time, and extracting the data in the source database as the newly added data;
and updating the newly added data to the download database.
8. The method of claim 1, wherein the updating request information according to the data, and simultaneously verifying the user identity information and verifying whether the data in the target database needs to be updated comprises: a first thread and a second thread in parallel;
the first thread is used for verifying whether the target database has the authority of updating data from the download database according to the user identity verification information;
the second thread is used for verifying whether the data in the target database needs to be updated or not according to the data updating verification information; wherein the data update verification information comprises a third preset update data schedule.
9. The method of claim 8, wherein the updating request information according to the data, simultaneously verifying user identity information and verifying whether the data in the target database needs to be updated, further comprises:
updating the data in the download database to the target database when the first thread and the second thread are verified;
when any one of the first thread and the second thread fails to verify, simultaneously stopping the verification of the other thread and refusing to update the data in the target database.
10. The method of claim 8, wherein verifying whether the data in the target database needs to be updated according to the data update verification information comprises:
acquiring a first preset updating data time table of the downloading database;
acquiring the third preset updating data time table according to the data updating verification information;
comparing the first preset update data schedule with the third preset update data schedule;
if the time of the last updated data in the first preset updated data time table is the same as the time of the last updated data in the third preset updated data time table, refusing to update the target database;
and if the time for updating the data in the first preset data updating time table is different from the time for updating the data in the third preset data updating time table, determining that the data in the target database needs to be updated.
11. The method of claim 8, wherein verifying whether the data in the target database needs to be updated according to the data update verification information comprises:
acquiring a second preset updating data time table of the source database;
acquiring the third preset updating data time table according to the data updating verification information;
comparing the second preset update data schedule with the third preset update data schedule;
if the time of the last updated data in the second preset updated data time table is the same as the time of the last updated data in the third preset updated data time table, refusing to update the data in the target database;
and if the time for updating the data in the second preset data updating time table is different from the time for updating the data in the third preset data updating time table, determining that the data in the target database needs to be updated.
12. The method of claim 10, wherein the updating the updated data in the download database to the target database if the verification is passed comprises:
respectively taking the time of the last updated data in the first preset updated data time table and the time of the last updated data in the third preset updated data time table as the starting time and the ending time, and extracting the data in the download database as the newly added data;
and updating the newly added data to the target database.
13. The method of any one of claims 1-12, wherein the target database is a database of a client; the download database is a database of an FTP server; the source database is a database of a server side or a database of a cloud big data platform.
14. A database update system, comprising: the system comprises a client, a server and an FTP server; wherein,
the client is used for sending data updating request information for updating a target database of the client; the data updating request information comprises user identity authentication information and data updating authentication information;
the server is used for simultaneously verifying user identity information and verifying whether data in the target database needs to be updated according to the data updating request information, and updating the data in a source database of the server to a downloading database of the FTP server;
and the FTP server is used for updating the updated data in the download database of the FTP server to the target database of the client after the server determines that the verification is passed.
15. A database update system, comprising: the system comprises a client, a server, an FTP server and a cloud big data platform; wherein,
the client is used for sending data updating request information for updating a target database of the client; the data updating request information comprises user identity authentication information and data updating authentication information;
the server is used for simultaneously verifying user identity information and verifying whether data in the target database needs to be updated according to the data updating request information, and updating data in a source database of the cloud big data platform to a downloading database of the FTP server;
the FTP server is used for updating the updated data in the download database of the FTP server to a target database of the client when the server determines that the verification is passed;
and the cloud big data platform is used for storing data in the source database.
16. A computer-readable storage medium, characterized in that the storage medium stores a computer program for performing the method of any of the preceding claims 1-13.
17. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method of any one of claims 1-13.
CN202111344430.1A 2021-11-15 2021-11-15 Database updating method and system, storage medium and electronic device Active CN113779000B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111344430.1A CN113779000B (en) 2021-11-15 2021-11-15 Database updating method and system, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111344430.1A CN113779000B (en) 2021-11-15 2021-11-15 Database updating method and system, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN113779000A true CN113779000A (en) 2021-12-10
CN113779000B CN113779000B (en) 2022-02-08

Family

ID=78957115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111344430.1A Active CN113779000B (en) 2021-11-15 2021-11-15 Database updating method and system, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN113779000B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118467560A (en) * 2024-07-09 2024-08-09 广东美创希科技有限公司 Data sharing, updating and managing method for device library

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017128992A1 (en) * 2016-01-26 2017-08-03 阿里巴巴集团控股有限公司 Method, device and system for migrating physical machine data to cloud
CN107453953A (en) * 2017-08-30 2017-12-08 苏州朗动网络科技有限公司 A kind of data update system and method based on httpclient
CN108200220A (en) * 2018-04-08 2018-06-22 武汉斗鱼网络科技有限公司 A kind of method of data synchronization, server and storage medium
CN108874828A (en) * 2017-05-12 2018-11-23 北京京东尚科信息技术有限公司 The method and apparatus of Data Migration
CN113127496A (en) * 2019-12-31 2021-07-16 金色熊猫有限公司 Method, apparatus, medium, and device for determining change data in database

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017128992A1 (en) * 2016-01-26 2017-08-03 阿里巴巴集团控股有限公司 Method, device and system for migrating physical machine data to cloud
CN108874828A (en) * 2017-05-12 2018-11-23 北京京东尚科信息技术有限公司 The method and apparatus of Data Migration
CN107453953A (en) * 2017-08-30 2017-12-08 苏州朗动网络科技有限公司 A kind of data update system and method based on httpclient
CN108200220A (en) * 2018-04-08 2018-06-22 武汉斗鱼网络科技有限公司 A kind of method of data synchronization, server and storage medium
CN113127496A (en) * 2019-12-31 2021-07-16 金色熊猫有限公司 Method, apparatus, medium, and device for determining change data in database

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118467560A (en) * 2024-07-09 2024-08-09 广东美创希科技有限公司 Data sharing, updating and managing method for device library

Also Published As

Publication number Publication date
CN113779000B (en) 2022-02-08

Similar Documents

Publication Publication Date Title
US10515005B1 (en) Systems and methods for testing source code
CN108153670B (en) Interface testing method and device and electronic equipment
US10754761B2 (en) Systems and methods for testing source code
US9038059B2 (en) Automatically targeting application modules to individual machines and application framework runtimes instances
US9632765B1 (en) Customized application package with context specific token
US9940115B2 (en) Mobile application deployment for distributed computing environments
CN105808778A (en) Method and device for extracting, transforming and loading mass data
CN113779000B (en) Database updating method and system, storage medium and electronic device
CN110908681A (en) Method and device for upgrading software
CN110704025A (en) Method and device for generating coding specification tool, storage medium and electronic equipment
CN113821525B (en) Data updating system and method, storage medium and electronic device
US10129328B2 (en) Centralized management of webservice resources in an enterprise
US10725993B1 (en) Indexing data sources using a highly available ETL for managed search
CN106603701A (en) Method and device for sending message based on long connection platform
US8615751B2 (en) Seeding product information
CN113138772B (en) Construction method and device of data processing platform, electronic equipment and storage medium
CN112835609B (en) Method and device for modifying download address of dependent packet
CN114296747A (en) Installation method and device of software installation package
JP2011258078A (en) Resource management system, resource management method, and resource management program
CN115964061A (en) Plug-in updating method and device, electronic equipment and computer readable storage medium
US20210034507A1 (en) Systems and methods for automated invocation of accessibility validations in accessibility scripts
CN112988806A (en) Data processing method and device
CN113094211B (en) Backup data processing method and device
CN113535270B (en) Software starting method and device
CN113608817B (en) Method and system for processing bullet frame

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant