CN114942838A - Data access method, device, equipment and storage medium - Google Patents

Data access method, device, equipment and storage medium Download PDF

Info

Publication number
CN114942838A
CN114942838A CN202210586958.8A CN202210586958A CN114942838A CN 114942838 A CN114942838 A CN 114942838A CN 202210586958 A CN202210586958 A CN 202210586958A CN 114942838 A CN114942838 A CN 114942838A
Authority
CN
China
Prior art keywords
server
data
database
cluster
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210586958.8A
Other languages
Chinese (zh)
Inventor
刘小龙
张赫麟
肖钢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Securities Co Ltd
Original Assignee
China Securities Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Securities Co Ltd filed Critical China Securities Co Ltd
Priority to CN202210586958.8A priority Critical patent/CN114942838A/en
Publication of CN114942838A publication Critical patent/CN114942838A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Automation & Control Theory (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a data access method, a data access device, data access equipment and a storage medium, and relates to the technical field of data processing. The specific implementation scheme is as follows: receiving a data access instruction sent by a user side; sending a data acquisition request aiming at data to be accessed to a target server; receiving a response result corresponding to the data acquisition request fed back by the target server; if the response result is: representing the acquisition failure result that the target time range does not belong to the time coverage range of the data stored by the target server, switching the database server communicated with the service scheduling server into a second type server in the database cluster to which the target server belongs, and returning to the step of sending a data acquisition request aiming at the data to be accessed to the target server; and if the response result is the result of successful acquisition of the characterization data, feeding the response result back to the user side. Therefore, the data access service stability under the production environment can be ensured through the scheme.

Description

Data access method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data access method, apparatus, device, and storage medium.
Background
The system environment may be divided into a test environment, a pre-production environment, and a production environment. The test environment is used for testing by testers, the pre-production environment is used for simulation test before product service is on-line, and the production environment is a real on-line environment and is used for daily operation of the product service.
In the related art, when a user needs to access user data in a production environment, a database server in the production environment can be accessed through a service scheduling server, so that the database server feeds back the required user data to the user through the service scheduling server.
However, considering that the data frequently accessed by the user side is data in the latest period of time, the data stored in the database server is also data of the latest specified duration set based on the latest period of time. Therefore, when the data to be accessed by the user side is the historical data exceeding the storage period of the database server, the data cannot be accessed, so that the stability of the data access service in the production environment is affected, and particularly for the fields such as stocks and funds with higher requirements on the stability of the data access service, the scheme provided by the related technology is obviously not applicable.
Therefore, a data access method that can ensure the stability of the data access service in the production environment is needed.
Disclosure of Invention
The embodiment of the invention aims to provide a data access method, a data access device, data access equipment and a storage medium, so as to ensure the stability of data access service in a production environment. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a data access method, where the method includes:
receiving a data access instruction sent by a user side; wherein, the data access instruction carries a target time range to which the data to be accessed belongs;
sending a data acquisition request aiming at the data to be accessed to a target server; the target server is a database server which is currently communicated with the service scheduling server; the target server defaults to a first class of server in a first database cluster in a production environment, the first database cluster further comprising: a second type of server; the first type server is a database server for storing user data with recently appointed time length, and the second type server is a database server for storing full user data;
receiving a response result corresponding to the data acquisition request fed back by the target server;
if the response result is: representing the acquisition failure result that the target time range does not belong to the time coverage range of the data stored by the target server, switching the database server communicated with the service scheduling server into the second type server in the database cluster to which the target server belongs, and returning to the step of sending a data acquisition request aiming at the data to be accessed to the target server;
and if the response result is the result of successful acquisition of the characterization data, feeding the response result back to the user side.
Optionally, the method further comprises:
detecting whether a database server currently communicated with the service scheduling server fails or not according to a preset detection period;
if the fault occurs, switching the database server which is currently communicated with the service scheduling server into a designated server in a designated cluster;
the designated cluster is a cluster of the next level of a cluster to which a currently communicated database server belongs in a second database cluster in a pre-production environment and a third database cluster in a test environment, and the levels of the first database cluster, the second database cluster and the third database cluster are gradually reduced;
the second database cluster and the third database cluster both comprise the first type of server and the second type of server, and the specified server is a database server with the same type as a target server before switching.
Optionally, the first class server and the second class server in any database cluster are both configured to store: processing results of the application server cluster corresponding to the database cluster aiming at the metadata in the basic database server; data stored in the first type server is quantitatively cleared in a preset period so as to store user data with recently specified duration;
different database clusters correspond to different application server clusters.
Optionally, any application server cluster includes a main application server and a standby application server that operate in a dual-host hot standby mode;
and the primary application server and the standby application server are both provided with timing tasks, and when the timing tasks are started, the timing tasks are executed to process the metadata in the basic database server and store the processing results aiming at the metadata into the first class server and the second class server in the corresponding database cluster.
In a second aspect, an embodiment of the present invention provides a data access system, including a service scheduling server, and a database cluster in a production environment, where a first database cluster in the production environment includes a first class server and a second class server, and the first class server and the second class server use different storage modes, where the first class server is a database server that stores user data of a recently specified duration, and the second class server is a database server that stores full-volume user data;
the service scheduling server is used for receiving a data access instruction sent by the user side; sending a data acquisition request aiming at the data to be accessed to a target server; receiving a response result corresponding to the data acquisition request fed back by the target server; if the response result is: representing the acquisition failure result of the target time range not belonging to the time coverage range of the data stored by the target server, and switching the database server communicated with the service scheduling server into the second type server in the database cluster to which the target server belongs; returning to the step of sending a data acquisition request aiming at the data to be accessed to a target server; if the response result is the result of successful acquisition of the characterization data, feeding the response result back to the user side; wherein, the data access instruction carries the target time range to which the data to be accessed belongs; the target server is a database server which is currently communicated with the service scheduling server; the target server is defaulted to be a first type server in a first database cluster under a production environment;
and the target server is used for responding to the data acquisition request and feeding back the response result to the service scheduling server when receiving the data acquisition request.
Optionally, the system further includes a second database cluster in a pre-production environment and a third database cluster in a test environment, where the second database cluster and the third database cluster each include the first type server and the second type server; the levels of the first database cluster, the second database cluster and the third database cluster are gradually reduced;
the service scheduling server is further configured to:
detecting whether a database server currently communicated with the service scheduling server fails or not according to a preset detection period;
if the fault occurs, switching the database server which is currently communicated with the service scheduling server into a designated server in a designated cluster;
the designated cluster is a cluster at the next level of a cluster to which a database server in current communication belongs in a second database cluster under a pre-production environment and a third database cluster under a test environment;
the designated server is a database server of the same type as the target server before switching
Optionally, the system further comprises: each database cluster corresponds to an application server cluster; different database clusters correspond to different application server clusters;
the first type of server and the second type of server in any database cluster are used for storing: the application server cluster corresponding to the database cluster aims at the processing result of the metadata in the basic database server; data stored in the first type server is quantitatively cleared in a preset period so as to store user data with the latest specified duration;
each application server cluster is used for reading the metadata in the basic database server, performing designated processing on the read metadata to obtain a processing result, and storing the processing result in the first-class server and the second-class server in the corresponding database cluster.
Optionally, any application server cluster includes a main application server and a standby application server that operate in a dual-host hot standby mode;
and timing tasks are deployed in the main application server and the standby application server, and when the timing tasks are started, the metadata in the basic database server are processed, and processing results aiming at the metadata are stored in the first class server and the second class server in the corresponding database cluster.
In a third aspect, an embodiment of the present invention provides a data access apparatus, which is applied to a service scheduling server, and the apparatus includes:
the first receiving module is used for receiving a data access instruction sent by a user side; wherein, the data access instruction carries a target time range to which the data to be accessed belongs;
the request module is used for sending a data acquisition request aiming at the data to be accessed to a target server; the target server is a database server which is currently communicated with the service scheduling server; the target server defaults to a first class of server in a first database cluster in a production environment, the first database cluster further comprising: a second type of server; the first type server is a database server for storing user data with recently appointed duration, and the second type server is a database server for storing full user data;
the second receiving module is used for receiving a response result corresponding to the data acquisition request fed back by the target server;
a first response module, configured to, if the response result is: representing the acquisition failure result that the target time range does not belong to the time coverage range of the data stored by the target server, switching the database server communicated with the service scheduling server into the second type server in the database cluster to which the target server belongs, and returning to the step of sending a data acquisition request aiming at the data to be accessed to the target server;
and the second response module is used for feeding back the response result to the user side if the response result is the result of successful acquisition of the characterization data.
Optionally, the apparatus further comprises:
the detection module is used for detecting whether a database server which is currently communicated with the service scheduling server breaks down or not according to a preset detection period;
the switching module is used for switching the database server which is currently communicated with the service scheduling server into a designated server in a designated cluster if a fault occurs;
the designated cluster is a cluster of the next level of a cluster to which a currently communicated database server belongs in a second database cluster in a pre-production environment and a third database cluster in a test environment, and the levels of the first database cluster, the second database cluster and the third database cluster are gradually reduced;
the second database cluster and the third database cluster both comprise the first type of server and the second type of server, and the designated server is a database server with the same type as a target server before switching.
Optionally, the first type of server and the second type of server in any database cluster are both configured to store: the application server cluster corresponding to the database cluster aims at the processing result of the metadata in the basic database server; data stored in the first type server is quantitatively cleared in a preset period so as to store user data with recently specified duration;
different database clusters correspond to different application server clusters.
Optionally, any application server cluster includes a main application server and a standby application server that operate in a dual-host hot standby mode;
and the primary application server and the standby application server are both provided with timing tasks, and when the timing tasks are started, the timing tasks are executed to process the metadata in the basic database server and store the processing results aiming at the metadata into the first class server and the second class server in the corresponding database cluster.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the processor and the memory through the communication bus;
a memory for storing a computer program;
and a processor for implementing the steps of any of the above-described data access methods when executing the program stored in the memory.
In a fifth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the data access methods described above.
The embodiment of the invention has the following beneficial effects:
according to the data access method provided by the embodiment of the invention, when the service scheduling server receives the data access instruction which is sent by the user side and aims at the data to be accessed in the target time range, the service scheduling server sends the data acquisition request aiming at the data to be accessed to the target server and receives the response result which is fed back by the target server and corresponds to the data acquisition request. The target server is by default a first type of server in a first database cluster in the production environment. And if the response result is an acquisition failure result which represents that the target time range does not belong to the time coverage range of the data stored by the target server, taking the second type of server in the database cluster to which the target server belongs as a new target server, and returning to the step of sending a data acquisition request for the data to be accessed to the target server, so that when the service scheduling server fails to acquire the data to be accessed from the first type of server in the first database cluster, the service scheduling server can be switched to the second type of server in the first database cluster to acquire the data to be accessed. The second type server is a database server for storing the full amount of user data, so that the data to be accessed in the target time range can be acquired from the second type server, the service scheduling server can receive a response result representing the successful acquisition of the data, and the response result is fed back to the user side, so that the stability of the data access service in the production environment is ensured.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by referring to these drawings.
Fig. 1 is a flowchart of a data access method according to an embodiment of the present invention;
FIG. 2 is another flow chart of a data access method provided by an embodiment of the present invention;
FIG. 3 is a schematic diagram of a data migration process for implementing an embodiment of the present invention;
FIG. 4 is a schematic diagram of a data access process implementing an embodiment of the invention;
FIG. 5 is a schematic structural diagram of a data access system according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a data access device according to an embodiment of the present invention;
fig. 7 is a block diagram of an electronic device implementing a data access method in an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
The following first introduces terms related to embodiments of the present invention:
an application server: the server for application program deployment, for example, the server deployed by Python and Java (computer programming language) codes developed by developers.
A database server: a server that stores data, such as an SQL (Structured Query Language) database server.
In order to ensure the stability of the data access service in the production environment, embodiments of the present invention provide a data access method, apparatus, device, and storage medium.
First, a data access method provided in an embodiment of the present invention is described below.
The data access method provided by the embodiment of the invention is applied to a service scheduling server, and the service scheduling server is used for sending a data acquisition request aiming at data to be accessed to a target server which is currently communicated with the service scheduling server after receiving a data access instruction sent by a user side, and feeding back a response result corresponding to the data acquisition request fed back by the target server to the user side.
The data access method provided by the embodiment of the invention can comprise the following steps:
receiving a data access instruction sent by a user side; wherein, the data access instruction carries a target time range to which the data to be accessed belongs;
sending a data acquisition request aiming at the data to be accessed to a target server; the target server is a database server which is currently communicated with the service scheduling server; the target server defaults to a first class of server in a first database cluster in a production environment, the first database cluster further comprising: a second type of server; the first type server is a database server for storing user data with recently appointed duration, and the second type server is a database server for storing full user data;
receiving a response result corresponding to the data acquisition request fed back by the target server;
if the response result is: representing the acquisition failure result that the target time range does not belong to the time coverage range of the data stored by the target server, switching the database server communicated with the service scheduling server into the second type server in the database cluster to which the target server belongs, and returning to the step of sending a data acquisition request aiming at the data to be accessed to the target server;
and if the response result is the result of successful acquisition of the characterization data, feeding back the response result to the user side.
It should be noted that the service scheduling server and the target server related in the embodiment of the present invention may be applied to the fields of stocks, funds, and the like, and the embodiment of the present invention is explained with the stock field as the application field, at this time, the service scheduling server is used to schedule a data access instruction for stock data, and the target server is used to store related data of stocks.
According to the scheme provided by the embodiment of the invention, when the service scheduling server receives the data access instruction which is sent by the user side and aims at the data to be accessed in the target time range, the service scheduling server sends the data acquisition request aiming at the data to be accessed to the target server and receives the response result which is fed back by the target server and corresponds to the data acquisition request. The target server is by default a first type of server in a first database cluster in the production environment. If the response result is an acquisition failure result representing that the target time range does not belong to the time coverage range of the data stored by the target server, taking the second type of server in the database cluster to which the target server belongs as a new target server, and returning to the step of sending a data acquisition request for the data to be accessed to the target server, so that when the service scheduling server fails to acquire the data to be accessed from the first type of server in the first database cluster, the service scheduling server can be switched to the second type of server in the first database cluster to acquire the data to be accessed. Because the second type server is a database server for storing the full amount of user data, the data to be accessed in the target time range can be acquired from the second type server, so that the service scheduling server can receive a response result indicating that the data acquisition is successful and feed the response result back to the user side, thereby ensuring the stability of the data access service in the production environment.
The following describes a data access method provided by an embodiment of the present invention with reference to the accompanying drawings.
As shown in fig. 1, the data access method provided in the embodiment of the present invention may include steps S101 to S105:
s101, receiving a data access instruction sent by a user side; wherein, the data access instruction carries the target time range to which the data to be accessed belongs;
in this embodiment, when the user needs to obtain the user data stored in the database server, a data access instruction may be sent to the service scheduling server, so that the service scheduling server requests to obtain the user data from the database server after receiving the access instruction, and feeds back the user data fed back by the database server to the user, thereby implementing the data access process.
In an actual application scenario, the user terminal may be a mobile phone terminal, a computer terminal, or the like; the user data may be data generated by daily operations after the product service is on-line. For example, if the product service is a stock trading application for recommending stocks for users, the user data may be result data obtained by analyzing data such as trading market data or fund flow data generated on a stock trading day after the stock trading application is online, such as the average of opening prices of the stock in the last 3 days or the last week, and the like. The data access instruction carries a target time range to which the data to be accessed belongs, so that the service scheduling server can request the user data in the target time range from the database server according to the target time range.
For example, in a specific implementation manner, the user a may input a target time range to which data to be accessed belongs, for example, a last week, through a stock trading application in the mobile phone terminal, initiate a data access instruction for acquiring user data in the time range of the last week, and the service scheduling server receives the data access instruction for the user data of the last week and executes a subsequent data access process.
S102, sending a data acquisition request aiming at the data to be accessed to a target server; the target server is a database server which is currently communicated with the service scheduling server; the target server defaults to a first type of server in a first database cluster in a production environment, the first database cluster further comprising: a second type of server; the first type server is a database server for storing user data with the latest specified duration, and the second type server is a database server for storing full user data;
in this embodiment, the first database cluster in the production environment may include a first class server and a second class server, where the first class server is a database server that stores user data of a most recently specified duration, and the second class server is a database server that stores full user data. Illustratively, the last specified duration may be the last half year, the last year, and so on. The last specified time length may be determined by a developer according to the access frequency of the user to the data in different periods, for example, if the data frequently accessed by the user is the user data in the last three years, and the user data before the last three years is not basically accessed, the last specified time length may be the last three years, so as to save the data storage cost on the premise of ensuring that stable data access is provided for the user. It should be noted that the most recently specified time length is not limited in the embodiment of the present invention. In addition, the full user data is all user data generated after the product service is online, for example, if a stock trading application program is online 5/7/2010, all user data generated after 5/7/2010 is the full user data corresponding to the application program.
It can be understood that, since the database server is a server for storing user data, the user data generated after the product service is online may be stored in the database server in the production environment, and therefore, after receiving a data access instruction sent by the user end, the service scheduling server may send a data acquisition request to the database server in communication with the service scheduling server, that is, send a data acquisition request to the target server. The target server defaults to a first type server in a first database cluster in the production environment, namely, the service scheduling server defaults to establish communication connection with the first type server in the first database cluster, and preferentially sends a data acquisition request aiming at the data to be accessed to the first type server in the first database cluster. It can be understood that, because the first type server is a database server storing user data of a last specified duration, and the access frequency of a user to the user data of the last specified duration is high, the first type server in the production environment is taken as a target server, so that the data volume of the database to be queried is small during data query, and the response speed of the user access is improved.
For example, in an implementation manner, after receiving a data access instruction sent by a user, a service scheduling server may directly send the data access instruction to a target server, where the data access instruction may serve as the data acquisition request, and the data acquisition request carries a target time range to which data to be accessed belongs. For example, in another implementation manner, after receiving a data access instruction sent by a user, a service scheduling server may regenerate a data acquisition request for data to be accessed in a target time range by using a target time range carried in the data access instruction, and send the data acquisition request to a target server.
S103, receiving a response result corresponding to the data acquisition request fed back by the target server;
in this embodiment, after the data acquisition request is sent to the target server in step S102, the target server receives the data acquisition request, searches for data belonging to the target time range from the data stored in the target server, and generates a response result for the data acquisition request. Illustratively, if a target server receives a data acquisition request for user data of the last two years sent by a service scheduling server, the target server searches the user data of the last two years from data stored in the target server, and if only the user data of the last one year is stored in the target server, a response result representing data acquisition failure is generated; and if the user data of the last three years are stored in the target server, generating a response result carrying the user data of the last two years.
S104, if the response result is: representing the acquisition failure result that the target time range does not belong to the time coverage range of the data stored by the target server, switching the database server communicated with the service scheduling server into the second type server in the database cluster to which the target server belongs, and returning to the step of sending a data acquisition request aiming at the data to be accessed to the target server;
it can be understood that if the response result is an acquisition failure result, the user data in the target time range cannot be successfully accessed, and at this time, if the response result is fed back to the user side, the user side cannot acquire the user data in the target time range, which may result in poor stability of the data access service in the production environment.
In order to ensure the stability of the data access service in the production environment, in this embodiment, if the response result fed back by the target server is an acquisition failure result, the database server in communication with the service scheduling server is switched to the second type of server in the database cluster to which the target server belongs, that is, a communication connection between the second type of server and the service scheduling server is established, that is, the second type of server in the database cluster to which the target server belongs is used as a new target server, and the step of sending a data acquisition request for the data to be accessed to the target server in step S103 is returned. It can be understood that, since the second type server is a database server storing the full amount of user data, and the data stored in the second type server includes the user data in the target time range, the service scheduling server may send a data acquisition request to the new target server to obtain a response result carrying the user data in the target time range, taking the second type server as the new target server.
In addition, it should be noted that, because the target server is the first-class server in the first database cluster in the production environment by default, when the database server in communication with the service scheduling server is switched from the first-class server to the second-class server, and the second-class server completes the response of the data acquisition request sent by the service scheduling server, the service scheduling server may also be switched to communicate with the first-class server again, so as to improve the response speed of the user access. For example, in a specific implementation manner, when the second type server feeds back a response result of the data obtaining request to the service scheduling server, after receiving the response result, the service scheduling server disconnects the communication connection with the second type server, and reestablishes the communication connection with the first type server.
And S105, if the response result is the result representing the successful data acquisition, feeding back the response result to the user side.
It can be understood that, if the response result is a result representing successful data acquisition, the response result can be fed back to the user end, so that the user end can receive the user data in the target time range carried in the response result, thereby implementing access to the data to be accessed in the target time range and ensuring the stability of the data access service in the production environment.
According to the scheme provided by the embodiment, when the service scheduling server receives a data access instruction which is sent by the user side and aims at the data to be accessed within the target time range, a data acquisition request aiming at the data to be accessed is sent to the target server, and a response result corresponding to the data acquisition request fed back by the target server is received. The target server is by default a first type of server in a first database cluster in a production environment. If the response result is an acquisition failure result representing that the target time range does not belong to the time coverage range of the data stored by the target server, taking the second type of server in the database cluster to which the target server belongs as a new target server, and returning to the step of sending a data acquisition request for the data to be accessed to the target server, so that when the service scheduling server fails to acquire the data to be accessed from the first type of server in the first database cluster, the service scheduling server can be switched to the second type of server in the first database cluster to acquire the data to be accessed. The second type server is a database server for storing the full amount of user data, so that the data to be accessed in the target time range can be acquired from the second type server, the service scheduling server can receive a response result representing the successful acquisition of the data, and the response result is fed back to the user side, so that the stability of the data access service in the production environment is ensured.
Optionally, in another embodiment of the present invention, on the basis of the embodiment shown in fig. 1, as shown in fig. 2, the data access method further includes steps S201 to S202:
s201, detecting whether a database server currently communicated with the service scheduling server has a fault according to a preset detection period;
in this embodiment, the service scheduling server may detect whether the database server communicating with the service scheduling server fails in a manner of sending the heartbeat packet according to a predetermined detection period. The predetermined detection period may be every 30 seconds, 1 minute, etc. For example, the service scheduling server may send a heartbeat packet to the database server every 1 minute, and the database server replies a fixed message after receiving the heartbeat packet. And if the service scheduling server does not receive the fixed information replied by the database server, the database server is considered to be in failure. It should be noted that the predetermined detection period may be set by a relevant worker according to a requirement, which is not limited in the embodiment of the present invention.
S202, if a fault occurs, switching the database server which is currently communicated with the service scheduling server into a designated server in a designated cluster; the designated cluster is a cluster of the next level of a cluster to which a currently communicated database server belongs in a second database cluster under a pre-production environment and a third database cluster under a test environment, and the levels of the first database cluster, the second database cluster and the third database cluster are gradually reduced; the second database cluster and the third database cluster both comprise the first type of server and the second type of server, and the specified server is a database server with the same type as the target server before switching.
It can be understood that, if a database server currently communicating with the service scheduling server fails, the database server cannot feed back a response result corresponding to the data acquisition request to the service scheduling server, which may result in that the stability of the data access service is affected. Therefore, in order to further ensure the stability of the data access service, if the database server currently communicating with the service scheduling server fails, the database server currently communicating with the service scheduling server may be switched to the designated server in the designated cluster, so that the service scheduling server may initiate a data acquisition request to the designated server in the designated cluster. And the designated cluster is the cluster at the next level of the cluster to which the database server currently communicated with the service scheduling server belongs.
It should be noted that, in this embodiment, the level of the first database cluster in the production environment is higher than that of the second database cluster in the pre-production environment, and the level of the second database cluster in the pre-production environment is higher than that of the third database cluster in the test environment. Illustratively, if the traffic scheduling server communicates with a designated server in a first database cluster, then if the designated server in the first database cluster fails, the traffic scheduling server switches communication connections to communicate with the designated server in a second database cluster. And the data in the first class servers in the pre-production environment and the test environment at least comprise the data in the first class servers in the production environment, the data in the second class servers in the pre-production environment and the test environment at least comprise the data in the second class servers in the production environment, so as to ensure that when the target server fails, the database server in the cluster of the next level to which the target server belongs and the database server with the same category as the target server can provide data access service for the user side.
In addition, the second database cluster and the third database cluster both comprise the first type of server and the second type of server, and the specified server is a database server of the same type as the target server before switching. Illustratively, if the database server in communication with the service scheduling server is a first type server in a first database cluster, the first type server in the first database cluster fails, and the service scheduling server switches communication connections to communicate with the first type server in a second database cluster. It can be understood that, because the data stored in the first type server and the second type server are not identical, if the first type server in the production environment fails, the first type server in the pre-production environment may be switched to, so as to use the data stored in the first type server in the pre-production environment to complete the data access service provided to the user terminal.
Therefore, according to the scheme, if the database server currently communicated with the service scheduling server is detected to have a fault, the database server currently communicated with the service scheduling server is switched to the designated server in the designated cluster, so that the data access service provided for the user side is completed by using the data stored in the designated server in the designated cluster, and the stability of the data access service is further ensured.
Optionally, in another embodiment of the present invention, the first class server and the second class server in any database cluster are both configured to store: the application server cluster corresponding to the database cluster aims at the processing result of the metadata in the basic database server; data stored in the first type server is quantitatively cleared in a preset period so as to store user data with recently specified duration; different database clusters correspond to different application server clusters.
In this embodiment, unprocessed metadata is stored in the basic database server, and after the service product is online, the application server cluster processes the metadata to generate a processing result and stores the processing result in the first type server and the second type server in the database cluster corresponding to the application server cluster. Moreover, different database clusters correspond to different application server clusters, that is, a database cluster in each system environment corresponds to an application server cluster in the system environment. Illustratively, a first database cluster in a production environment corresponds to an application server cluster in the production environment, and the application server cluster in the production environment processes metadata in a base database server and stores a processing result in the first type server and the second type server in the database cluster in the production environment.
For example, for a stock trading scenario, the metadata may include basic information of the listed companies (e.g., stock code, stock name, date of listing, block of the industry), daily trading market data (e.g., opening price, closing price, fluctuation, hand-exchange rate, trading volume), and capitalization data (e.g., financing and financing data, north fund flow), among others. For example, after a stock trading application is online, the application server cluster corresponding to the first database cluster in the production environment may process the metadata stored in the underlying database server. For example, after the end of each stock trading day, the average of the fund flow for the last 3 days, the last week, and the last month of the fund flow data stored in the underlying database server is calculated. And the average value capital trend value is used as a processing result of metadata and is stored in a first type server and a second type server in the first database cluster for a user side to access. In addition, the present embodiment does not limit a specific processing method for the metadata.
It will be appreciated that since the first type of server, the second type of server in each database cluster are used to store: therefore, when the first-class server or the second-class server which is currently communicated with the service scheduling server fails, the first-class server or the second-class server which is currently communicated with the service scheduling server is switched to the first-class server or the second-class server in the cluster of the next level to the cluster to which the currently communicated database server belongs, and required data can be acquired from the switched first-class server or the switched second-class server, so that the stability of data access service in the production environment can be ensured.
In addition, because the first-class server stores the data with the latest specified duration, when the processing result for the metadata is stored in the first-class server and the second-class server at the same time, the first-class server can quantitatively delete the stored data at a preset period so as to ensure that the first-class server stores the data with the latest specified duration. For example, the first type of server may delete data belonging to the earliest quarter from the data stored in the first type of server at the end of each quarter with a quarter as a preset period.
Optionally, in an implementation manner, any application server cluster includes a primary application server and a standby application server that operate in a hot standby manner;
in this implementation manner, a timing task may be deployed in both the primary application server and the backup application server, where the timing task is used to start and execute processing on the metadata in the basic database server at a fixed time, and store a processing result for the metadata in the first class server and the second class server in the corresponding database cluster. It can be understood that, since the hot standby is a working mode for guaranteeing service continuity by using the failover, and the service is recovered not at the original server but at the standby server, if the primary application server working in the hot standby mode fails, the processing result for the metadata can be generated by using the standby application server and stored in the database cluster.
It should be noted that the process in which the application server cluster acquires the metadata from the basic database, processes the metadata, and stores the processed metadata into the database cluster corresponding to the application server is a data migration process. It can be understood that, during the data migration process, if the application server fails, it cannot generate the processing result for the metadata and store the processing result in the database cluster, and at this time, if the user accesses the data in the database cluster, it may not be able to access the processing result for the latest metadata. The application server cluster comprises the main application server and the standby application server which work in a hot standby mode, and therefore when the main application server cluster fails, the standby application server can still generate a processing result aiming at the metadata and store the processing result into the database cluster, and therefore the access of a user end to the data is not affected, and the dynamic migration of the data is achieved. In addition, for the fields of stocks, funds and the like, if the user end on a trading day cannot acquire data from the database server, great economic loss may be brought, so that the scheme can reduce the risk of economic loss by ensuring the stability of data access service in the data migration process.
Therefore, according to the scheme, the first type of server and the second type of server in any database cluster are used for storing: the application server cluster corresponding to the database cluster aims at the processing result of the metadata in the basic database server, so that when the first type server or the second type server which is communicated with the service scheduling server fails, required data can be obtained from the switched first type server or the switched second type server, and the stability of data access service in a production environment is ensured.
For better understanding of the present solution, a specific example of the embodiment of the present invention is explained below with reference to fig. 3 and 4.
Fig. 3 shows a schematic diagram of a data migration process for implementing an embodiment of the present invention, and as shown in fig. 3, an application server cluster includes a primary application server and a standby application server that operate in a hot standby mode, and both the primary application server and the standby application server are deployed with timing tasks. The timed task executes the steps of acquiring metadata from the base database server, processing the metadata, and storing the processing result in the database server DB _ OLD (corresponding to the second type server in the above) and the database server DB _ NEW (corresponding to the first type server in the above) when it is started.
In this example, the primary application server and the standby application server perform one-time migration on the stock data, so that the primary application server and the standby application server synchronously update the stock data. And for the incremental data newly added on each stock trading day, the main application server and the standby application server process the incremental data on each stock trading day and generate a processing result aiming at the incremental data. The database server DB _ OLD and the database server DB _ NEW store data in the form of data tables divided into two types of data tables of full update and incremental update. For a fully updated data table, the main application server and the standby application server delete all data in the data table at each stock trading date and then rewrite the result data containing the latest trading date into the data table. And the data table with the incremental update reads the latest date of the data table, compares the latest date with the current date, starts timing tasks of the main application server and the standby application server if the latest date is earlier than the current date, generates incremental data larger than the latest date, and synchronously stores the incremental data in the database server DB _ OLD and the database server DB _ NEW.
When the main application server fails, database read-write hot switching can be carried out on the standby application server in a seamless mode, the latest data is stored in the database server DB _ OLD and the database server DB _ NEW, and the fault tolerance performance of the server system cluster is enhanced.
It is understood that in the related art, in order to achieve physical isolation of data, data may be artificially placed in different IP address network segments. For example, a server cluster in a test environment, a server cluster in a pre-production environment, and a server cluster in a production environment all have their corresponding IP address network segments. If the data in the database server corresponding to one IP address network segment needs to be modified, the data in the database servers in the other two IP address network segments cannot be automatically modified. Therefore, in the data migration process in the production environment, if the database server to which the data is to be migrated fails, the user side cannot acquire the required data from the database server in the pre-production environment. According to the scheme, the database server under each system environment is used for storing: the application server corresponding to the database server aims at the processing result of the metadata in the basic database server, so that if the database server in the production environment fails, the required data can be acquired from the database server in the pre-production environment, and the stability of data access service in the production environment can be ensured.
Fig. 4 shows a schematic diagram of a data access process implementing an embodiment of the invention. As shown in fig. 4, the user terminal initiates a data access command for a target time range; after receiving the data access instruction, the service scheduling server initiates a data acquisition request to a database server DB _ NEW communicated with the service scheduling server; the database server DB _ NEW searches data of a target time range from the data stored in the database server DB _ NEW, if the data are stored in the database server DB _ NEW, a response result carrying the data of the target time range is fed back to the service scheduling server, and after the service scheduling server receives the response result, the response result is fed back to the user side to complete a data access process.
If the data stored in the database server DB _ NEW does not contain the data of the target time range, the database server DB _ NEW communicated with the service scheduling server is switched to the database server DB _ OLD, and a data acquisition request is sent to the database server DB _ OLD. Because the database server DB _ OLD stores the full amount of user data, the response result carrying the target time range data can be fed back to the service scheduling server, and after receiving the response result, the service scheduling server feeds back the response result to the user side, so as to complete another data access process.
Therefore, according to the scheme, in the dynamic migration of the data in the production environment, the hot switching of the main machine and the standby machine of the application server and the read-write hot switching of the database server are realized, and the consistency, the integrity and the synchronism of the data in the production environment are ensured; the application server cluster comprises a main application server and a standby application server which work in a hot standby mode, so that the fault tolerance of the server system cluster is enhanced; and full, incremental, batch and real-time dynamic migration of the database table is supported.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a data access system, as shown in fig. 5, the system includes a service scheduling server 510 and a database cluster 520 in a production environment, where a first database cluster in the production environment includes a first type of server and a second type of server, and the first type of server and the second type of server adopt different storage manners, where the first type of server is a database server that stores user data of a recently specified duration, and the second type of server is a database server that stores full amount of user data;
the service scheduling server 510 is configured to receive a data access instruction sent by a user side; sending a data acquisition request aiming at the data to be accessed to a target database server; receiving a response result corresponding to the data acquisition request fed back by the target database server; if the response result is: representing the acquisition failure result of the target time range not belonging to the time coverage range of the data stored in the target database server, and switching the database server communicated with the service scheduling server into the second type server in the database cluster to which the target server belongs; returning to the step of sending a data acquisition request aiming at the data to be accessed to a target database server; if the response result is the result of successful acquisition of the characterization data, feeding the response result back to the user side; the data access instruction carries the target time range to which the data to be accessed belongs; the target server is a database server which is currently communicated with the service scheduling server; the target server is defaulted to be a first type of server in a first database cluster under a production environment;
and the target database server is used for responding to the data acquisition request and feeding back the response result to the service scheduling server when receiving the data acquisition request.
Optionally, the system further includes a second database cluster in a pre-production environment and a third database cluster in a test environment, where the second database cluster and the third database cluster each include the first type server and the second type server; the levels of the first database cluster, the second database cluster and the third database cluster are gradually reduced;
the service scheduling server is further configured to:
detecting whether a database server currently communicated with the service scheduling server fails or not according to a preset detection period;
if the fault occurs, switching the database server which is currently communicated with the service scheduling server into a designated server in a designated cluster;
the designated cluster is a cluster at the next level of a cluster to which a database server in current communication belongs in a second database cluster under a pre-production environment and a third database cluster under a test environment;
the designated server is a database server of the same type as the target server before the handover.
Optionally, the system further comprises: each database cluster corresponds to an application server cluster; different database clusters correspond to different application server clusters;
the first type of server and the second type of server in any database cluster are used for storing: the application server cluster corresponding to the database cluster aims at the processing result of the metadata in the basic database server; data stored in the first type server is quantitatively cleared in a preset period so as to store user data with recently specified duration;
each application server cluster is used for reading the metadata in the basic database server, performing designated processing on the read metadata to obtain a processing result, and storing the processing result in the first type server and the second type server in the corresponding database cluster.
Optionally, any application server cluster includes a main application server and a standby application server that operate in a dual-host hot standby mode;
and timing tasks are deployed in the main application server and the standby application server, and when the timing tasks are started, the metadata in the basic database server are processed, and processing results aiming at the metadata are stored in the first class server and the second class server in the corresponding database cluster.
Corresponding to the foregoing method embodiment, an embodiment of the present invention further provides a data access apparatus, which is applied to a service scheduling server, and as shown in fig. 6, the apparatus includes:
a first receiving module 610, configured to receive a data access instruction sent by a user side; wherein, the data access instruction carries a target time range to which the data to be accessed belongs;
a request module 620, configured to send a data acquisition request for the data to be accessed to a target server; the target server is a database server which is currently communicated with the service scheduling server; the target server defaults to a first class of server in a first database cluster in a production environment, the first database cluster further comprising: a second type of server; the first type server is a database server for storing user data with recently appointed duration, and the second type server is a database server for storing full user data;
a second receiving module 630, configured to receive a response result corresponding to the data obtaining request fed back by the target server;
a first response module 640, configured to, if the response result is: representing the acquisition failure result that the target time range does not belong to the time coverage range of the data stored by the target server, switching the database server communicated with the service scheduling server into the second type server in the database cluster to which the target server belongs, and returning to the step of sending a data acquisition request aiming at the data to be accessed to the target server;
the second response module 650 is configured to, if the response result is a result indicating that data acquisition is successful, feed back the response result to the user side.
Optionally, the apparatus further comprises:
the detection module is used for detecting whether a database server which is currently communicated with the service scheduling server breaks down or not according to a preset detection period;
the switching module is used for switching the database server which is currently communicated with the service scheduling server into a designated server in a designated cluster if a fault occurs;
the designated cluster is a cluster of the next level of a cluster to which a currently communicated database server belongs in a second database cluster in a pre-production environment and a third database cluster in a test environment, and the levels of the first database cluster, the second database cluster and the third database cluster are gradually reduced;
the second database cluster and the third database cluster both comprise the first type of server and the second type of server, and the specified server is a database server with the same type as a target server before switching.
Optionally, the first type of server and the second type of server in any database cluster are both configured to store: processing results of the application server cluster corresponding to the database cluster aiming at the metadata in the basic database server; data stored in the first type server is quantitatively cleared in a preset period so as to store user data with recently specified duration;
different database clusters correspond to different application server clusters.
Optionally, any application server cluster includes a main application server and a standby application server that operate in a dual-host hot standby mode;
and timing tasks are deployed in the main application server and the standby application server, and when the timing tasks are started, the metadata in the basic database server are processed, and processing results aiming at the metadata are stored in the first class server and the second class server in the corresponding database cluster.
An embodiment of the present invention further provides an electronic device, as shown in fig. 7, including a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the steps of any of the data access methods described above when executing the program stored in the memory 703.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In a further embodiment of the present invention, there is also provided a computer readable storage medium having stored therein a computer program, which when executed by a processor, performs the steps of any of the data access methods described above.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the data access methods of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for system and apparatus embodiments, the description is relatively simple as it is substantially similar to the method embodiments, and reference may be made to some descriptions of the method embodiments for relevant points.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A data access method, applied to a service scheduling server, the method comprising:
receiving a data access instruction sent by a user side; wherein, the data access instruction carries a target time range to which the data to be accessed belongs;
sending a data acquisition request aiming at the data to be accessed to a target server; the target server is a database server which is currently communicated with the service scheduling server; the target server defaults to a first class of server in a first database cluster in a production environment, the first database cluster further comprising: a second type of server; the first type server is a database server for storing user data with recently appointed duration, and the second type server is a database server for storing full user data;
receiving a response result corresponding to the data acquisition request fed back by the target server;
if the response result is: a step of representing an acquisition failure result that the target time range does not belong to the time coverage range of the data stored in the target server, switching a database server communicated with the service scheduling server to the second type server in the database cluster to which the target server belongs, and returning to the step of sending a data acquisition request for the data to be accessed to the target server;
and if the response result is the result of successful acquisition of the characterization data, feeding the response result back to the user side.
2. The method of claim 1, further comprising:
detecting whether a database server currently communicated with the service scheduling server fails or not according to a preset detection period;
if the fault occurs, switching the database server which is currently communicated with the service scheduling server into a designated server in a designated cluster;
the designated cluster is a cluster of the next level of a cluster to which a currently communicated database server belongs in a second database cluster in a pre-production environment and a third database cluster in a test environment, and the levels of the first database cluster, the second database cluster and the third database cluster are gradually reduced;
the second database cluster and the third database cluster both comprise the first type of server and the second type of server, and the specified server is a database server with the same type as a target server before switching.
3. The method according to claim 1 or 2, wherein the first type of server and the second type of server in any database cluster are used for storing: processing results of the application server cluster corresponding to the database cluster aiming at the metadata in the basic database server; data stored in the first type server is quantitatively cleared in a preset period so as to store user data with the latest specified duration;
different database clusters correspond to different application server clusters.
4. The method of claim 3, wherein any application server cluster comprises a primary application server and a standby application server operating in a dual-host hot-standby mode;
and timing tasks are deployed in the main application server and the standby application server, and when the timing tasks are started, the metadata in the basic database server are processed, and processing results aiming at the metadata are stored in the first class server and the second class server in the corresponding database cluster.
5. A data access system is characterized by comprising a service scheduling server and a database cluster in a production environment, wherein the first database cluster in the production environment comprises a first type server and a second type server which adopt different storage modes, the first type server is a database server for storing user data with recently appointed time, and the second type server is a database server for storing full user data;
the service scheduling server is used for receiving a data access instruction sent by the user side; sending a data acquisition request aiming at the data to be accessed to a target server; receiving a response result corresponding to the data acquisition request fed back by the target server; if the response result is: representing the acquisition failure result of the target time range not belonging to the time coverage range of the data stored by the target server, and switching the database server communicated with the service scheduling server into the second type server in the database cluster to which the target server belongs; returning to the step of sending a data acquisition request aiming at the data to be accessed to a target server; if the response result is the result of successful acquisition of the characterization data, feeding the response result back to the user side; wherein, the data access instruction carries the target time range to which the data to be accessed belongs; the target server is a database server which is currently communicated with the service scheduling server; the target server is defaulted to be a first type server in a first database cluster under a production environment;
and the target server is used for responding to the data acquisition request and feeding back the response result to the service scheduling server when receiving the data acquisition request.
6. The system of claim 5, further comprising a second database cluster in a pre-production environment and a third database cluster in a test environment, the second and third database clusters each comprising the first class of servers and the second class of servers; the levels of the first database cluster, the second database cluster and the third database cluster are gradually reduced;
the service scheduling server is further configured to:
detecting whether a database server currently communicated with the service scheduling server fails or not according to a preset detection period;
if the fault occurs, switching the database server which is currently communicated with the service scheduling server into a designated server in a designated cluster;
the designated cluster is a cluster at the next level of a cluster to which a database server in current communication belongs in a second database cluster under a pre-production environment and a third database cluster under a test environment;
the designated server is a database server of the same type as the target server before the handover.
7. The system according to claim 5 or 6, characterized in that it further comprises: each database cluster corresponds to an application server cluster; different database clusters correspond to different application server clusters;
the first type of server and the second type of server in any database cluster are used for storing: the application server cluster corresponding to the database cluster aims at the processing result of the metadata in the basic database server; data stored in the first type server is quantitatively cleared in a preset period so as to store user data with recently specified duration;
each application server cluster is used for reading the metadata in the basic database server, performing designated processing on the read metadata to obtain a processing result, and storing the processing result in the first-class server and the second-class server in the corresponding database cluster.
8. A data access apparatus, applied to a service scheduling server, the apparatus comprising:
the first receiving module is used for receiving a data access instruction sent by a user side; the data access instruction carries a target time range to which the data to be accessed belong;
the request module is used for sending a data acquisition request aiming at the data to be accessed to a target server; the target server is a database server which is currently communicated with the service scheduling server; the target server defaults to a first class of server in a first database cluster in a production environment, the first database cluster further comprising: a second type of server; the first type server is a database server for storing user data with recently appointed time length, and the second type server is a database server for storing full user data;
the second receiving module is used for receiving a response result corresponding to the data acquisition request fed back by the target server;
a first response module, configured to, if the response result is: representing the acquisition failure result that the target time range does not belong to the time coverage range of the data stored by the target server, switching the database server communicated with the service scheduling server into the second type server in the database cluster to which the target server belongs, and returning to the step of sending a data acquisition request aiming at the data to be accessed to the target server;
and the second response module is used for feeding back the response result to the user side if the response result is the result of successful acquisition of the characterization data.
9. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 4 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN202210586958.8A 2022-05-26 2022-05-26 Data access method, device, equipment and storage medium Pending CN114942838A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210586958.8A CN114942838A (en) 2022-05-26 2022-05-26 Data access method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210586958.8A CN114942838A (en) 2022-05-26 2022-05-26 Data access method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114942838A true CN114942838A (en) 2022-08-26

Family

ID=82908535

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210586958.8A Pending CN114942838A (en) 2022-05-26 2022-05-26 Data access method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114942838A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115237892A (en) * 2022-09-20 2022-10-25 联通智网科技股份有限公司 Data migration method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115237892A (en) * 2022-09-20 2022-10-25 联通智网科技股份有限公司 Data migration method and device

Similar Documents

Publication Publication Date Title
CN108255620B (en) Service logic processing method, device, service server and system
EP3869434B1 (en) Blockchain-based data processing method and apparatus, device, and medium
CN103281798A (en) Method, device and system for achieving modification synchronization
CN109120432B (en) Fault server positioning method and device
CN110795171A (en) Service data processing method and device, computer equipment and storage medium
CN114942838A (en) Data access method, device, equipment and storage medium
CN110750443A (en) Webpage testing method and device, computer equipment and storage medium
US20220039001A1 (en) Network search method and apparatus, device and storage medium
CN112835885A (en) Processing method, device and system for distributed table storage
CN113672894A (en) Data processing method, device and equipment for identifying code request and storage medium
CN111355765A (en) Network request processing and sending method and device
CN110554963B (en) Application rollback method, device and storage medium
CN110765392A (en) Data loading method and device, storage medium and terminal
CN116594874A (en) Method, device, computer equipment and storage medium for testing availability of running environment
CN106528199A (en) Method and terminal for updating automobile instrument panel system
CN105242960A (en) Method for processing system function call request and browser
CN110765148B (en) Service data processing method and device
CN112181785B (en) Method, terminal and storage medium for automatically adding monitoring equipment
CN112765188A (en) Configuration information processing method, configuration management system, electronic device, and storage medium
CN110019262B (en) Data updating method and device
CN111159988A (en) Model processing method and device, computer equipment and storage medium
CN112699023B (en) Project interface testing method and device, computer equipment and storage medium
CN115454846A (en) Data consistency verification method, device, system and medium based on production environment
CN114185625A (en) Method, apparatus, device and medium for confirming interface automation delay execution result
CN115237890A (en) Data migration method, device, medium and equipment for database splitting

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