A data access method and device, computer equipment and readable medium
By storing seed information in an available database instance and directly storing data to the target database, the problems of long master-slave backup time and high resource consumption are solved, and the risk of data loss due to database downtime is reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN YOUWEI TECH CO LTD
- Filing Date
- 2022-12-01
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, the master-slave database backup process is time-consuming and consumes a lot of computing resources, and database downtime leads to a high risk of data loss.
By storing seed information in an available database instance, data is directly stored in the target database, avoiding master-slave backups, and the seed information is used to determine the data storage and retrieval path.
It reduces backup time and computing resource consumption, and reduces the risk of data loss due to database downtime.
Smart Images

Figure CN115729941B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of database technology, and in particular to a data access method, apparatus, computer device, and readable medium. Background Technology
[0002] Currently, databases used for data storage and retrieval are mostly master-slave databases to reduce the risk of database downtime. However, as data volume increases, backing up data stored in the master database to the slave database requires significant time and computing resources, which can easily affect ongoing data storage or retrieval processes. Furthermore, without backups, the risk of data loss due to database downtime is high.
[0003] How to reduce backup time and computing resources while mitigating the risk of data loss due to database downtime is a problem that urgently needs to be solved in existing technologies. Summary of the Invention
[0004] To address the problems in the prior art, embodiments of this specification provide a data access method, apparatus, computer device, and storage medium. By storing seed information that can be indexed to the first data in an available database instance, it is possible to achieve the elimination of master-slave database backup, thereby reducing backup time and saving computing resources.
[0005] To solve the above-mentioned technical problems, the specific technical solution in this specification is as follows:
[0006] On the one hand, embodiments of this specification provide a data access method, including,
[0007] Upon receiving a first data storage request, a service identifier is determined based on the identifier of the data to be stored included in the first data storage request;
[0008] Using the processing algorithm corresponding to the service identifier, the user identifier included in the first data storage request is processed to obtain seed information;
[0009] Store the seed information to an available database instance; and
[0010] Based on the available database instance and the seed information, the first data determined by the seed information is stored in the first target database.
[0011] Furthermore, when there are multiple available database instances, the method for determining the available database instances further includes:
[0012] Probe each of the multiple database instances to determine if each database is available; and
[0013] Summarize the available database instances and use them as the available database instances;
[0014] and;
[0015] The step of storing the first data determined by the seed information in the first target database based on the available database instance and the seed information includes:
[0016] The target available database instance is determined from the plurality of available database instances;
[0017] Based on the target available database instance and the seed information, the first data determined by the seed information is stored in the first target database.
[0018] Furthermore, after storing the first data determined by the seed information in the first target database based on the target available database instance and the seed information, the process further includes:
[0019] Upon receiving a second data storage request, if the identifier of the data to be stored in the second data storage request is the same as the identifier of the data to be stored in the first data storage request, and the user identifier in the second data storage request is the same as the user identifier in the first data storage request, then it is determined whether the target available database instance is available.
[0020] If it is determined that the target available database instance is unavailable, the target available database instance is removed from the plurality of available database instances to obtain at least one first candidate available database instance;
[0021] From the at least one first candidate available database instance, a target first candidate available database instance is determined; and
[0022] Based on the first candidate available database instance of the target and the seed information, the second data determined by the seed information is stored in the second target database.
[0023] Furthermore, after storing the first data determined by the seed information in the first target database based on the target available database instance and the seed information, the method further includes:
[0024] Upon receiving a request to extract the first data, if the data identifier to be extracted and the user identifier in the extraction request are the same as the data identifier to be stored and the user identifier in the first data storage request, then the target available database instance is determined based on at least one of the user identifier and the data identifier to be extracted; and
[0025] Based on the target available database instance and the seed information, the first data is extracted.
[0026] Furthermore, the step of determining the target available database instance based on at least one of the user identifier and the data identifier to be extracted upon receiving an extraction request for the first data, and the step of extracting the first data based on the target available database instance and the seed information, further includes:
[0027] If it is determined that the target available database instance is unavailable, the target available database instance is removed from the plurality of available database instances to obtain at least one second candidate available database instance;
[0028] From the at least one second candidate available database instance, a target second candidate available database instance is determined; and
[0029] The second candidate available database instance of the target is used as the target available database instance.
[0030] On the other hand, embodiments of this specification also provide a data access device, including,
[0031] The first determining unit is configured to determine a service identifier based on the identifier of the data to be stored included in the first data storage request when a first data storage request is received.
[0032] The first processing unit is used to process the user identifier included in the first data storage request using a processing algorithm corresponding to the service identifier to obtain seed information;
[0033] The first storage unit is used to store the seed information to an available database instance; and
[0034] The second storage unit is used to store the first data determined by the seed information in the first target database based on the available database instance and the seed information.
[0035] Furthermore, when there are multiple available database instances, the means for determining the available database instances further includes,
[0036] A detection unit is configured to detect each of a plurality of database instances to determine whether each database is available; and
[0037] A summarization unit is used to summarize available database instances and use the available database instances as the available database instances;
[0038] and;
[0039] The second storage unit includes:
[0040] The second determining unit is configured to determine the target available database instance from the plurality of available database instances;
[0041] The third storage unit stores the first data determined by the seed information in the first target database based on the target available database instance and the seed information.
[0042] Furthermore, following the third storage unit, it further includes,
[0043] The third determining unit is configured to determine whether the target available database instance is available when a second data storage request is received, provided that the data identifier to be stored in the second data storage request is the same as the data identifier to be stored in the first data storage request, and the user identifier in the second data storage request is the same as the user identifier in the first data storage request.
[0044] The removal unit is configured to remove the target available database instance from the plurality of available database instances when it is determined that the target available database instance is unavailable, thereby obtaining at least one first candidate available database instance;
[0045] The fourth determining unit is configured to determine a target first candidate available database instance from the at least one first candidate available database instance; and
[0046] The fourth storage unit is used to store the second data determined by the seed information in the second target database based on the first candidate available database instance and the seed information.
[0047] Furthermore, following the third storage unit, it further includes,
[0048] The fifth determining unit is configured to, upon receiving an extraction request for the first data, determine the target available database instance based on at least one of the user identifier and the data identifier to be extracted in the extraction request being identical to the data identifier to be stored and the user identifier in the first data storage request.
[0049] An extraction unit is used to extract the first data based on the target available database instance and the seed information.
[0050] On the other hand, embodiments of this specification also provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method.
[0051] On the other hand, embodiments of this specification also provide a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the above-described method.
[0052] Using the embodiments of this specification, upon receiving a first data storage request, seed information is determined based on the data identifier to be stored and the user identifier included in the first data storage request. This seed information, which identifies the first data, is stored in an available database instance. Then, based on the available database instance and the seed information, the seed information determined by the first data is stored in the first target database. Therefore, by storing the seed information that identifies the first data in an available database instance, master-slave database backups are eliminated, thereby reducing backup time and saving computing resources. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 The diagram shown is a schematic diagram of an implementation system for a data access method according to an embodiment of this specification.
[0055] Figure 2 The diagram shown is a flowchart of a data access method according to an embodiment of this specification;
[0056] Figure 3 The diagram shown is a flowchart of a data access method according to another embodiment of this specification;
[0057] Figure 4A The diagram shown is a flowchart of a data access method according to another embodiment of this specification;
[0058] Figure 4B The diagram shown is a flowchart of another embodiment of the invalid value correction method in this specification;
[0059] Figure 5 The diagram shown is a schematic diagram of a data access method according to an embodiment of this specification.
[0060] Figure 6A The diagram shown is a structural schematic of a data access device according to an embodiment of this specification.
[0061] Figure 6B The diagram shown is a structural schematic of a data access device according to another embodiment of this specification.
[0062] Figure 6C The diagram shown is a structural schematic of a data access device according to another embodiment of this specification.
[0063] Figure 6D The diagram shown is a structural schematic of a data access device according to another embodiment of this specification.
[0064] Figure 6E The diagram shown is a structural schematic of a data access device according to another embodiment of this specification.
[0065] Figure 7 This is a schematic diagram of the structure of a computer device according to an embodiment of this specification.
[0066] [Explanation of Labels in the Attached Image]
[0067] 101. User terminal;
[0068] 102. Server;
[0069] 501. Verification Request;
[0070] 511. User ID and First Service ID;
[0071] 512. User ID and Secondary Service ID;
[0072] 513. User ID and Third-Party Service ID;
[0073] 521. First business server;
[0074] 522. Second business server;
[0075] 523. Third business server;
[0076] 531. First piece of data to be verified;
[0077] 532. Second sub-data to be verified;
[0078] 533. Third sub-data to be verified;
[0079] 540. Verification results information;
[0080] 610. First Determined Unit;
[0081] 620. First processing unit;
[0082] 630. First storage unit;
[0083] 640. Second storage unit;
[0084] 641. Second Determined Unit;
[0085] 642. Third storage unit;
[0086] 6150, Third Determined Unit;
[0087] 6160, Remove Unit;
[0088] 6170, Fourth Determined Unit;
[0089] 6180, Fourth storage unit;
[0090] 6250, Fifth Determined Unit;
[0091] 6260, Extraction Unit;
[0092] 6350, Fifth Determined Unit;
[0093] 6360, Sub-removal unit;
[0094] 6370, the sixth determined unit;
[0095] 6380, Seventh Determined Unit;
[0096] 6390, Extraction Unit;
[0097] 702. Computer equipment;
[0098] 704. Processing equipment;
[0099] 706. Storage resources;
[0100] 708. Drive mechanism;
[0101] 710. Input / Output Module;
[0102] 712. Input devices;
[0103] 714. Output devices;
[0104] 716. Presentation equipment;
[0105] 718. Graphical User Interface;
[0106] 720. Network interface;
[0107] 722. Communication link;
[0108] 724. Communication bus. Detailed Implementation
[0109] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.
[0110] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0111] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0112] In the technical solutions of this specification, the collection, storage, use, processing, transmission, provision, disclosure, and application of user personal information and parameter information all comply with the provisions of relevant laws and regulations, have taken necessary confidentiality measures, and do not violate public order and good morals.
[0113] Figure 1 The diagram illustrates an implementation system for a data access method according to an embodiment of this specification. The system may include a user terminal 101 and a server 102. The user terminal 101 and server 102 communicate via a network, which may include a Local Area Network (LAN), a Wide Area Network (WAN), the Internet, or a combination thereof, and is connected to a website, user equipment (e.g., a computing device), and a backend system. When a user needs to store first data from a service server into the current server 102, the user can send a first data storage request to the current server 102. This first data storage request includes a user identifier and a service identifier. Furthermore, when the user needs to retrieve first data from the current server 102, the user sends a retrieval request to the current server 102 to complete the retrieval of the first data.
[0114] In addition, users can send verification requests to server 102 via user terminal 101. These verification requests can be broken down into multiple first data storage requests and retrieval requests. Upon receiving the verification request, server 102 determines multiple first data storage requests based on the request, and then determines a service identifier based on the data identifier to be stored included in each first data storage request. Using a processing algorithm corresponding to the service identifier, it processes the user identifier included in the first data storage request to obtain seed information. It stores the seed information in an available database instance. Based on the available database instance and the seed information, it stores the first data determined by the seed information in a first target database. Then, after storing the first data in the first target database, when server 102 needs to verify the first data, it determines a retrieval request based on the first data, and for the retrieval request, determines a target available database instance. Based on the target available database instance and the seed information, it retrieves the first data. Finally, based on the first data, it determines the verification result and feeds it back to user terminal 101.
[0115] Alternatively, server 102 may be a node of a cloud computing system (not shown in the figure), or each server 102 may be a separate cloud computing system comprising multiple computers interconnected by a network and operating as a distributed processing system.
[0116] In an optional embodiment, the user terminal 101 may include electronic devices, including but not limited to smartphones, data acquisition devices, desktop computers, tablets, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, and other similar electronic devices. Optionally, the operating system running on the electronic device may include, but is not limited to, Android, iOS, Linux, Windows, etc.
[0117] In addition, it should be noted that, Figure 1 The example shown is merely one application environment provided in this manual. In actual applications, it may include multiple user terminals 101, and this manual does not impose any restrictions.
[0118] like Figure 2 The diagram shows a flowchart of a data access method according to an embodiment of this specification. The data storage process is described in this figure, but may include more or fewer steps based on conventional or non-inventive methods. The order of steps listed in the embodiment is merely one possible execution order among many and does not represent the only possible execution order. In actual system or device products, the methods shown in the embodiment or the accompanying drawings can be executed sequentially or in parallel. Specifically, as shown... Figure 2As shown, the method may include:
[0119] S210, upon receiving the first data storage request, determine the service identifier based on the identifier of the data to be stored included in the first data storage request;
[0120] S220, using the processing algorithm corresponding to the business identifier, the user identifier included in the first data storage request is processed to obtain seed information;
[0121] S230, store seed information to an available database instance;
[0122] S240, based on the available database instance and seed information, the first data determined by the seed information is stored in the first target database.
[0123] Using the embodiments of this specification, upon receiving a first data storage request, seed information is determined based on the data identifier to be stored and the user identifier included in the first data storage request. This seed information, which identifies the first data, is stored in an available database instance. Then, based on the available database instance and the seed information, the seed information determined by the first data is stored in the first target database. Therefore, by storing the seed information that identifies the first data in an available database instance, master-slave database backups are eliminated, thereby reducing backup time and saving computing resources.
[0124] According to one embodiment of this specification, when a verification request is received from a user via a user terminal, the verification request includes a user identifier and a verification identifier. The verification identifier represents an identifier corresponding to the verification request. The verification request is parsed to obtain multiple first data storage requests. For example, when a user needs to store first data from a business server to the current server, the user can send a first data storage request to the current server, and this first data storage request includes a user identifier and a business identifier.
[0125] Multiple preset business identifiers are pre-associated with each verification identifier. For example, when the verification request is a consumption amount query request, the verification identifier is 01, and the preset business identifiers associated with 01 could be, for example, online shopping business identifiers, loan record business identifiers, and on-site consumption business identifiers. Based on the consumption amount query request, the preset business identifiers associated with the consumption amount query are determined as business identifiers. Then, based on the user identifier and each business identifier, the corresponding first data storage request is determined.
[0126] The user identifier may include, for example, multiple parameters that are input when retrieving first data from the business server corresponding to each business identifier. For instance, when the business is a loan record, and time information is required when retrieving data from the server used to process and store loan records, the business identifier is the loan record identifier, the business server is the loan record server, and the user identifier is the time information. It should be noted that when retrieving data from the business server requires multiple parameters, the user identifier includes multiple pieces of information.
[0127] The first data storage request may include, for example, an identifier for the data to be stored and a user identifier. The identifier for the data to be stored may, for example, be a business identifier. It should be noted that the first data storage request received may be a first data storage request determined by the server.
[0128] Since the parameters required to retrieve data from different business servers are not the same, it is necessary to determine the target parameters needed to retrieve data from the business server corresponding to the business identifier, based on the user identifier. Beforehand, a corresponding processing algorithm is configured for each business identifier. This processing algorithm determines the target parameters to be input from the user identifier. For example, the user identifier includes parameter information A, B, C, and D. For business identifier W, retrieving data from the business server corresponding to W requires inputting parameter information C and D. The processing algorithm corresponding to W then processes the user identifier to obtain parameter information C and D, and uses this parameter information C and D as seed information.
[0129] An available database instance is a database instance that is available at the current moment. In addition, it should be noted that when determining whether a database instance is an available database instance, it is only considered an available database instance if both the database instance and the database instance are available.
[0130] Seed information is stored in an available database instance. Based on the business identifier, template information for retrieving the first data from the business server is determined; the template information is updated using the seed information to obtain retrieval information; based on this retrieval information, an interface connection is established with the business server to retrieve the first data from the business server.
[0131] After obtaining the first data, based on the available database instance, the first data is stored in the first target database corresponding to that available database instance. Furthermore, the first data can also be associated with seed information for rapid data extraction.
[0132] Furthermore, after storing the first data in the first target database, the identifier corresponding to the target available database instance can be stored in the context information for use in the next storage of data corresponding to the business identifier and user identifier.
[0133] According to another embodiment of this specification, when there are multiple available database instances, the method for determining an available database instance includes: probing each of the multiple database instances to determine whether each database is available; summarizing the available database instances and using the available database instances as available database instances; and storing the first data determined by the seed information in a first target database based on the available database instances and seed information includes: determining a target available database instance from the multiple available database instances; and storing the first data determined by the seed information in the first target database based on the target available database instance and seed information.
[0134] For each database instance, periodic probes are performed to determine the availability of the database instance and its corresponding database. If both the database instance and its corresponding database are confirmed to be available, the database instance is determined to be a usable database instance. These usable database instances are then aggregated to obtain multiple usable database instances.
[0135] Seed information is saved to each of the multiple database instances. Then, the target database instance is determined from the multiple available database instances. Specifically, one available database instance can be randomly selected as the target database instance. Using the seed information, first data is determined. Based on the target database instance, the first data is stored in the first target database corresponding to the target database instance.
[0136] Since the seed information is available, data can be retrieved from the business server corresponding to the business identifier. Therefore, if the server or the database storing the first data fails, it is unnecessary to retrieve the user identifier from the user terminal again. Instead, a different server or a different available database instance can be used. The seed information is stored in the new available database instance, and the data is retrieved from the business server corresponding to the business identifier. This eliminates the need for a backup of the first data from the secondary database, while also reducing the risk of data loss due to server or database failures that would occur if only the primary database were used.
[0137] Figure 3 The diagram shows a flowchart of another embodiment of a data access method according to this specification. This figure depicts another data storage process, but based on conventional or non-inventive labor, it may include more or fewer operational steps. Specifically, as... Figure 3As shown, the method may include:
[0138] S350, when a second data storage request is received, if the data identifier to be stored in the second data storage request is the same as the data identifier to be stored in the first data storage request, and the user identifier in the second data storage request is the same as the user identifier in the first data storage request, then determine whether the target available database instance is available;
[0139] S360, if it is determined that the target available database instance is unavailable, remove the target available database instance from multiple available database instances to obtain at least one first candidate available database instance;
[0140] S370, determine the target first candidate available database instance from at least one first candidate available database instance;
[0141] S380, based on the first candidate available database instance and seed information, the second data determined by the seed information is stored in the second target database.
[0142] Using the embodiments of this specification, when a second data storage request including the user identifier and the identifier of the data to be stored is received again, the target available database instance is directly determined from the context information. After determining whether the target available database instance and the first target database corresponding to it are available, if either the target available database instance or the first target database is unavailable, the target available database instance is determined to be unavailable. Then, a new target first candidate available database instance is determined, and the storage of the second data is completed. This eliminates the need to use the processing algorithm corresponding to the business identifier to obtain seed information and to store that seed information in each available database instance again, thus reducing resource waste.
[0143] According to another embodiment of this specification, when the user sends a message again... Figure 2 When the same verification request is received, multiple second data storage requests are similarly determined based on that verification request. Furthermore, if a user wants to store second sub-data in the business server to the current server again, the user can send a second data storage request to the current server, which includes the user identifier and the business identifier.
[0144] From the context information, the target available database instance corresponding to the user identifier and the business identifier is determined. Then, it is determined whether the target available database instance and the first target database corresponding to it are available. If both the target available database instance and the first target database are available, the target available database instance is determined to be available. Based on the seed information stored in the target available database instance, second sub-data is obtained from the business server. Using the target available database instance, the second sub-data is stored in the first target database.
[0145] If it is determined that either the target available database instance or the first target database is unavailable, then the target available database instance is determined to be unavailable. Figure 2 The target available database instance is removed from the identified multiple available database instances, and the remaining available database instances are used as first candidate available database instances. From these at least one first candidate available database instances, the target first candidate available database instance is determined.
[0146] After determining the first candidate available database instance of the target, based on the seed information stored in the first candidate available database instance of the target, the first data and the second sub-data are obtained from the business server, and the first data and the second sub-data are used as the second data.
[0147] Based on the first available candidate database instance, the second data is stored in the second target database corresponding to that first available candidate database instance. For example, seed information can also be associated with the second data for rapid data extraction.
[0148] It should be noted that if the target available database instance is unavailable, while or after storing the second data in the second target database, the original identifier corresponding to the target available database instance is updated using the identifier corresponding to the first candidate available database instance and stored in the context information.
[0149] Figure 4A The diagram shows a flowchart of a data access method according to another embodiment of this specification; this figure describes a data extraction process, but based on conventional or non-creative labor, it may include more or fewer operational steps. Specifically, as shown... Figure 4A As shown, the method may include:
[0150] S4150, when receiving a request to extract the first data, the identifier of the data to be extracted and the user identifier in the extraction request are the same as the identifier of the data to be stored and the user identifier in the first data storage request. Based on the identifier of the data to be extracted, the target available database instance is determined.
[0151] S4160, upon receiving an extraction request for the first data, the identifier of the data to be extracted in the extraction request is the same as the identifier of the data to be stored in the first data storage request. Based on at least one of the user identifier and the identifier of the data to be extracted, a target available database instance is determined.
[0152] According to another embodiment of this specification, when a user needs to extract first data, they can send a data identifier to be extracted and a user identifier to the server via a user terminal. The data identifier to be extracted is a service identifier. Furthermore, when a user sends a verification request, after storing the first data in the first target database, the first data needs to be extracted and processed to obtain the final verification result.
[0153] Based on at least one of the user identifier and the business identifier, determine the target available database instance from the context information.
[0154] Then, based on the seed information, the target available database instance is identified, and the first data is extracted from the target available database. After extracting the first data, it can be sent to the user terminal for display, or it can be verified to determine the corresponding verification result, which is then sent to the user terminal for display.
[0155] Figure 4B The diagram shows a flowchart of another embodiment of a method for correcting invalid values, as described in this specification. This diagram depicts another data extraction process, but based on conventional or non-creative labor, it may include more or fewer operational steps. Specifically, as shown... Figure 4B As shown, the method may include:
[0156] S4250, when receiving a request to extract the first data, the identifier of the data to be extracted and the user identifier in the extraction request are the same as the identifier of the data to be stored and the user identifier in the first data storage request. Based on at least one of the user identifier and the identifier of the data to be extracted, the target available database instance is determined.
[0157] S4260, Determine whether the target available database instance is available;
[0158] S4271, if it is determined that the target available database instance is unavailable, remove the target available database instance from multiple available database instances to obtain at least one second candidate available database instance;
[0159] S4272, determine the target second candidate available database instance from at least one second candidate available database instance;
[0160] S4273, Select the second candidate available database instance as the target available database instance;
[0161] S4280, Obtain the target database instance;
[0162] S4290, based on the target available database instance and seed information, extract the first data.
[0163] Using the embodiments of this specification, after determining a target available database instance based on context information, if it is determined that the target available database instance is unavailable, the first data can be re-determined based on the seed information without reporting data extraction failure to the user terminal, or determining the corresponding seed information again based on the user identifier, thereby reducing resource waste.
[0164] According to another embodiment of this specification, after determining the target available database instance based on S4250, it is detected whether the target available database instance and the first target database corresponding to the target available database instance are available. If it is determined that both the target available database instance and the first target database corresponding to the target available database instance are available, the target available database instance is obtained. Then, based on the target available database instance and seed information, first data is extracted from the first target database and the first data is sent to the user terminal for display.
[0165] If it is determined that the target database instance is available and one of the first target databases corresponding to the target database instance is unavailable, then the target database instance is determined to be unavailable. Furthermore, Figure 2 The target available database instance is removed from the identified multiple available database instances, and the remaining available database instances are designated as second candidate available database instances. From these at least one second candidate available database instances, a target second candidate available database instance is determined and designated as the target available database instance. Then, based on the seed information in the target available database instance, first data is retrieved from the business server. This first data is then sent to the user terminal for display.
[0166] Therefore, while avoiding sending feedback data retrieval failures to the user terminal, it also avoids sending a user identifier retrieval request to the user terminal when the first data is lost, thereby improving the user experience.
[0167] Figure 5 The diagram shown is a schematic diagram of a data access method according to an embodiment of this specification.
[0168] like Figure 5As shown, when a verification request 501 is received from a user through a user terminal, the verification request 501 includes a user identifier, a service identifier, and a verification identifier. Based on the verification identifier included in the verification request 501, the service identifier is determined. For example, for the verification identifier included in the verification request 501, there are three preset service identifiers associated with it.
[0169] Then, for the user identifier and the first service identifier 511, the user identifier is processed using the processing rules corresponding to the first service identifier to determine the first seed information. Similarly, for the user identifier and the second service identifier 512, the user identifier is processed using the processing rules corresponding to the second service identifier to determine the second seed information. For the user identifier and the third service identifier 513, the user identifier is processed using the processing rules corresponding to the third service identifier to determine the third seed information.
[0170] The server utilizes its liveness detection system and workflow engine to probe each of the included database instances, identifying multiple available database instances. After identifying these instances, the workflow engine stores first, second, and third seed information in each of these available database instances, respectively. It's worth noting that user identifiers can also be stored as seed information in multiple available database instances. Each time data is retrieved from the corresponding business server, the target parameter information is then determined from the user identifier.
[0171] Then, based on the first seed information, the first sub-data to be verified 531 is obtained from the first business server 521; based on the second seed information, the second sub-data to be verified 532 is obtained from the second business server 522; and based on the third seed information, the third sub-data to be verified 533 is obtained from the third business server 523.
[0172] The process engine selects a target available database instance from multiple available database instances, and based on the target available database instance, stores the first sub-data to be verified 531, the second sub-data to be verified 532, and the third sub-data to be verified 533 in the first target database corresponding to the target available database instance for verification.
[0173] After the first sub-data to be verified 531, the second sub-data to be verified 532, and the third sub-data to be verified 533 are all stored, the first sub-data to be verified 531, the second sub-data to be verified 532, and the third sub-data to be verified 533 are extracted and processed for verification to obtain the corresponding verification result information 540, and the verification result information 540 is fed back to the user terminal.
[0174] It should be noted that, for example, if the first target database crashes after storing the first sub-database to be verified 531 and the second sub-database to be verified 532 in the first target database, the target available database instance is removed from multiple available database instances to obtain at least one candidate available database instance. Then, from this at least one candidate available database instance, the target available database instance is determined. Based on the first seed information, second seed information, and third seed information stored in the target available database instance, the first sub-database to be verified 531, the second sub-database to be verified 532, and the third sub-database to be verified 533 are obtained from the first business server 521, the second business server 522, and the third business server 523, respectively, to determine the corresponding verification result information 540.
[0175] It should be noted that the embodiments in this specification do not limit the number of service identifiers, the number of service servers, and the number of sub-data to be verified. The number of service identifiers, the number of service servers, and the number of sub-data to be verified can all be determined according to the actual situation.
[0176] Figure 6A The diagram shown is a structural schematic of a data access device according to an embodiment of this specification. Figure 6A As shown, including,
[0177] The first determining unit 610 is configured to determine a service identifier based on the identifier of the data to be stored included in the first data storage request when a first data storage request is received.
[0178] The first processing unit 620 is used to process the user identifier included in the first data storage request using a processing algorithm corresponding to the service identifier to obtain seed information;
[0179] The first storage unit 630 is used to store seed information to an available database instance;
[0180] The second storage unit 640 is used to store the first data determined by the seed information in the first target database based on the available database instance and seed information.
[0181] Since the principle of the above-mentioned device in solving the problem is similar to that of the above-mentioned method, the implementation of the above-mentioned device can refer to the implementation of the above-mentioned method, and the repeated parts will not be described again.
[0182] Figure 6B The diagram shown is a structural schematic of a data access device according to another embodiment of this specification. When there are multiple available database instances, the second storage unit device is as follows: Figure 6B As shown, including,
[0183] The second determining unit 641 is used to determine the target available database instance from the available database instances;
[0184] The third storage unit 642 stores the first data determined by the seed information in the first target database based on the target available database instance and seed information.
[0185] Since the principle of the above-mentioned device in solving the problem is similar to that of the above-mentioned method, the implementation of the above-mentioned device can refer to the implementation of the above-mentioned method, and the repeated parts will not be described again.
[0186] Figure 6C The diagram shown is a structural schematic of a data access device according to another embodiment of this specification. Figure 6C As shown, including,
[0187] The third determining unit 6150 is used to determine whether the target available database instance is available when a second data storage request is received, provided that the data identifier to be stored in the second data storage request is the same as the data identifier to be stored in the first data storage request, and the user identifier in the second data storage request is the same as the user identifier in the first data storage request.
[0188] The removal unit 6160 is used to remove the target available database instance from multiple available database instances when it is determined that the target available database instance is unavailable, so as to obtain at least one first candidate available database instance.
[0189] The fourth determining unit 6170 is used to determine a target first candidate available database instance from at least one first candidate available database instance;
[0190] The fourth storage unit 6180 is used to store the second data determined by the seed information in the second target database based on the first candidate available database instance and the seed information.
[0191] Since the principle of the above-mentioned device in solving the problem is similar to that of the above-mentioned method, the implementation of the above-mentioned device can refer to the implementation of the above-mentioned method, and the repeated parts will not be described again.
[0192] Figure 6D The diagram shown is a structural schematic of a data access device according to another embodiment of this specification. Figure 6D As shown, including,
[0193] The fifth determining unit 6250 is used to determine a target available database instance based on at least one of the user identifier and the data identifier to be extracted in the extraction request and the user identifier in the first data storage request when receiving an extraction request for the first data.
[0194] Extraction unit 6260 is used to extract first data based on the target available database instance and seed information.
[0195] Since the principle of the above-mentioned device in solving the problem is similar to that of the above-mentioned method, the implementation of the above-mentioned device can refer to the implementation of the above-mentioned method, and the repeated parts will not be described again.
[0196] Figure 6E The diagram shown is a structural schematic of a data access device according to another embodiment of this specification. Figure 6E As shown, including,
[0197] The fifth determining unit 6350 is used to determine a target available database instance based on at least one of the user identifier and the data identifier to be extracted in the extraction request and the user identifier in the first data storage request when receiving an extraction request for the first data.
[0198] Sub-removal unit 6360 is used to remove the target available database instance from multiple available database instances when it is determined that the target available database instance is unavailable, so as to obtain at least one second candidate available database instance;
[0199] The sixth determining unit 6370 is used to determine a target second candidate available database instance from at least one second candidate available database instance;
[0200] The seventh determining unit 6380 is used to determine the second candidate available database instance of the target as the target available database instance;
[0201] Extraction unit 6390 is used to extract first data based on the target available database instance and seed information.
[0202] Since the principle of the above-mentioned device in solving the problem is similar to that of the above-mentioned method, the implementation of the above-mentioned device can refer to the implementation of the above-mentioned method, and the repeated parts will not be described again.
[0203] like Figure 7The diagram illustrates the structure of a computer device according to an embodiment of this specification. The apparatus described in this specification can be the computer device in this embodiment, performing the methods described above. The computer device 702 may include one or more processing devices 704, such as one or more central processing units (CPUs), each of which can implement one or more hardware threads. The computer device 702 may also include any storage resource 706 for storing information of any kind, such as code, settings, data, etc. Without limitation, for example, the storage resource 706 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory, hard disk, optical disk, etc. More generally, any storage resource can use any technology to store information. Furthermore, any storage resource can provide volatile or non-volatile retention of information. Further, any storage resource may represent a fixed or removable component of the computer device 702. In one case, when the processing device 704 executes associated instructions stored in any storage resource or combination of storage resources, the computer device 702 can perform any operation of the associated instructions. The computer device 702 also includes one or more drive mechanisms 708 for interacting with any storage resource, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.
[0204] Computer device 702 may also include an input / output module 710 (I / O) for receiving various inputs (via input device 712) and providing various outputs (via output device 714). A specific output mechanism may include a presentation device 716 and an associated graphical user interface (GUI) 718. In other embodiments, the input / output module 710 (I / O), input device 712, and output device 714 may be omitted, and the device may function solely as a computer device within a network. Computer device 702 may also include one or more network interfaces 720 for exchanging data with other devices via one or more communication links 722. One or more communication buses 724 couple the components described above together.
[0205] Communication link 722 can be implemented in any way, such as via a local area network, a wide area network (e.g., the Internet), a point-to-point connection, or any combination thereof. Communication link 722 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
[0206] This specification also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0207] This specification also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described method.
[0208] Those skilled in the art will understand that embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0209] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0210] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0211] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0212] The above specific embodiments further illustrate the purpose, technical solutions, and beneficial effects of this specification. It should be understood that the above are merely specific embodiments of this specification and are not intended to limit the scope of protection of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.
Claims
1. A data access method, characterized in that, include: Upon receiving a first data storage request, a service identifier is determined based on the identifier of the data to be stored included in the first data storage request; Using the processing algorithm corresponding to the service identifier, the user identifier included in the first data storage request is processed to obtain seed information; Store the seed information in an available database instance; as well as Based on the available database instance and the seed information, the first data determined by the seed information is stored in the first target database; wherein, the first data is determined in the following way: based on the business identifier, template information for obtaining the first data from the business server is determined; the template information is updated using the seed information to obtain the acquisition information; based on the acquisition information, an interface connection is established with the business server to obtain the first data from the business server.
2. The method according to claim 1, characterized in that, When there are multiple available database instances, the method for determining the available database instances includes: Probe each of the multiple database instances to determine if each database is available; and Summarize the available database instances and use them as the available database instances; and; The step of storing the first data determined by the seed information in the first target database based on the available database instance and the seed information includes: The target available database instance is determined from the plurality of available database instances; Based on the target available database instance and the seed information, the first data determined by the seed information is stored in the first target database.
3. The method according to claim 2, characterized in that, After storing the first data corresponding to the seed information in the target database based on the target available database instance and the seed information, the method further includes: Upon receiving a second data storage request, if the identifier of the data to be stored in the second data storage request is the same as the identifier of the data to be stored in the first data storage request, and the user identifier in the second data storage request is the same as the user identifier in the first data storage request, then it is determined whether the target available database instance is available. If it is determined that the target available database instance is unavailable, the target available database instance is removed from the plurality of available database instances to obtain at least one first candidate available database instance; From the at least one first candidate available database instance, a target first candidate available database instance is determined; and Based on the first candidate available database instance of the target and the seed information, the second data determined by the seed information is stored in the second target database.
4. The method according to claim 2, characterized in that, After storing the first data determined by the seed information in the first target database based on the target available database instance and the seed information, the method further includes: Upon receiving a request to extract the first data, if the data identifier to be extracted and the user identifier in the extraction request are the same as the data identifier to be stored and the user identifier in the first data storage request, then the target available database instance is determined based on at least one of the user identifier and the data identifier to be extracted; and Based on the target available database instance and the seed information, the first data is extracted.
5. The method according to claim 4, characterized in that, After determining the target available database instance based on at least one of the user identifier and the data identifier to be extracted upon receiving an extraction request for the first data, and before extracting the first data based on the target available database instance and the seed information, the method further includes: If it is determined that the target available database instance is unavailable, the target available database instance is removed from the plurality of available database instances to obtain at least one second candidate available database instance; From the at least one second candidate available database instance, a target second candidate available database instance is determined; and The second candidate available database instance of the target is used as the target available database instance.
6. A data access device, characterized in that, include: The first determining unit is configured to determine a service identifier based on the identifier of the data to be stored included in the first data storage request when a first data storage request is received. The first processing unit is used to process the user identifier included in the first data storage request using a processing algorithm corresponding to the service identifier to obtain seed information; The first storage unit is used to store the seed information to an available database instance; as well as The second storage unit is used to store the first data determined by the seed information in the first target database based on the available database instance and the seed information; wherein the first data is determined in the following way: based on the business identifier, determine the template information for obtaining the first data from the business server; update the template information using the seed information to obtain the acquisition information; based on the acquisition information, establish an interface connection with the business server to obtain the first data from the business server.
7. The apparatus according to claim 6, characterized in that, When there are multiple available database instances, the means for determining the available database instances includes: A detection unit is configured to detect each of a plurality of database instances to determine whether each database is available; and A summarization unit is used to summarize available database instances and use the available database instances as the available database instances; and; The second storage unit includes: The second determining unit is used to determine the target available database instance from the plurality of available database instances; The third storage unit stores the first data determined by the seed information in the first target database based on the target available database instance and the seed information.
8. The apparatus according to claim 7, characterized in that, Following the third storage unit, the following is also included: The third determining unit is configured to determine whether the target available database instance is available when a second data storage request is received, provided that the data identifier to be stored in the second data storage request is the same as the data identifier to be stored in the first data storage request, and the user identifier in the second data storage request is the same as the user identifier in the first data storage request. The removal unit is configured to remove the target available database instance from the plurality of available database instances when it is determined that the target available database instance is unavailable, thereby obtaining at least one first candidate available database instance; The fourth determining unit is configured to determine a target first candidate available database instance from the at least one first candidate available database instance; and The fourth storage unit is used to store the second data determined by the seed information in the second target database based on the first candidate available database instance and the seed information.
9. The apparatus according to claim 7, characterized in that, Following the third storage unit, the following is also included: The fifth determining unit is configured to, upon receiving an extraction request for the first data, wherein the data identifier to be extracted and the user identifier in the extraction request are the same as the data identifier to be stored and the user identifier in the first data storage request, determine the target available database instance based on at least one of the user identifier and the data identifier to be extracted; An extraction unit is used to extract the first data based on the target available database instance and the seed information.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1-5.