Cloud database processing method and apparatus, edge device, and storage medium

By storing a read-only instance of the cloud center server locally on the edge device and parsing the device attribute information, and using the local read-only instance to handle read operation requests, the network latency problem when the edge device accesses the cloud database service is solved, and the efficiency of the terminal to obtain cloud database data is improved.

CN117097745BActive Publication Date: 2026-05-19CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA UNITED NETWORK COMM GRP CO LTD
Filing Date
2023-06-26
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Network latency generated when edge devices access cloud database services reduces the efficiency of terminals in obtaining information related to cloud database data.

Method used

The edge device stores a read-only instance of the cloud center server locally. By parsing the device attribute information, the local read-only instance is used to handle read operation requests, reducing interaction with the cloud center server. Requests are only sent to the cloud center server when modification operations are performed.

Benefits of technology

By reducing interaction with the cloud center server, network latency is reduced, and the efficiency of terminals in obtaining cloud database data is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117097745B_ABST
    Figure CN117097745B_ABST
Patent Text Reader

Abstract

The application provides a cloud database processing method and device, an edge device and a storage medium. When the edge device obtains a data processing request sent by a terminal, an application pod in the edge device generates a corresponding cloud database processing request according to the data processing request, and the edge device obtains device attribute information related to the edge device. When the device attribute information meets a device attribute condition, the cloud database processing request is parsed, the operation type of the cloud database processing request is obtained, when the operation type includes a read operation, the request is processed by using a read-only instance stored locally, the data to be read is obtained, and the data is transmitted to the application pod, so that the application pod feeds back the processing result to the terminal after processing the data. Since the read process of the data does not need to interact with a cloud center server, the network delay of the edge device accessing the cloud database in the cloud center server is saved, and the efficiency of the terminal in obtaining information related to the cloud database data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this application relate to the field of computer technology, and in particular to a cloud database processing method, apparatus, edge device, and storage medium. Background Technology

[0002] With the development of the computing industry, the ubiquitous computing model combining cloud, edge, and device has begun to emerge. Edge computing and cloud computing work together to provide customers with fast and secure cloud computing services and data storage.

[0003] Cloud databases create application pods in a containerized form based on Kubernetes software. When the terminal is close to the edge device, the application pod is scheduled to the edge device to provide corresponding services to the terminal. During the service provision process, the application pod needs to interact with the cloud center server to process the corresponding data every time it accesses the cloud database service. This service call process increases network latency and reduces the efficiency of the terminal in obtaining information related to cloud database data. Summary of the Invention

[0004] This application provides a cloud database processing method, apparatus, edge device, and storage medium to solve the technical problem that network latency caused by application pods located on edge devices accessing cloud database services reduces the efficiency of terminals in obtaining information related to cloud database data.

[0005] In a first aspect, this application provides a cloud database processing method, the method being applied to an edge device, the edge device including an application pod, the method comprising:

[0006] When a data processing request is received from a terminal, device attribute information and a cloud database processing request generated by the application pod based on the data processing request are obtained.

[0007] When the device attribute information meets the device attribute conditions, the cloud database processing request is parsed to obtain the operation type of the cloud database processing request; the operation type includes a read operation or a modify operation.

[0008] If the operation type includes the read operation, the cloud database processing request is processed using a read-only instance stored locally to obtain the read data, and the read data is transferred to the application pod.

[0009] If the operation type includes the modification operation, the cloud database processing request is sent to the cloud center server, and the modification result fed back by the cloud center server is transmitted to the application pod; the cloud database processing request containing the modification operation is used to enable the cloud center server to modify the data corresponding to the main instance according to the cloud database processing request, and after the modification is completed, to feed back the modification result to the edge device.

