CN-115729982-B - Data processing method and device
Abstract
The embodiment of the specification provides a data processing method and a data processing device, wherein the data processing method comprises the steps of determining a data access request sent by an application program, wherein the data access request carries node information of an initial access node corresponding to the application program and data information of target data, determining at least two nodes to be accessed for storing the target data according to the data information, determining the initial access node according to the node information, and determining a target access node from the at least two nodes to be accessed under the condition that the type of the data access request is determined to be a target type and the initial access node and the at least two nodes to be accessed do not belong to the same access node, and processing the data access request according to the target access node. The application program is enabled to call the target data stored in the target access node, so that the user can access the application program, and the user experience is ensured.
Inventors
- CHEN LEI
Assignees
- 浙江网商银行股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20221129
Claims (14)
- 1. A data processing method is applied to a database client, and comprises the following steps: determining a data access request sent by an application program, wherein the data access request carries node information of an initial access node corresponding to the application program and data information of target data; Determining at least two nodes to be accessed for storing the target data according to the data information, and determining the initial access node according to the node information of the initial access node; determining a target access node from the at least two nodes to be accessed under the condition that the type of the data access request is determined to be a target type and the initial access node and the at least two nodes to be accessed do not belong to the same access node, wherein the target type is a weak consistency type; and processing the data access request according to the target access node.
- 2. The method of claim 1, the determining a target access node from the at least two nodes to be accessed, comprising: And determining the node to be accessed meeting the preset condition as a target access node from the at least two nodes to be accessed.
- 3. The method of claim 2, wherein the determining, from the at least two nodes to be accessed, the node to be accessed that satisfies the preset condition as the target access node includes: determining a target node to be accessed from the at least two nodes to be accessed; and under the condition that the network delay with the target node to be accessed meets the preset delay condition, determining the target node to be accessed as a target access node.
- 4. A method according to claim 3, the node information comprising a node identity and a region identity; Accordingly, the determining the initial access node according to the node information includes: determining the initial access node according to the node identification; accordingly, the determining the target node to be accessed from the at least two nodes to be accessed includes: and determining a target node to be accessed corresponding to the area identifier from the at least two nodes to be accessed according to the area identifier.
- 5. The method of claim 1, further comprising, after the determining the data access request sent by the application program: and determining the type of the data access request according to the request type identifier carried in the data access request.
- 6. The method of claim 1, further comprising, after the determining the initial access node from the node information: and determining the initial access node as a target access node under the condition that the type of the data access request is determined to be the target type and the initial access node and the at least two nodes to be accessed belong to the same access node.
- 7. The method of claim 1, further comprising, after the determining the initial access node from the node information: and under the condition that the type of the data access request is determined to be a preset access type, determining a main node to be accessed from the at least two nodes to be accessed, and determining the main node to be accessed as a target access node, wherein the preset access type is a strong consistency type.
- 8. The method of claim 1, the determining a data access request sent by an application program, comprising: and receiving a data access request sent by the application program in response to the user access request.
- 9. The method of claim 1, the determining at least two nodes to be accessed to store the target data according to the data information, comprising: Determining target data corresponding to the data access request according to the data information; and determining at least two nodes to be accessed for storing the target data according to the target data.
- 10. The method of claim 1, the data access request being an SQL request.
- 11. A distributed database comprising clients and nodes to be accessed, wherein, The client is configured to determine a data access request sent by an application program; determining at least two nodes to be accessed for storing target data according to data information, and determining an initial access node according to node information of the initial access node, wherein the data access request carries node information of the initial access node corresponding to the application program and data information of the target data, and the target type is a weak consistency type under the condition that the type of the data access request is determined to be the target type and the initial access node and the at least two nodes to be accessed do not belong to the same access node; The node to be accessed is configured to process the data access request according to the target access node.
- 12. A data processing apparatus for use in a client of a distributed database, comprising: the first determining module is configured to determine a data access request sent by an application program, wherein the data access request carries node information of an initial access node corresponding to the application program and data information of target data; the second determining module is configured to determine at least two nodes to be accessed for storing the target data according to the data information, and determine the initial access node according to the node information of the initial access node; A third determining module configured to determine a target access node from the at least two nodes to be accessed, in a case that the type of the data access request is determined to be a target type, and the initial access node and the at least two nodes to be accessed do not belong to the same access node, wherein the target type is a weak agreement type; and the processing module is configured to process the data access request according to the target access node.
- 13. A computing device, comprising: A memory and a processor; The memory is configured to store computer executable instructions, the processor being configured to execute the computer executable instructions, which when executed by the processor, implement the steps of the method of any one of claims 1 to 10.
- 14. A computer readable storage medium storing computer executable instructions which when executed by a processor implement the steps of the method of any one of claims 1 to 10.
Description
Data processing method and device Technical Field Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a data processing method. Background At present, an application program is usually deployed in a plurality of machine rooms, and access to the application program by a user is realized by calling data copies of a distributed database in the machine rooms. However, with the richness of services and functions provided by the application program and the increase of data, under the condition that the capacity of the machine room cannot meet the requirements, the application program is migrated to another machine room, and as a data copy of the distributed database is not deployed in the other machine room, the application program migrated to the machine room cannot call data from the machine room, so that the experience of a user is affected. Disclosure of Invention In view of this, the present embodiments provide a data processing method. One or more embodiments of the present specification also relate to a data processing apparatus, a distributed database, a computing device, a computer-readable storage medium, and a computer program that solve the technical drawbacks of the prior art. According to a first aspect of embodiments of the present disclosure, there is provided a data processing method, applied to a database client, including: determining a data access request sent by an application program, wherein the data access request carries node information of an initial access node corresponding to the application program and data information of target data; Determining at least two nodes to be accessed for storing the target data according to the data information, and determining the initial access node according to the node information; Determining a target access node from the at least two nodes to be accessed under the condition that the type of the data access request is determined to be a target type and the initial access node and the at least two nodes to be accessed do not belong to the same access node; and processing the data access request according to the target access node. According to a second aspect of embodiments of the present specification, there is provided a data processing apparatus for application to a client of a distributed database, comprising: the first determining module is configured to determine a data access request sent by an application program, wherein the data access request carries node information of an initial access node corresponding to the application program and data information of target data; the second determining module is configured to determine at least two nodes to be accessed for storing the target data according to the data information, and determine the initial access node according to the node information; a third determining module configured to determine a target access node from the at least two nodes to be accessed when the type of the data access request is determined to be a target type and the initial access node and the at least two nodes to be accessed do not belong to the same access node; and the processing module is configured to process the data access request according to the target access node. According to a third aspect of embodiments of the present description, there is provided a distributed database comprising clients and nodes to be accessed, wherein, The client is configured to determine a data access request sent by an application program; determining at least two nodes to be accessed for storing the target data according to the data information, and determining the initial access node according to the node information, wherein the data access request carries node information of the initial access node corresponding to the application program and data information of target data under the condition that the type of the data access request is determined to be a target type and the initial access node and the at least two nodes to be accessed do not belong to the same access node; The node to be accessed is configured to process the data access request according to the target access node. According to a fourth aspect of embodiments of the present specification, there is provided a computing device comprising: A memory and a processor; The memory is configured to store computer executable instructions that, when executed by the processor, perform the steps of the data processing method described above. According to a fifth aspect of embodiments of the present specification, there is provided a computer readable storage medium storing computer executable instructions which, when executed by a processor, implement the steps of the data processing method described above. According to a sixth aspect of the embodiments of the present specification, there is provided a computer program, wherein the computer program, when executed in a computer, causes the computer to perform the steps of