Distributed database processing method, apparatus, device, medium, and product
By setting up a batch processing device in the distributed database to receive and respond to job stop commands, control the database to store data and stop batch processing tasks, the problems of task loss and low start-up and stop efficiency when there are many databases are solved, and efficient database control and data security are achieved.
Patent Information
- Application Number
- CN202310184265.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2043-02-28
AI Technical Summary
In distributed databases, when there are a large number of databases, there are problems such as task loss and low efficiency in starting and stopping databases.
By setting up a batch processing device in the distributed database, receiving job stop instructions from the central control device, controlling the database to store data and stop batch processing tasks, the database can be terminated in a timely manner.
It improves the control efficiency of distributed databases, ensuring data security and operational efficiency.
Smart Images

Figure CN116107722B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of big data, cloud computing and other technologies, and in particular to a distributed database processing method, apparatus, device, medium and product. Background Technology
[0002] The transformation to a distributed architecture mainly includes horizontal partitioning of databases and partitioning of application nodes. Batch processing also shifts from single-point execution to running on multiple databases. Currently, batch processing largely relies on shell scripts to periodically invoke stored procedures to handle large volumes of data.
[0003] Single-point execution refers to a program running on a single database. To improve program efficiency, distributed storage is generally used, storing the database across multiple nodes. In a distributed storage system, multiple databases can exist, allowing programs to simultaneously query data from multiple databases. Query logs, query processes, and query results from each database can be stored and / or fed back to the program.
[0004] Multiple databases can be used for batch processing tasks. If it is necessary to terminate the operation of multiple databases, the batch tasks for each database must be terminated manually. When there are a large number of databases, manually terminating the batch tasks for each database one by one is inefficient. Summary of the Invention
[0005] This application provides a distributed database processing method, apparatus, device, medium, and product to solve problems such as task loss and low database start-up and shutdown efficiency when there are a large number of databases.
[0006] On the one hand, this application provides a distributed database processing method, applied to a batch processing device corresponding to any database in a distributed database, wherein the distributed database includes multiple databases, and the method includes:
[0007] Receive the operation stop command sent by the central control equipment;
[0008] In response to a job stop command, the database storage data of the batch processing unit is controlled and the batch processing task is stopped.
[0009] If it is determined that the database has stopped working, the database stoppage result is returned.
[0010] On the other hand, this application provides a distributed database processing method, applicable to any database in a distributed database, and a database connection batch processing device, comprising:
[0011] Determine the database's storage execution module and task execution module;
[0012] The storage execution module receives data storage instructions sent by the batch execution device.
[0013] In response to data storage commands, it stores database-related data;
[0014] The task execution module receives the job termination command sent by the batch operation device.
[0015] In response to the termination command, the database batch processing process is terminated.
[0016] On the other hand, a distributed database processing device is provided, which is a batch processing device located at any database corresponding to a distributed database. The distributed database includes multiple databases, and the device includes:
[0017] The receiving unit is used to receive the operation stop command sent by the central control equipment;
[0018] The control unit is used to control the database storage data of the batch processing device and stop the batch processing task in response to the job stop command;
[0019] The return unit is used to return the result of the database stopping operation if it is determined that the database has stopped.
[0020] On the other hand, a distributed database processing device is provided, applicable to any database in a distributed database, and a database connection batch processing device is provided, including:
[0021] The determination unit is used to determine the storage execution module and task execution module of the database;
[0022] The first receiving unit is used to receive data storage instructions sent by the batch operation device through the storage execution module;
[0023] The first response unit is used to respond to data storage instructions and store data related to the database;
[0024] The second receiving unit is used to receive the job termination instruction sent by the batch operation device through the task execution module;
[0025] The second response unit is used to respond to the business termination command and terminate the database batch processing process.
[0026] On the other hand, an electronic device is provided, including: a processor, and a memory communicatively connected to the processor;
[0027] The memory stores the instructions that the computer executes;
[0028] The processor executes computer-executable instructions stored in memory to implement any one of the distributed database processing methods corresponding to the first or second aspect.
[0029] On the other hand, a computer-readable storage medium is provided, which stores computer-executable instructions, which, when executed by a processor, are used to implement any one of the distributed database processing methods corresponding to the first aspect or the second aspect.
[0030] On the other hand, a computer program product is provided, including a computer program that, when executed by a processor, implements any one of the distributed database processing methods corresponding to the first or second aspect.
[0031] The technical solution provided in this application involves setting up a batch processing device for any database within a distributed database. The distributed database can include multiple databases. The batch processing device can receive job stop commands from the central control device and, in response to these commands, control the database storage of the batch processing device and stop the batch processing tasks. By controlling the batch processing device, the central control device can control the start and stop of the batch processing tasks between databases, achieving timely termination of batch processing tasks. After the batch processing device stops the batch jobs, it can return the database's stoppage result to the central control device. By stopping the database's operation, control over the database can be achieved, improving the control efficiency of the distributed database. Attached Figure Description
[0032] 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.
[0033] Figure 1 Example diagram of an embodiment of a distributed database processing system provided in this application;
[0034] Figure 2 A flowchart illustrating one embodiment of a distributed database processing method provided in this application;
[0035] Figure 3 A flowchart illustrating yet another embodiment of a distributed database processing method provided in this application;
[0036] Figure 4 This is a schematic diagram of the structure of one embodiment of a distributed database processing device provided in this application.
[0037] Figure 5 This is a schematic diagram of another embodiment of a distributed database processing device provided in this application.
[0038] Figure 6 A block diagram of an electronic device for a distributed database processing method provided in an embodiment of this application.
[0039] 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
[0040] 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.
[0041] First, let me explain the terms used in this application:
[0042] Distributed database: refers to a large-scale database that is logically centralized and physically distributed, consisting of computers located in different locations connected to each other through a network. Computers can act as nodes, and one or more nodes can be configured as databases.
[0043] The technical solution of this application can be applied to the fields of big data, cloud computing, and other technologies, especially in the control scenarios of distributed databases. By controlling the batch processing device, the central control equipment can control the start and stop of databases, enabling the timely termination of batch processing tasks and improving database control efficiency.
[0044] In related technologies, a distributed database can include multiple databases, which are set up on nodes in a distributed computer cluster. Databases can perform batch processing tasks. Because batch processing tasks involve large amounts of data, shutting down a database requires shutting down the batch processing for each database individually. To ensure successful shutdown, the databases undergoing shutdown need to be monitored to determine if the shutdown was successful. When there are many databases, inefficient database monitoring can lead to data loss and low operational efficiency.
[0045] To address the aforementioned issues, the technical solution of this application involves setting up a batch processing device for any database within a distributed database. The distributed database can include multiple databases. The batch processing device can receive job stop commands from the central control device and, in response, control the database storage of the batch processing device and stop the batch processing tasks. By controlling the batch processing device, the central control device can control the start and stop of the batch processing tasks between databases, achieving timely termination of batch processing tasks on the databases. After the batch processing device stops the batch jobs on the databases, it can return the database's stop operation result to the central control device. By stopping the databases, automatic database stop control can be achieved, improving the control efficiency of the distributed database.
[0046] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0047] like Figure 1 The diagram shown is an example of an embodiment of a distributed database processing system provided in this application. The distributed database processing system may include: a central control device 11, multiple batch operation devices 12 connected to the central control device, and databases 13 respectively connected to the multiple batch operation devices. That is, one batch operation device can be connected to one database.
[0048] In this embodiment, the central control device 11, the batch operation device 12, and the database 13 can all be nodes in a computer cluster, or even multiple nodes. In this embodiment, the central control device, the batch operation device, and the database are used as independent devices. Of course, the central control device, the batch operation device, and the database can also be other types of devices such as computers or terminal devices. This application does not make too many restrictions on the specific types of devices for the central control device, the batch operation device, and the database.
[0049] The central control device 11 can send a work stop command to the batch operation device 12.
[0050] The batch processing unit 12 can receive a job stop command sent by the central control device 11. Then, in response to the job stop command, it can control its corresponding database 13 to store data and stop the batch processing task. If it is determined that the corresponding database 13 has stopped processing, it can send the database stop result to the central control device.
[0051] like Figure 2The diagram shown is a flowchart of one embodiment of a distributed database processing method provided in this application. This method can be applied to a batch processing device corresponding to any database in a distributed database, which includes multiple databases. The method includes:
[0052] 201: Receives the operation stop command sent by the central control equipment.
[0053] Optionally, the central control device can be a device for controlling the batch processing tasks of each database, and can be used to initiate batch stop commands and send each stop command to the corresponding batch running device of each database.
[0054] Batch execution devices can be deployed one-to-one with data and can be used to control the batch execution of databases, that is, the actual nodes that execute job stop commands.
[0055] A database can be a node used to store data and execute batch processing tasks. Batch processing tasks can refer to a large number of data processing tasks that are executed simultaneously, such as data addition, deletion, and modification. A database can include a storage execution module and a task execution module.
[0056] The storage execution module stores data generated during database processing, such as processing logs, results, and records. The task execution module executes the specific batch processing tasks, i.e., performs the actual data processing. The storage execution module and task execution module are two independent modules and cannot interact directly. Therefore, to synchronize data processing and data storage, both modules need to be synchronized to transmit stop commands and execute data storage, ensuring the termination of batch processing tasks and the secure storage of data.
[0057] Of course, in practical applications, in addition to the job stop command, the central control device can also send a job start command to the batch processing unit to initiate the batch processing of the database. Upon receiving the job start command, the batch processing unit can respond to the job stop command by controlling the database corresponding to the batch processing unit to start the batch processing task. The specific starting method can be the same as stopping the batch processing task; the difference lies in the command type. At startup, a storage start command is sent to the storage execution module, and a job start command is sent to the task execution module. These details will not be elaborated further here.
[0058] 202: In response to the job stop command, control the database storage of the batch processing device and stop the batch processing task.
[0059] Optionally, the job stop instruction may include an instruction identifier or an instruction name, and can be sent to the database. The database can store data related to the batch processing task. The database can also close the batch processing task.
[0060] 203: If it is determined that the database has stopped working, send the database stop operation result to the central control device.
[0061] Optionally, the status of database execution can be obtained by cyclically detecting whether the database has stopped working. By detecting whether the database has stopped working in real time and cyclically, the execution status of the database can be accurately obtained in a timely manner, thereby improving the execution efficiency and accuracy of the database.
[0062] Optionally, after receiving the shutdown result from the database, the central control device can confirm that the database has stopped running. The central control device can receive shutdown results from multiple databases to confirm that multiple databases have stopped running, thereby achieving the goal of controlling multiple databases simultaneously, improving the shutdown efficiency of distributed databases and ensuring the security of data storage.
[0063] In this embodiment, a batch processing device is set up for any database in the distributed database. The distributed database can include multiple databases. The batch processing device can receive a job stop command sent by the central control device. In response to the job stop command, the batch processing device controls the database storage data and stops the batch processing task. By controlling the batch processing device, the central control device can control the start and stop of the databases, thus achieving timely termination of the batch processing task for the database. After the batch processing device controls the database to stop the batch job, it can return the database stop result to the central control device. By stopping the database, the control of stopping the database can be achieved, realizing automatic stopping control of the database and improving the control efficiency of the distributed database.
[0064] As one embodiment, controlling the database storage data of the batch processing device and stopping the batch processing task includes:
[0065] Identify the storage execution module and task execution module in the database;
[0066] A data storage instruction is sent to the storage execution module, which instructs the storage execution module to store the data generated from batch processing with the database.
[0067] Send a job termination command to the task execution module. The job termination command instructs the task execution module to terminate the database batch processing task.
[0068] Optionally, the task execution module can execute batch processing tasks, which can be data processing operations performed on data in the database, such as adding, deleting, and modifying data. A batch processing task can include multiple data processing tasks.
[0069] In this embodiment, a storage execution module and a task execution module are defined in the database. The storage execution module stores data generated during batch processing tasks, while the task execution module executes these tasks. Sending a data storage instruction to the storage execution module stores the data generated during batch processing tasks, ensuring timely data storage. Sending a job termination instruction to the task execution module instructs it to terminate the batch processing tasks. Since data storage and task execution are two independent modules, controlling both the storage execution module and the task execution module allows for comprehensive and accurate database control, improving shutdown efficiency and ensuring no data loss when the database stops operating, thus enhancing data security.
[0070] As another embodiment, after sending the data storage instruction to the storage execution module, the method further includes:
[0071] Obtain the status flag of the batch processing execution status in the database. The status flag is switched to the stop status flag when the database task execution module detects a job termination instruction.
[0072] If the status flag is determined to be a stopped status flag, then check whether the task execution module meets the termination conditions;
[0073] If the task execution module meets the termination conditions, it determines that the database job should be stopped.
[0074] Status flags can be used to express the batch processing execution status of database batch processing tasks, and can include stop status flags or execution status flags. Termination conditions can be the target for determining whether the task execution module has terminated data processing. When the task execution module meets the termination conditions, it can be determined that the database job has stopped.
[0075] If the status indicator is determined to be an execution status indicator, it can be directly determined that the database operation has not stopped. The execution status indicator allows for quick confirmation that the database operation has not stopped, and the database's running status can be further monitored.
[0076] Optionally, whether the task execution module meets the termination conditions can be obtained from database feedback or determined in real time.
[0077] The process of detecting whether the task execution module meets the termination conditions includes: determining whether feedback information from the server indicating that the task execution module meets the termination conditions is received; if yes, the task execution module meets the termination conditions; otherwise, the task execution module does not meet the termination conditions.
[0078] In this embodiment, a status identifier for the batch processing execution status of the database can be obtained. This status identifier is switched to a stop status identifier when the database task execution module detects a job termination instruction. When the status identifier meets the stop status identifier, it can be detected whether the task execution module meets the termination condition. When the task execution module meets the termination condition, it can be determined that the database job has stopped. By using the stop status identifier, the batch processing tasks of the database can be updated in a timely manner, clearly indicating the database job running status. However, the batch processing tasks of the database may not stop in a timely manner. Therefore, by detecting the termination condition of the task execution module, substantial monitoring of the database job status can be achieved, improving the accuracy of database shutdown detection.
[0079] As another embodiment, detecting whether the task execution module meets the termination condition includes:
[0080] Check whether the task execution module should continue data processing.
[0081] If so, it is determined that the task execution module does not meet the termination condition, and the process returns to the step of checking whether the task execution module should continue to execute data processing;
[0082] If not, then the task execution module is determined to meet the termination conditions.
[0083] In this embodiment, when detecting whether the task execution module meets the termination condition, it can be determined by whether the task execution module is performing data processing. If so, it can be determined that the task execution module does not meet the termination condition and is still continuing to perform data processing. In this case, the process can return to the step of detecting whether the task execution module is performing data processing, thereby achieving continuous detection of the task execution module and ensuring that the task execution module finally meets the termination condition. By detecting whether the task execution module continues to perform data processing, the working status of the task execution module can be accurately detected, improving detection efficiency and accuracy.
[0084] Further, optionally, the detection task execution module is checked to determine whether to continue data processing, including:
[0085] Determine the task running status of each of the multiple data processing tasks corresponding to the batch processing task;
[0086] If it is determined that the running status of multiple data processing tasks is terminated, then it is determined that the task execution module has not continued to perform data processing.
[0087] If it is determined that at least one of the multiple data processing tasks is in a running state, then the task execution module will continue to perform data processing.
[0088] It can receive the task execution status of multiple data processing tasks from the database task execution module.
[0089] A data processing task can be a specific process within the task execution module that implements data processing. The running status of the corresponding data processing task can be determined by monitoring its process status. If the data processing task process has not been closed (unkilled), the task's running status is determined to be running. If the data processing task process has been closed (killed), the task's running status is determined to be terminated.
[0090] In this embodiment, the task execution status of multiple data processing tasks corresponding to a batch processing task can be determined, and the task execution module's decision to continue data processing is based on the individual task execution statuses of these tasks. Specifically, if the task execution status of multiple data processing tasks is "terminated," it is determined that the task execution module has not performed data processing; if at least one data processing task is "running," it is determined that the task execution module continues to perform data processing. By acquiring the task execution status of more granular data processing tasks, more detailed task execution status detection can be performed on batch processing tasks, achieving efficient and accurate database execution status detection.
[0091] like Figure 3 The diagram shown is a flowchart of another embodiment of a distributed database processing method provided in this application. This distributed database processing method can be applied to any database in a distributed database. The database connection batch processing device includes:
[0092] 310: Determine the database's storage execution module and task execution module.
[0093] 302: Receive data storage instructions sent by the batch execution device through the storage execution module.
[0094] 303: In response to a data storage command, the database stores the data generated by performing a batch processing task.
[0095] 304: The task execution module receives the job termination command sent by the batch operation device.
[0096] 305: In response to the job termination command, the database batch processing task is closed.
[0097] The relevant descriptions of some contents in this embodiment can be referred to the contents recorded in the foregoing embodiments, and will not be repeated here.
[0098] In this embodiment, a database storage execution module and a task execution module are defined. The storage execution module receives data storage instructions from its corresponding batch processing device, and the task execution module receives job termination instructions from the corresponding batch processing device. Data storage instructions execute the database to process data generated by batch processing tasks, and job termination instructions close the database batch processing tasks. Data storage and task execution are two distinct and independent modules within the database. By sending data storage instructions to the data storage execution module and job termination instructions to the job execution module to close the tasks, the batch processing device can control the database from both data storage and job termination perspectives, improving the efficiency and accuracy of database closure.
[0099] As one example, disabling database batch processing tasks includes:
[0100] Switch the status flag of the batch processing execution status to the stop status flag, and feed back the status flag to the batch operation device;
[0101] The batch processing task can be shut down using the process shutdown command.
[0102] Optionally, before executing the batch processing task to close the database, the batch processing execution status is indicated by the execution status flag. The execution status flag can instruct the database to continue executing the batch processing task.
[0103] The relevant descriptions of some contents in this embodiment can be referred to the contents recorded in the foregoing embodiments, and will not be repeated here.
[0104] In this embodiment, the status flag of the batch processing execution state can be switched to a stop status flag, and the status flag is fed back to the batch execution device. The status flag enables rapid message flow of the batch processing execution status between the database and the batch execution device. Then, a process shutdown command can be executed to close the batch processing task. The process shutdown command can automatically close the batch processing task. Closing the batch processing task is achieved through both switching the batch processing execution status flag and controlling the actual batch processing task, ensuring timely feedback of the shutdown status and the substantial closure of the batch processing task, thus improving the accuracy and efficiency of batch processing task closure.
[0105] As yet another embodiment, it also includes:
[0106] If the batch processing task has finished executing, then the task execution module is deemed to have met the termination conditions.
[0107] The task execution module sends a feedback message to the batch execution device that the termination conditions have been met. The batch execution device then determines that the database operation should stop when the status flag is in the stagnant state and the task execution module meets the termination conditions.
[0108] In this embodiment, the database can detect batch processing tasks. When a batch processing task is closed, it can be determined that the task execution module meets the termination condition. At this time, feedback that the task execution module meets the termination condition can be sent to the batch execution device, so that the batch execution device can determine that the database operation has stopped when the status flag is a stop status flag and the task execution module meets the termination condition. By expressing the database's operation status through both the status flag and whether the task execution module meets the termination condition, it is possible to ensure timely and accurate detection of database shutdown, thereby improving the timeliness of database shutdown detection.
[0109] As yet another embodiment, it also includes:
[0110] The task execution module determines the task running status of each of the multiple data processing tasks corresponding to the batch processing task.
[0111] The task running status of each of the multiple data processing tasks is sent to the batch execution device corresponding to the database, so that the batch execution device can determine whether the task execution module should continue to execute data processing based on the task running status of each of the multiple data processing tasks.
[0112] The relevant descriptions of some contents in this embodiment can be referred to the contents recorded in the foregoing embodiments, and will not be repeated here.
[0113] In this embodiment, the task execution status of multiple data processing tasks corresponding to a batch processing task can be sent to the batch processing device. The batch processing device determines whether the task execution module should continue data processing based on the task execution status of each data processing task. If the task execution status of multiple data processing tasks is "terminated," it is determined that the task execution module has not performed data processing. If the task execution status of at least one data processing task is "running," it is determined that the task execution module continues data processing. By acquiring the task execution status of more granular data processing tasks, more detailed task execution status detection can be performed on the batch processing task, achieving efficient and accurate database execution status detection.
[0114] like Figure 4The diagram shown is a structural schematic of one embodiment of a distributed data processing device provided in this application. This distributed processing device can be located in a batch processing device corresponding to any database within a distributed database. The distributed database includes multiple databases, and the distributed database processing device 400 may include:
[0115] Receiving unit 401: Used to receive the operation stop command sent by the central control equipment;
[0116] Control unit 402: In response to a job stop command, control the database corresponding to the batch processing device to store data and stop the batch processing task;
[0117] Return unit 403: Used to send the database stop operation result to the central control device if it is determined that the database has stopped operating.
[0118] As one embodiment, the control unit 402 includes:
[0119] The determination module is used to determine the storage execution module and task execution module in the database;
[0120] The first sending module is used to send a data storage instruction to the storage execution module, which instructs the storage execution module to store the data generated by the database in performing batch processing tasks.
[0121] The second sending module is used to send a job termination instruction to the task execution module. The job termination instruction instructs the task execution module to terminate the database batch processing task.
[0122] As yet another embodiment, it also includes:
[0123] The identifier acquisition unit is used to acquire the status identifier of the batch processing execution status of the database. The status identifier is switched to the stop status identifier when the database task execution module detects the job termination instruction.
[0124] The condition detection unit is used to detect whether the task execution module meets the termination condition if the status flag is determined to be a stop status flag.
[0125] The job stop unit is used to determine whether the database job should be stopped if the task execution module meets the termination conditions.
[0126] As another embodiment, the condition detection unit includes:
[0127] The data processing submodule is used to detect whether the task execution module should continue data processing.
[0128] The first processing submodule is used to determine if the task execution module does not meet the termination condition and return to the step of checking whether the task execution module should continue to execute data processing.
[0129] The second processing submodule is used to determine whether the task execution module meets the termination condition if not.
[0130] As yet another embodiment, the data processing submodule is specifically used for:
[0131] Determine the running status of each of the multiple data processing tasks corresponding to the batch processing task; if it is determined that the running status of each of the multiple data processing tasks is terminated, then it is determined that the task execution module has not continued to execute data processing; if it is determined that at least one of the multiple data processing tasks is running, then it is determined that the task execution module continues to execute data processing.
[0132] like Figure 5 The diagram shown is a structural schematic of one embodiment of a distributed database processing device provided in this application. This distributed processing device can be located in any database within the distributed database. The database connection batch processing device 500 includes:
[0133] Unit 501: Used to determine the storage execution module and task execution module of the database.
[0134] First receiving unit 502: Used to receive data storage instructions sent by the batch operation device through the storage execution module.
[0135] First response unit 503: Used to respond to data storage instructions and store data generated by the database executing batch processing tasks.
[0136] The second receiving unit 504 is used to receive the job termination instruction sent by the batch operation device through the task execution module.
[0137] Second response unit 505: Used to close the database batch processing task in response to the job termination command.
[0138] As one embodiment, the second response unit includes:
[0139] The identifier update module is used to switch the status identifier of the batch processing execution status to the stop status identifier and feed back the status identifier to the batch running device;
[0140] The command shutdown module is used to shut down commands through processes, thus stopping batch processing tasks.
[0141] As yet another embodiment, it also includes:
[0142] The task detection unit is used to detect when a batch processing task is closed, thus determining that the task execution module meets the termination conditions.
[0143] The condition feedback unit is used to report that the task execution module has met the termination conditions to the batch operation device, so that the batch operation device can determine that the database operation is stopped when the status flag is a stop status flag and the task execution module has met the termination conditions.
[0144] Figure 6 This is a block diagram illustrating an electronic device according to an exemplary embodiment. The device can be any of the aforementioned central control device, batch operation device, and database. Specifically, it can be a computer, terminal device, tablet device, personal digital assistant, etc. In this embodiment, the specific type of electronic device is not limited in too much.
[0145] The device 600 may include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.
[0146] Processing component 602 typically controls the overall operation of device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.
[0147] Memory 604 is configured to store various types of data to support the operation of device 600. Examples of such data include instructions for any application or method operating on device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0148] Power supply component 606 provides power to the various components of device 600. Power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 600.
[0149] Multimedia component 608 includes a screen that provides an output interface between device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When device 600 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0150] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616. In some embodiments, audio component 610 also includes a speaker for outputting audio signals.
[0151] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0152] Sensor assembly 614 includes one or more sensors for providing status acquisition of various aspects of device 600. For example, sensor assembly 614 may detect the on / off state of device 600, the relative positioning of components such as the display and keypad of device 600, changes in the position of device 600 or a component of device 600, the presence or absence of user contact with device 600, the orientation or acceleration / deceleration of device 600, and temperature changes of device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0153] Communication component 616 is configured to facilitate wired or wireless communication between device 600 and other devices. Device 600 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0154] In an exemplary embodiment, the apparatus 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0155] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, which can be executed by a processor 620 of the device 600 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0156] This application also provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0157] The memory stores the instructions that the computer executes;
[0158] The processor executes computer-executable instructions stored in memory to implement any of the above-mentioned distributed database processing methods.
[0159] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement any of the above-described distributed database processing methods.
[0160] This application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the above-described distributed database processing methods.
[0161] 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.
[0162] 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 distributed database processing method, characterized in that, A batch processing device applied to any database in a distributed database, wherein the distributed database includes multiple databases, the method comprising: Receive the operation stop command sent by the central control equipment; In response to the job stop command, the database corresponding to the batch processing device is controlled to store data and the batch processing task is stopped. If it is determined that the database has stopped operating, the database's shutdown result is sent to the central control device; The control of the batch processing device to store database data and stop batch processing tasks includes: The storage execution module and the task execution module in the database are identified; wherein the storage execution module and the task execution module cannot interact directly. A data storage instruction is sent to the storage execution module, which instructs the storage execution module to store the data generated by the database during the batch processing task. A job termination instruction is sent to the task execution module, which instructs the task execution module to terminate the database execution of the batch processing task.
2. The method according to claim 1, characterized in that, After sending the data storage instruction to the storage execution module, the method further includes: Obtain the status identifier of the batch processing execution status of the database. The status identifier is switched to a stop status identifier when the task execution module of the database detects the job termination instruction. If the status identifier is determined to be a stop status identifier, then check whether the task execution module meets the termination condition; If the task execution module meets the termination conditions, it determines that the database operation should be stopped.
3. The method according to claim 2, characterized in that, The step of detecting whether the task execution module meets the termination condition includes: Detect whether the task execution module should continue data processing; If so, it is determined that the task execution module does not meet the termination condition, and the process returns to the step of detecting whether the task execution module should continue to perform data processing; If not, then the task execution module is determined to meet the termination condition.
4. The method according to claim 3, characterized in that, The step of detecting whether the task execution module should continue data processing includes: Determine the task running status of each of the multiple data processing tasks corresponding to the batch processing task; If it is determined that the running status of each of the multiple data processing tasks is terminated, then it is determined that the task execution module has not continued to perform data processing. If it is determined that at least one of the multiple data processing tasks is in a running state, then the task execution module is determined to continue executing data processing.
5. A distributed database processing method, characterized in that, Applicable to any database in a distributed database, the database connection batch execution device includes: The storage execution module and task execution module of the database are determined; wherein the storage execution module and task execution module cannot interact directly with each other; The storage execution module receives a data storage instruction sent by the batch processing device; the data storage instruction instructs the storage execution module to store the data generated by the database during the batch processing task. In response to the data storage instruction, the data generated by the database in executing the batch processing task is stored; The task execution module receives a job termination instruction sent by the batch processing device; the job termination instruction instructs the task execution module to terminate the database execution of the batch processing task; In response to the job termination command, the database batch processing task is closed.
6. The method according to claim 5, characterized in that, The step of closing the database batch processing task includes: The status flag of the batch processing execution status is switched to the stop status flag, and the status flag is fed back to the batch running device; The batch processing task can be shut down using the process shutdown command.
7. The method according to claim 6, characterized in that, Also includes: If the batch processing task is detected to be closed, it is determined that the task execution module meets the termination condition; The task execution module is fed back to the batch execution device when it meets the termination condition, so that the batch execution device can determine that the database operation is stopped when the status identifier is a stop status identifier and the task execution module meets the termination condition.
8. The method according to any one of claims 5-7, characterized in that, Also includes: The task execution module determines the task running status of each of the multiple data processing tasks corresponding to the batch processing task. The task execution status of each of the multiple data processing tasks is sent to the batch execution device corresponding to the database, so that the batch execution device can determine whether the task execution module should continue to execute data processing based on the task execution status of each of the multiple data processing tasks.
9. A distributed database processing device, characterized in that, A batch execution device located in any database within a distributed database, wherein the distributed database includes multiple databases, and the device includes: The receiving unit is used to receive the operation stop command sent by the central control equipment; The control unit is used to control the database corresponding to the batch processing device to store data and stop the batch processing task in response to the job stop command; The return unit is used to send the database shutdown result to the central control device if it is determined that the database has stopped operating; The control unit includes: A determination module is used to determine the storage execution module and the task execution module in the database; wherein the storage execution module and the task execution module cannot interact directly. The first sending module is used to send a data storage instruction to the storage execution module, wherein the data storage instruction instructs the storage execution module to store the data generated by the database in executing the batch processing task; The second sending module is used to send a job termination instruction to the task execution module, wherein the job termination instruction instructs the task execution module to terminate the database execution of the batch processing task.
10. A distributed database processing device, characterized in that, Located in any database within a distributed database, the database is connected to a batch processing device, comprising: A determining unit is used to determine the storage execution module and the task execution module of the database; wherein the storage execution module and the task execution module cannot interact directly. The first receiving unit is configured to receive a data storage instruction sent by the batch processing device through the storage execution module; the data storage instruction instructs the storage execution module to store the data generated by the database performing batch processing tasks; The first response unit is configured to respond to the data storage instruction and store the data generated by the database executing the batch processing task. The second receiving unit is configured to receive a job termination instruction sent by the batch processing device through the task execution module; the job termination instruction instructs the task execution module to terminate the database execution of the batch processing task; The second response unit is used to close the database batch processing task in response to the job termination instruction.
11. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement any one of the distributed database processing methods as described in claims 1-4 or 5-8.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement any one of the distributed database processing methods as described in claims 1-4 or 5-8.
13. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements any one of the distributed database processing methods described in claims 1-4 or 5-8.
Citation Information
Patent Citations
Graph data storage method, device and equipment and storage medium
CN111090782A
Batch service shutdown method and device
CN113448711A
Distributed task scheduling method and device in cluster mode, equipment and storage medium
CN115033375A