[0010] In the above technical solution, when the edge device receives a data processing request sent by the terminal, the application pod within it generates a corresponding cloud database processing request based on the data processing request. Simultaneously, the edge device obtains its related device attribute information. When the device attribute information meets the device attribute conditions, it parses the cloud database processing request to obtain the operation type of the cloud database processing request. When the operation type includes a read operation, it uses a read-only instance stored locally to process the request, obtains the data to be read, and transmits the data to the application pod. The application pod then processes the data and feeds back the processing result to the terminal. Since the data reading process does not require interaction with the cloud center server, it saves network latency when the edge device accesses the cloud database in the cloud center server, thereby improving the efficiency of the terminal in obtaining information related to cloud database data.

[0011] Optionally, the device attribute information includes the network latency between the terminal and the edge device, the network latency between the edge device and the cloud center server, and the storage performance of the edge device;

[0012] Before parsing the cloud database processing request and obtaining the operation type of the cloud database processing request when the device attribute information meets the device attribute conditions, the method further includes:

[0013] Compare the device attribute information with the device attribute conditions;

[0014] If the sum of the network latency between the terminal and the edge device and the preset latency is less than the network latency between the edge device and the cloud center server, and the storage performance of the edge device is greater than the preset storage performance, then the device attribute information satisfies the device attribute condition.

[0015] If the sum of the network latency between the terminal and the edge device and the preset latency is greater than or equal to the network latency between the edge device and the cloud center server, and / or the storage performance of the edge device is less than or equal to the preset storage performance, then the device attribute information does not meet the device attribute conditions.

[0016] Optionally, the method further includes:

[0017] If the device attribute information does not meet the device attribute conditions, the cloud database processing request is sent to the cloud center server, and the processing result fed back by the cloud center server is fed back to the terminal; the cloud database processing request includes a read operation or a modify operation;

[0018] The cloud database processing request is used to enable the cloud center server to operate on the request using the corresponding instance and to feed back the processing result to the edge device.

[0019] Optionally, the method further includes:

[0020] The data changes in the database of the cloud center server are obtained at preset time intervals, and the read-only instance is updated according to the data changes.

[0021] Optionally, the data changes in the database of the cloud center server are obtained at preset time intervals, specifically including:

[0022] Binlog logs are retrieved from the database in the cloud center server at preset time intervals.

[0023] The data changes in the database of the cloud center server are obtained based on the binlog logs.

[0024] In the above technical solution, the edge device obtains the data changes of the database in the cloud center server at preset time intervals, and updates the read-only instance stored locally on the edge device according to the data changes to achieve synchronization with the database in the cloud center server, thus ensuring the accuracy of the data corresponding to the read-only instance in the edge device.

[0025] Optionally, before processing the cloud database processing request using a locally stored read-only instance, the method further includes:

[0026] If the read-only instance is not stored locally, a corresponding read-only instance will be created locally according to the cloud database processing request.

[0027] Optionally, the method further includes:

[0028] If the cloud center server fails, obtain the response latency of multiple edge devices connected to the cloud center server;

[0029] The database in the edge device with the shortest response latency is designated as the primary database.

[0030] In the above technical solution, when the cloud center server fails, instances stored in multiple edge devices can be used as backup instances of the cloud center server. Each edge device negotiates and selects the instance with the shortest response latency as the primary instance to rebuild the database, ensuring that the terminal will not be unavailable when retrieving data from the database.

[0031] Secondly, this application provides a cloud database processing device, comprising:

[0032] The acquisition module is used to obtain data processing requests sent by the terminal;

[0033] The processing module is used to obtain device attribute information and cloud database processing requests generated by the application pod based on the data processing request when a data processing request is received from the terminal.

[0034] The processing module is also used to parse the cloud database processing request and obtain the operation type of the cloud database processing request when the device attribute information meets the device attribute conditions; the operation type includes a read operation or a modify operation.

[0035] The processing module is further configured to, if the operation type includes the read operation, process the cloud database processing request using a locally stored read-only instance, obtain the read data, and transfer the read data to the application pod;

[0036] The processing module is further configured to, if the operation type includes the modification operation, send the cloud database processing request to the cloud center server and transmit the modification result fed back by the cloud center server to the application pod; the cloud database processing request containing the modification operation is used to enable the cloud center server to modify the data corresponding to the main instance according to the cloud database processing request, and after the modification is completed, to feed back the modification result to the cloud database middleware.

[0037] Thirdly, this application provides an edge device, including: a processor and a memory communicatively connected to the processor;

[0038] The memory stores computer instructions;

[0039] The processor is used to implement the methods involved in the first aspect when executing computer instructions.

[0040] Fourthly, this application provides a computer-readable storage medium storing computer instructions that, when executed by a processor, are used to implement the method involved in the first aspect.

[0041] This application provides a cloud database processing method, apparatus, edge device, and storage medium. When the edge device receives a data processing request sent by the terminal, the application pod within it generates a corresponding cloud database processing request based on the data processing request. Simultaneously, the edge device obtains related device attribute information. When the device attribute information meets the device attribute conditions, it parses the cloud database processing request to obtain the operation type of the cloud database processing request. When the operation type includes a read operation, it processes the request using a locally stored read-only instance to obtain the data to be read and transmits the data to the application pod. The application pod then processes the data and feeds back the processing result to the terminal. Since the data reading process does not require interaction with the cloud center server, it saves network latency when the edge device accesses the cloud database in the cloud center server, thereby improving the efficiency of the terminal in obtaining information related to cloud database data. Attached Figure Description

[0042] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0043] Figure 1 This is a cloud-edge-device system architecture diagram provided in this application according to an exemplary embodiment;

[0044] Figure 2 This is an application scenario diagram of the cloud database processing method provided in this application according to an exemplary embodiment;

[0045] Figure 3 This is a flowchart illustrating a cloud database processing method provided in this application according to an exemplary embodiment;

[0046] Figure 4 This is a flowchart illustrating a cloud database processing method provided in another exemplary embodiment of this application;

[0047] Figure 5 This is a flowchart illustrating a method for processing read-only instances by an edge device according to an exemplary embodiment of this application.

[0048] Figure 6 This is a schematic diagram of the structure of a cloud database processing apparatus provided in accordance with an exemplary embodiment of this application;

[0049] Figure 7 This is a schematic diagram of the structure of an edge device provided according to an embodiment of this application.

[0050] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0051] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0052] With the development of the computing industry, the ubiquitous computing model combining cloud, edge, and device has begun to emerge. Edge computing and cloud computing work together to provide customers with fast and secure cloud computing services and data storage.

[0053] Figure 1 This is a cloud-edge-device system architecture diagram provided in this application according to an exemplary embodiment, such as... Figure 1 As shown, the cloud-edge-device system includes a terminal device 10, an edge device 20, and a cloud center server 30.

[0054] Terminal device 10 is used to sense information about its environment and to interact with the user using terminal device 10.

[0055] Edge device 20 is communicatively connected to terminal device 10 and is used to provide corresponding services to terminal device 10 when it is close to terminal device 10 and when a target service is requested.

[0056] The cloud center server 30 and the edge device 20 are connected and can provide services in a containerized form using Kubernetes (hereinafter referred to as k8s) software. The cloud database instance resources can be allocated on demand through the resource isolation of containers.

[0057] The cloud center server 30 is equipped with a master instance (RDS-master) 301 and a slave instance (RDS-slave) 302. The master instance 301 can read and modify the corresponding database data, while the slave instance 302 can only read the corresponding database data.

[0058] The cloud center server 30 creates application pods in a containerized form based on Kubernetes software. When the terminal is close to the edge device, the application pod 201 that meets the conditions (high real-time requirements) is scheduled to the edge device to provide the corresponding services to the terminal.

[0059] During the service provision process, when application pod 201 accesses the cloud database service (PAAS layer service) deployed on cloud center server 30, it needs to interact with the instance deployed on cloud center server 30 to perform corresponding data processing. This service call process increases network latency and reduces the efficiency of terminal device 10 in obtaining information related to cloud database data.

[0060] To address this issue, engineers proposed a system for evaluating code based on the programmer's level. This system automatically reviews code for style and vulnerabilities, categorizes code quality by the programmer's identity, and assigns appropriate reviewers based on the categorization. However, code review involves many factors and cannot rely on a single influencing factor, leading to overly broad code categorization. Furthermore, the system fails to prioritize code reviews based on their importance, resulting in low efficiency.

[0061] To address the aforementioned issues, this application provides a cloud database processing method, apparatus, edge device, and storage medium. It aims to solve the technical problem that network latency caused by application pods located on edge devices accessing cloud database services reduces the efficiency of terminals obtaining information related to cloud database data. The technical concept of this application is that the edge device stores a read-only instance of the cloud central server locally. When an application pod deployed on the edge device uses the cloud database service, it directly retrieves the corresponding data from the local read-only instance. This reduces interaction with the cloud central server, saves network latency for the edge device accessing the cloud database on the cloud central server, and thus improves the efficiency of terminals obtaining information related to cloud database data.

[0062] The cloud database processing method provided in this application can be applied to scenarios such as... Figure 2 As shown, the application scenario includes: terminal device 10, edge device 20, and cloud center server 30.

[0063] Terminal device 10 and edge device 20 are connected in communication, and edge device 20 and cloud center server 30 are connected in communication.

[0064] Application pod 201, cloud database middleware 202, and database read-only instance 203 are deployed in edge device 20. Master instance 301 and slave instance 302 are deployed in cloud center server 30. Database read-only instance 203 is synchronized with slave instance 302.

[0065] When terminal device 10 uses an application service, it sends a corresponding service request to edge device 20. Cloud center server 30 schedules application pod 201 that can provide the service to edge device 10. When application pod 201 needs to call cloud database service during the service process, it generates a cloud database processing request and sends the request to cloud database middleware 202.

[0066] The cloud database middleware 202 parses the request. If the operation type included in the request is a database read operation, it forwards the request to a locally stored read-only database instance 203. The read-only database instance 203 responds to the request, reads the corresponding data from the corresponding database, and returns the data to the cloud database middleware 202. The cloud database middleware 202 then transmits the obtained data to the application pod 201, enabling the application pod 201 to process the data and feed the processing result back to the terminal device 20, thus completing the provision of the current service. Since the database data reading process is performed internally on the edge device 20 without interaction with the cloud center server 30, it saves network latency associated with information transmission between the edge device 20 and the cloud center server 30, shortening the cloud center's response time for service requests from the edge device.

[0067] If the operation type included in the request is a database modification operation, including deletion, addition, and replacement, the cloud database middleware forwards the request to the cloud center server 30. The primary instance 301 in the cloud center server 30 responds to the request, adjusts the corresponding data, and feeds back the adjustment result to the cloud database middleware 202. The cloud database middleware 202 feeds back the obtained result to the application pod 201, so that the application pod 201 can transmit the modification result to the terminal device 10.

[0068] In the cloud center server 30, the slave instance 302 will synchronize according to the modifications in the master instance 301. The database read-only instance 203 in the edge device 20 obtains the data modification information from the slave instance 302 and modifies the corresponding data in the read-only instance 203 according to the modification information to achieve synchronization.

[0069] Based on the above application scenarios and in conjunction with the accompanying drawings, some embodiments of this application will be described in detail below. Where there is no conflict between the embodiments, the following embodiments and features can be combined with each other. Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.

[0070] Figure 3 This is a flowchart illustrating a cloud database processing method provided in this application according to an exemplary embodiment, such as... Figure 3 As shown, cloud database processing methods include:

[0071] S101. When the edge device receives a data processing request sent by the terminal, it obtains the device attribute information and the cloud database processing request generated by the application pod based on the data processing request.

[0072] When a terminal is near an edge device and uses a target application, it needs to call the application pod corresponding to that target application to provide services, and sends a data processing request to the edge device.

[0073] The application pod corresponding to the target application is deployed on the edge device. The application pod generates the corresponding cloud database processing request based on the data processing request.

[0074] At the same time, the cloud database middleware in the edge device obtains device attribute information, which represents the device's operating status and information.

[0075] In one embodiment, the device attribute information includes network latency between the terminal and the edge device, network latency between the edge device and the cloud center server, and storage performance of the edge device.

[0076] S102. When the device attribute information meets the device attribute conditions, the edge device parses the cloud database processing request and obtains the operation type of the cloud database processing request.

[0077] The cloud database middleware compares device attribute information with device attribute conditions. When all device attribute information meets the device attribute conditions, the edge device can parse the cloud database processing request.

[0078] More specifically, if the sum of the network latency between the terminal and the edge device and the preset latency is less than the network latency between the edge device and the cloud center server, and the storage performance of the edge device is greater than the preset storage performance, then the device attribute information meets the device attribute conditions.

[0079] When device attributes meet the device attribute conditions, it means that the edge device can shorten the response time of the cloud database processing request.

[0080] A cloud database middleware is deployed in the edge device. After the application pod generates a cloud database processing request, it transmits the cloud database processing request to the cloud database middleware.

[0081] The cloud database middleware parses the cloud database processing request and determines the operation type corresponding to the request, which includes read or modify operations.

[0082] If the operation type includes a read operation, proceed to step S103; otherwise, proceed to step S104.

[0083] S103. Edge devices use locally stored read-only instances to process cloud database processing requests, obtain the read data, and transfer the read data to the application pod.

[0084] When the cloud database processing request is a read operation, the cloud database middleware in the edge device will transfer the cloud database processing request to a read-only instance of local storage.

[0085] Among them, read-only instances are instances created from instances in the cloud center database, and these instances can only read data from the database.

[0086] The read-only instance processes the cloud database processing request to obtain the corresponding data and feeds the data back to the cloud database middleware. The cloud database middleware then transmits the obtained data to the application pod.

[0087] After obtaining the read data, the application pod processes the data. In one embodiment, the obtained data is fed back to the terminal device; in another embodiment, the data is processed to perform subsequent operations of the service, and the operation results are fed back to the terminal device to complete the response to the data processing request sent by the terminal.

[0088] Once the edge device has completed its response to the terminal, the process corresponding to this method ends.

[0089] S104. The edge device determines that the operation type is a modification operation and sends a cloud database processing request to the cloud center server.

[0090] If the cloud database middleware determines that the operation type in the cloud database processing request is a modification operation, such as deletion, addition, or replacement, and the cloud database middleware cannot process it using the local read-only instance, then it will send the cloud database processing request to the cloud center server.

[0091] S105. The cloud center server modifies the data corresponding to the primary instance based on the cloud database processing request.

[0092] The cloud center server calls the main instance to process the cloud database processing request, and performs corresponding operations on the data in the main instance according to the database processing request, including deleting, writing, or replacing data.

[0093] S106, The cloud center server sends the write results back to the edge device.

[0094] After the primary instance in step S105 completes its response to the cloud database processing request, it sends the write result back to the edge device.

[0095] More specifically, the cloud center server feeds back the write results to the cloud database middleware in the edge devices.

[0096] S107. The edge device transmits the write results to the application pod.

[0097] After the cloud database middleware in step S106 obtains the feedback result, it transmits the feedback result to the application pod. The application pod then transmits the feedback result to the terminal device in response to the terminal's data processing request.

[0098] In the above technical solution, when the edge device receives a data processing request sent by the terminal, the application pod within it generates a corresponding cloud database processing request based on the data processing request. Simultaneously, the edge device obtains its related device attribute information. When the device attribute information meets the device attribute conditions, it parses the cloud database processing request to obtain the operation type of the cloud database processing request. When the operation type includes a read operation, it uses a read-only instance stored locally to process the request, obtains the data to be read, and transmits the data to the application pod. The application pod then processes the data and feeds back the processing result to the terminal. Since the data reading process does not require interaction with the cloud center server, it saves network latency when the edge device accesses the cloud database in the cloud center server, thereby improving the efficiency of the terminal in obtaining information related to cloud database data.

[0099] Figure 4 This is a flowchart illustrating a cloud database processing method provided in this application according to another exemplary embodiment, such as... Figure 4 As shown, cloud database processing methods include:

[0100] S201. When a data processing request is received from the terminal, the edge device obtains the cloud database processing request and device attribute information sent by the application pod based on the data processing request.

[0101] This step is the same as step S101, and will not be repeated here.

[0102] S202. When the device attribute information does not meet the device attribute conditions, the edge device sends a cloud database processing request to the cloud center server.

[0103] The cloud database middleware in the edge device compares the device attribute information with the device attribute conditions. If the sum of the network latency between the terminal and the edge device and the preset latency is greater than or equal to the network latency between the edge device and the cloud center server, and / or the storage performance of the edge device is less than or equal to the preset storage performance, then the device attribute information does not meet the device attribute conditions.

[0104] When the device attribute information does not meet the device attribute conditions, the edge device responds to the cloud database processing request according to the existing processing method, that is, the cloud database middleware sends the cloud database processing request to the cloud center server.

[0105] S203. The cloud center server uses the corresponding instance to process requests to the cloud database.

[0106] When a cloud database processing request is a request to read data from the database, the cloud center server uses the instance to process the cloud database processing request, and after processing is completed, it enters step S204 to feed back the obtained data to the cloud database middleware in the edge device.

[0107] When a cloud database processing request is a request to modify data in the database, the cloud center server uses the primary instance to process the cloud database processing request, and after processing is completed, it proceeds to step S204, and feeds back the result of whether the processing was successful to the cloud database middleware in the edge device.

[0108] S204. The cloud center server sends the processing results of the instance back to the edge device.

[0109] S205. The edge device feeds back the processing results to the terminal.

[0110] In the above technical solution, when the device attribute information does not meet the device attribute conditions, it means that it is not advisable for the edge device to use the local read-only instance to respond to the cloud database processing request to improve the efficiency of the terminal to obtain information related to the cloud database data. In this case, the cloud center server is still used to process the cloud database processing request, which saves the process of creating and maintaining the read-only instance in the edge device and saves the operating cost of the edge device.

[0111] The following example illustrates the creation and maintenance process of read-only instances in an edge device.

[0112] Figure 5 This is a flowchart illustrating a method for processing read-only instances using an edge device according to an exemplary embodiment of this application. Figure 5 As shown, the method includes:

[0113] S301. If the operation type includes a read operation and no read-only instance is stored locally, create the corresponding read-only instance locally according to the cloud database processing request.

[0114] More specifically, based on the cloud database processing request and the slave instance in the cloud center server, a local instance is created, which can only perform read operations on the database data.

[0115] S302. Use the read-only instance stored locally to process cloud database processing requests, obtain the read data, and send the read data to the application pod.

[0116] This step is the same as step S103, and will not be repeated here.

[0117] S303. Obtain the data changes in the database of the cloud center server at preset time intervals, and update the read-only instance according to the data changes.

[0118] To ensure the authenticity of read-only instances, binlog logs are retrieved from the database in the cloud center server at preset time intervals. The data changes in the database in the cloud center server are obtained based on the binlog logs, and the read-only instances are updated according to the binlogs to achieve synchronization between the read-only instances and the instances in the cloud center server.

[0119] In addition, if the cloud center server fails, the cloud database middleware in each edge device negotiates and selects an edge with the best network routing, promotes the read-only database in the selected edge to the master database, and makes the databases in other edge devices read-only databases, and synchronizes binlog logs for the slave databases of the new master database.

[0120] In the above technical solution, the edge device obtains the data changes of the database in the cloud center server at preset time intervals, and updates the read-only instance stored locally on the edge device according to the data changes to achieve synchronization with the database in the cloud center server, ensuring the accuracy of the data corresponding to the read-only instance in the edge device. When the cloud center server fails, the instances stored in multiple edge devices can be used as backup instances of the cloud center server. Each edge device selects the instance in the edge device with the shortest response latency as the primary instance through negotiation to rebuild the database, ensuring that there is no unavailability when the terminal obtains data from the database.

[0121] Figure 6 This is a schematic diagram of the structure of a cloud database processing device 400 according to an embodiment of the present application. The cloud database processing device 400 includes an acquisition module 401 and a processing module 402, wherein...

[0122] The acquisition module 401 is used to acquire data processing requests sent by the terminal.

[0123] The processing module 402 is used to obtain device attribute information and cloud database processing requests generated by the application pod based on the data processing request when a data processing request is received from the terminal.

[0124] The processing module 402 is also used to parse the cloud database processing request and obtain the operation type of the cloud database processing request when the device attribute information meets the device attribute conditions; the operation type includes read operation or modify operation.

[0125] The processing module 402 is also used to process cloud database processing requests using a locally stored read-only instance if the operation type includes a read operation, obtain the read data, and transfer the read data to the application pod.

[0126] The processing module 402 is also used to send a cloud database processing request to the cloud center server if the operation type includes a modification operation, and transmit the modification result fed back by the cloud center server to the application pod; the cloud database processing request containing the modification operation is used to enable the cloud center server to modify the data corresponding to the main instance according to the cloud database processing request, and to feed back the modification result to the cloud database middleware after the modification is completed.

[0127] In one embodiment, the processing module 402 is specifically used for:

[0128] Compare device attribute information with device attribute conditions;

[0129] If the sum of the network latency between the terminal and the edge device and the preset latency is less than the network latency between the edge device and the cloud center server, and the storage performance of the edge device is greater than the preset storage performance, then the device attribute information meets the device attribute conditions.

[0130] If the sum of the network latency between the terminal and the edge device and the preset latency is greater than or equal to the network latency between the edge device and the cloud center server, and / or the storage performance of the edge device is less than or equal to the preset storage performance, then the device attribute information does not meet the device attribute conditions.

[0131] The device attribute information includes network latency between the terminal and the edge device, network latency between the edge device and the cloud center server, and storage performance of the edge device.

[0132] In one embodiment, the processing module 402 is further configured to:

[0133] If the device attribute information does not meet the device attribute conditions, the cloud database processing request will be sent to the cloud center server, and the processing result returned by the cloud center server will be returned to the terminal; the cloud database processing request includes read operations or modification operations;

[0134] The cloud database processing request enables the cloud center server to operate on the request using the corresponding instance and feed the processing result back to the edge device.

[0135] In one embodiment, the processing module 402 is further configured to:

[0136] The system retrieves data changes from the database in the cloud center server at preset time intervals and updates the read-only instance based on these changes.

[0137] In one embodiment, the processing module 402 is specifically used for:

[0138] Retrieve binlog logs from the database in the cloud center server at preset time intervals;

[0139] Obtain the data changes in the database of the cloud center server based on the binlog logs.

[0140] In one embodiment, the processing module 402 is further configured to:

[0141] If a read-only instance is not stored locally, the corresponding read-only instance will be created locally based on the cloud database processing request.

[0142] In one embodiment, the processing module 402 is further configured to:

[0143] If the cloud center server fails, obtain the response latency of multiple edge devices connected to the cloud center server;

[0144] The instance in the edge device with the shortest response latency is determined as the primary instance;

[0145] Identify instances in other edge devices as slave instances.

[0146] Figure 7 This is a schematic diagram of the structure of an edge device according to an embodiment of this application. The edge device 500 includes a memory 501 and a processor 502. The memory 501 stores computer instructions executable by the processor. The memory 501 may include high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk drive, or a USB flash drive, external hard drive, read-only memory, disk, or optical disc, etc.

[0147] When executing computer instructions, processor 502 implements the various steps in the cloud database processing method with an edge device as the execution entity in the above embodiments. For details, please refer to the relevant descriptions in the foregoing method embodiments. The processor 502 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.

[0148] Optionally, the memory 501 can be either independent or integrated with the processor 502. When the memory 501 is configured independently, the edge device 500 also includes a bus for connecting the memory 501 and the processor 502. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be categorized as an address bus, data bus, control bus, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0149] This application also provides a computer-readable storage medium storing computer instructions. When a processor executes the computer instructions, it implements the various steps of the cloud database processing method described above.

[0150] This application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the various steps in the cloud database processing method described above.

[0151] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0152] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A cloud database processing method, characterized in that, The method is applied to an edge device, the edge device including an application pod, and the method includes: When a data processing request is received from a terminal, device attribute information and a cloud database processing request generated by the application pod based on the data processing request are obtained. When the device attribute information meets the device attribute conditions, the cloud database processing request is parsed to obtain the operation type of the cloud database processing request; the operation type includes a read operation or a modify operation. If the operation type includes the read operation, the cloud database processing request is processed using a read-only instance stored locally to obtain the read data, and the read data is transferred to the application pod. If the operation type includes the modification operation, the cloud database processing request is sent to the cloud center server, and the modification result fed back by the cloud center server is transmitted to the application pod; the cloud database processing request containing the modification operation is used to enable the cloud center server to modify the data corresponding to the main instance according to the cloud database processing request, and after the modification is completed, to feed back the modification result to the edge device.

2. The method according to claim 1, characterized in that, The device attribute information includes the network latency between the terminal and the edge device, the network latency between the edge device and the cloud center server, and the storage performance of the edge device; Before parsing the cloud database processing request and obtaining the operation type of the cloud database processing request when the device attribute information meets the device attribute conditions, the method further includes: Compare the device attribute information with the device attribute conditions; If the sum of the network latency between the terminal and the edge device and the preset latency is less than the network latency between the edge device and the cloud center server, and the storage performance of the edge device is greater than the preset storage performance, then the device attribute information satisfies the device attribute condition. If the sum of the network latency between the terminal and the edge device and the preset latency is greater than or equal to the network latency between the edge device and the cloud center server, and / or the storage performance of the edge device is less than or equal to the preset storage performance, then the device attribute information does not meet the device attribute conditions.

3. The method according to claim 2, characterized in that, The method further includes: If the device attribute information does not meet the device attribute conditions, the cloud database processing request is sent to the cloud center server, and the processing result fed back by the cloud center server is fed back to the terminal; the cloud database processing request includes a read operation or a modify operation; The cloud database processing request is used to enable the cloud center server to operate on the request using the corresponding instance and to feed back the processing result to the edge device.

4. The method according to claim 1, characterized in that, The method further includes: The data changes in the database of the cloud center server are obtained at preset time intervals, and the read-only instance is updated according to the data changes.

5. The method according to claim 4, characterized in that, The data changes in the database of the cloud center server are obtained at preset time intervals, specifically including: Binlog logs are retrieved from the database in the cloud center server at preset time intervals. The data changes in the database of the cloud center server are obtained based on the binlog logs.

6. The method according to claim 1, characterized in that, Before processing the cloud database processing request using a locally stored read-only instance, the method further includes: If the read-only instance is not stored locally, a corresponding read-only instance will be created locally according to the cloud database processing request.

7. The method according to claim 1, characterized in that, The method further includes: If the cloud center server fails, obtain the response latency of multiple edge devices connected to the cloud center server; The database in the edge device with the shortest response latency is designated as the primary database.

8. A cloud database processing device, characterized in that, include: The acquisition module is used to obtain data processing requests sent by the terminal; The processing module is used to obtain device attribute information and cloud database processing requests generated by the application pod based on the data processing request when a data processing request is received from the terminal. The processing module is also used to parse the cloud database processing request and obtain the operation type of the cloud database processing request when the device attribute information meets the device attribute conditions; the operation type includes a read operation or a modify operation. The processing module is further configured to, if the operation type includes the read operation, process the cloud database processing request using a locally stored read-only instance, obtain the read data, and transfer the read data to the application pod; The processing module is further configured to, if the operation type includes the modification operation, send the cloud database processing request to the cloud center server and transmit the modification result fed back by the cloud center server to the application pod; the cloud database processing request containing the modification operation is used to enable the cloud center server to modify the data corresponding to the main instance according to the cloud database processing request, and after the modification is completed, to feed back the modification result to the cloud database middleware.

9. An edge device, characterized in that, include: A processor and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor, when executing the computer execution instructions, is used to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, are used to implement the method as described in any one of claims 1 to 7.