Real-time database measurement point deletion and recovery method, system, storage medium and server
By introducing a point deletion and recycling mechanism in real-time database, the problem of error deletion is solved, the fault tolerance and security of data processing are improved, and the integrity of data is ensured.
Patent Information
- Application Number
- CN202111189067.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-12
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2041-10-12
AI Technical Summary
The existing real-time database has the risk of error deletion in the test point deletion operation, resulting in the loss of important information and affecting production and economy.
The recycling mechanism is introduced in the measurement point deletion operation, and the data integrity is ensured by backing up the deleted measurement point information to the recycling bin and synchronizing it before deletion.
It effectively prevents users from accidentally deleting detect points, improves the fault tolerance of real-time databases and the security of data processing, and ensures data integrity.
Smart Images

Figure CN113961393B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data processing, and particularly relates to a method, system, storage medium and server for deleting and recycling measurement points in a real-time database. Background Art
[0002] Most real-time databases are oriented to fields such as industrial production and monitoring. With the continuous expansion of the production scale of enterprise factories, the amount of data carried by real-time databases is also increasing continuously, and the scale of measurement points ranges from tens of thousands to hundreds of thousands or even reaches the million level. The measurement point information also needs to be maintained for a long time with the upgrade and change of production equipment. Especially at the beginning of the establishment of the production scale, there are often a large number of measurement point addition, modification and deletion operations. Especially the measurement point deletion operation, different from new creation and modification, the measurement point deletion operation is often accompanied by the risk of data loss. In the prior art, generally there will be a prompt before the deletion operation takes effect. After confirmation, the real-time database will clear the information and data of the deleted measurement points, and synchronize the information at the disk level, and this operation is irreversible.
[0003] Under the huge amount of measurement point information and high measurement point update frequency, batch deletion operations often still have the phenomenon of accidental deletion, there are certain hidden dangers, and sometimes the loss of important information may bring certain production and economic losses. Summary of the Invention
[0004] The purpose of the present invention is to provide a method, system, storage medium and server for deleting and recycling measurement points in a real-time database for the above problems in the prior art. By adding a recycling mechanism to the measurement point deletion operation, it can prevent users from accidentally deleting measurement points, improve the fault tolerance of real-time database data processing, and ensure the integrity of data.
[0005] In order to achieve the above purpose, the present invention has the following technical solutions:
[0006] In the first aspect, an embodiment of the present invention provides a method for deleting and recycling measurement points in a real-time database, including the following steps:
[0007] Send a measurement point deletion request and the measurement point data to be deleted from the client to the network service;
[0008] After receiving the measurement point deletion request and the measurement point data to be deleted, the network service forwards them to the measurement point service;
[0009] The measurement point service performs deletion operation processing to find the information of the deleted measurement point; if the information of the deleted measurement point can be found, back up the information of the deleted measurement point to the recycle bin, if not, return that the deleted measurement point does not exist and stop the deletion operation;
[0010] After backing up the information of the measurement point to be deleted to the recycle bin, the measurement point service returns the information indicating successful deletion of the measurement point, synchronizes the recycle bin information to the storage device, updates the information in the recycle bin to the storage file, and notifies other services to delete the measurement point;
[0011] After receiving the information indicating successful or failed deletion of the measurement point, the network service returns it to the client.
[0012] As a preferred solution of the method for deleting and recycling measurement points in the real-time database of the present invention, the information of the deleted measurement points backed up in the recycle bin can be restored, and the restoration method includes the following steps:
[0013] The client sends a request to restore the measurement points in the recycle bin to the measurement point service through the network service;
[0014] After receiving the request to restore the measurement points in the recycle bin, the measurement point service first checks whether the transmitted information exists in the recycle bin. If it does not exist, it returns a search error to the client and stops the restoration; if it exists, it restores the measurement point information, immediately synchronizes the information to the storage device, updates the measurement point information to the storage file, and returns the restoration success.
[0015] As a preferred solution of the method for deleting and recycling measurement points in the real-time database of the present invention, the information of the deleted measurement points backed up in the recycle bin can be cleared, and the clearing method includes the following steps:
[0016] The client sends a request to clear the measurement points in the recycle bin to the recycle bin through the network service;
[0017] After receiving the request to clear the measurement points in the recycle bin, the recycle bin clears the corresponding measurement points or empties them and returns the clearing information.
[0018] As a preferred solution of the method for deleting and recycling measurement points in the real-time database of the present invention, the information of the deleted measurement points backed up in the recycle bin can be located by transmitting the measurement point name or description information.
[0019] As a preferred solution of the method for deleting and recycling measurement points in the real-time database of the present invention, when searching for the information of the deleted measurement points, the location of the measurement point is located by calculating the remainder hash table, and the ID of the deleted measurement point is set to 0. When restoring, the ID of the deleted measurement point is re-added to the remainder hash table.
[0020] As a preferred solution of the method for deleting and recycling measurement points in the real-time database of the present invention, before backing up the information of the deleted measurement points to the recycle bin or restoring or clearing the information of the deleted measurement points backed up in the recycle bin, the request data is verified. After successful verification, the search for the deleted measurement points is performed. If the verification fails, the verification failure information is returned and the deletion stops.
[0021] In a second aspect, an embodiment of the present invention further provides a real-time database measurement point deletion and recovery system, including:
[0022] A request sending module, configured to send a measurement point deletion request and measurement point data to be deleted from a client to a network service;
[0023] A service forwarding module, configured to forward the measurement point deletion request and the measurement point data to be deleted to a measurement point service after the network service receives them;
[0024] A deletion backup module, configured to perform a deletion operation process on the measurement point service to find the information of the measurement point to be deleted; if the information of the measurement point to be deleted can be found, back up the information of the measurement point to be deleted to a recycle bin, and if it cannot be found, return that the measurement point to be deleted does not exist and stop the deletion operation;
[0025] A measurement point update module, configured to, after backing up the information of the measurement point to be deleted to the recycle bin, the measurement point service returns an information indicating that the measurement point deletion is successful, synchronize the information of the recycle bin to a storage device, update the information in the recycle bin to a storage file, and at the same time notify other services to delete the measurement point;
[0026] An information feedback module, configured to return to the client after the network service receives the information indicating that the measurement point deletion is successful or failed.
[0027] Thirdly, an embodiment of the present invention further provides a computer-readable storage medium, storing a computer program, and when the computer program is executed by a processor, the steps of the real-time database measurement point deletion and recovery method are implemented.
[0028] Fourthly, an embodiment of the present invention further provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the real-time database measurement point deletion and recovery method are implemented.
[0029] Compared with the prior art, the present invention has at least the following beneficial effects:
[0030] When deleting a measurement point, in order to prevent the user from accidentally deleting the measurement point, a recycle bin function is added. First, the data is backed up to the measurement point recycle bin, and the backup data is synchronized to a storage device such as a physical disk, and then the measurement point information is deleted, thereby improving the fault tolerance of real-time database data processing. The deletion operation can be performed after reconfirming the deletion of the measurement point, ensuring the integrity of the data.
[0031] Furthermore, the present invention adds a verification operation to the measurement point service. Before backing up the deleted measurement point information to the recycle bin or restoring or clearing the backed-up deleted measurement point information in the recycle bin, the request data is verified first. After successful verification, the deleted measurement point is searched for. If the verification fails, a verification failure message is returned and the deletion stops. When performing deletion, restoration, and clearing operations on the measurement point information, the present invention will first verify the request data to prevent service errors caused by incorrect request data during the transmission process, thereby affecting the processing result and enhancing the security of the real-time database.
[0032] It can be understood that the beneficial effects of the above second to fourth aspects can be referred to the relevant descriptions in the first aspect above, and will not be elaborated here. Description of the Drawings
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0034] Figure 1 Flowchart of the method for deleting and recycling measurement points in the real-time database according to the embodiment of the present invention;
[0035] Figure 2 Flowchart of restoring measurement points according to the embodiment of the present invention;
[0036] Figure 3 Flowchart of clearing measurement points according to the embodiment of the present invention. Detailed Embodiments
[0037] To make the purpose, technical solutions, and advantages of the present invention clearer and more definite, the following further details the present invention in conjunction with specific embodiments and the drawings. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0038] See Figure 1 , an embodiment of the method for deleting and recycling measurement points in the real-time database of the present invention, includes the following steps:
[0039] Step 11: Send a measurement point deletion request and the measurement point data to be deleted from the client to the network service;
[0040] The request to delete a measurement point can locate the measurement point by transmitting information such as the name or description of the measurement point, and send the deletion request together with the measurement point data to be deleted to the network service.
[0041] Step 12: After receiving the measurement point deletion request and data, the network service forwards them to the measurement point service;
[0042] Step 13: After receiving the request data, the measurement point service performs deletion operation processing. If the deletion point information is found, the measurement point is backed up to the recycle bin; if not found, it returns that the deletion point does not exist and the deletion stops;
[0043] Before the deletion, recovery, and clearing operation processing, the request data will be verified first. After successful verification, the deletion measurement point is searched. If the verification fails, a verification failure message is returned and the deletion stops. The failure may be due to an incorrect forwarding by the network service. Verification can further ensure the correctness of the deletion operation.
[0044] Searching for the deletion point information locates the position of the measurement point in the shared memory through modulo hash table calculation, and sets the ID of the searched measurement point to 0.
[0045] Step 14: After the deletion point information is moved to the recycle bin, the measurement point service returns a deletion success message, immediately synchronizes the information to the physical disk, updates the recovery information to the storage file, and notifies other services to delete the measurement point;
[0046] Step 15: After receiving the measurement point deletion success or failure information, the network service returns it to the client.
[0047] After receiving the information returned by the measurement point service, the network service immediately forwards the result to the client. Both verification failure and non-existence of the measurement point will return a failure message, and the subsequent operations of the measurement point service also stop.
[0048] See Figure 2 , the deleted measurement point information backed up in the recycle bin can be restored. The measurement point recovery method of this embodiment of the present invention includes the following steps:
[0049] Step 21: Send a request to restore the measurement point in the recycle bin and the measurement point data to be restored from the client to the network service;
[0050] Step 22: After receiving the measurement point deletion request and data, the network service forwards them to the measurement point service;
[0051] Step 23: After receiving the request data, the measurement point service performs recovery operation processing. First, it detects whether the transmitted information exists in the recycle bin, restores the measurement point information, and adds the restored measurement point ID to the modulo hash table; if not, it returns that the recovery point does not exist and the recovery stops;
[0052] Step 24: After the restoration is completed, the measurement point service returns a restoration success message, immediately synchronizes the information to the physical disk, updates the restoration information to the storage file, and notifies other services to restore the measurement points;
[0053] Step 25: After receiving the measurement point restoration success or failure information, the network service returns it to the client.
[0054] See Figure 3 , the deleted measurement point information backed up in the recycle bin can be cleared. The measurement point clearing method of the embodiment of the present invention includes the following steps:
[0055] Step 31: Send a request to clear the measurement points in the recycle bin and the measurement point data to be cleared from the client to the network service;
[0056] Step 32: After receiving the measurement point clearing request and data, the network service forwards them to the recycle bin;
[0057] Step 33: After receiving the request data, the recycle bin performs a clearing operation;
[0058] Step 34: After the clearing is completed, the recycle bin returns a clearing success message, immediately synchronizes the information to the physical disk, and clears the storage;
[0059] Step 35: After receiving the measurement point clearing information, the network service returns it to the client.
[0060] The real-time database measurement point deletion and recovery method proposed by the present invention is applied in the Ruite real-time database system. Around the measurement point service, a recovery mechanism after measurement point deletion is added, and a recycle bin is set up. After the user issues a request to delete a measurement point, the deleted measurement point data is not directly cleared but recycled and backed up in the recycle bin. The user can retain it for further restoration or clearing operations. In practical applications, the operation fault tolerance rate is greatly improved. For misdeleted measurement points, no loss will be caused to the measurement point configuration and disk information after recovery, ensuring the integrity of the database function.
[0061] Another embodiment of the present invention also provides a real-time database measurement point deletion and recovery system, including:
[0062] A request sending module, configured to send a request to delete a measurement point and the measurement point data to be deleted from the client to the network service;
[0063] A service forwarding module, configured to forward the measurement point deletion request and the measurement point data to be deleted to the measurement point service after the network service receives them;
[0064] The deletion backup module is used for the measurement point service to perform deletion operation processing and find the information of the deleted measurement point. If the information of the deleted measurement point can be found, the information of the deleted measurement point is backed up to the recycle bin. If it cannot be found, it returns that the deleted measurement point does not exist and stops the deletion operation.
[0065] The measurement point update module is used to, after backing up the information of the deleted measurement point to the recycle bin, the measurement point service returns a message indicating successful deletion of the measurement point, synchronizes the recycle bin information to the storage device, updates the information in the recycle bin to the storage file, and notifies other services to delete the measurement point.
[0066] The information feedback module is used to return to the client after the network service receives the message indicating successful or failed deletion of the measurement point.
[0067] Another embodiment of the present invention also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the real-time database measurement point deletion and recovery method are implemented.
[0068] Another embodiment of the present invention also provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the real-time database measurement point deletion and recovery method are implemented.
[0069] Exemplarily, the computer program can be divided into one or more modules / units. The one or more modules / units are stored in the computer-readable storage medium and executed by the processor to complete the steps of the real-time database measurement point deletion and recovery method described in this application. The one or more modules / units can be a series of computer-readable instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in the server.
[0070] The server can be a computing device such as a notebook, a desktop computer, and a cloud server. The server may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the server may further include more or fewer components, or combine certain components, or different components. For example, the server may further include input / output devices, network access devices, a bus, etc.
[0071] The processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0072] The memory may be an internal storage unit of the server, such as the hard disk or memory of the server. The memory may also be an external storage device of the server, such as a plug-in hard disk equipped on the server, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory may also include both the internal storage unit and the external storage device of the server. The memory is used to store the computer-readable instructions and other programs and data required by the server. The memory may also be used to temporarily store data that has been output or is to be output.
[0073] It should be noted that for the information interaction, execution process, etc. between the above-mentioned device / units, due to the same concept as the method embodiment, the specific functions and the technical effects brought thereby can be specifically referred to the method embodiment part, and will not be elaborated here.
[0074] Those skilled in the art can clearly understand that for the convenience and conciseness of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiment and will not be elaborated here.
[0075] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-described embodiment methods of this application, a computer program can be used to instruct relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the photographing device / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc, etc.
[0076] In the above embodiments, the descriptions of the various embodiments have their own emphases. For parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0077] The above-described embodiments are only used to illustrate the technical solutions of this application, rather than to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing various embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for deleting and recycling measurement points in a real-time database, characterized in that, It includes the following steps: Send a request to delete a measurement point and the measurement point data to be deleted from the client to the network service; After receiving the request to delete a measurement point and the measurement point data to be deleted, the network service forwards them to the measurement point service; The measurement point service performs deletion operation processing to find the information of the measurement point to be deleted; If the information of the measurement point to be deleted can be found, back up the information of the measurement point to be deleted to the recycle bin. If not found, return that the measurement point to be deleted does not exist and stop the deletion operation; After backing up the information of the measurement point to be deleted to the recycle bin, the measurement point service returns the information that the measurement point has been successfully deleted, synchronizes the recycle bin information to the storage device, updates the information in the recycle bin to the storage file, and at the same time notifies other services to delete the measurement point; After receiving the information that the measurement point has been successfully deleted or failed, the network service returns it to the client.
2. The real-time database measurement point deletion and recycling method according to claim 1, characterized in that, The information of the measurement point to be deleted backed up in the recycle bin can be restored. The restoration method includes the following steps: The client sends a request to restore the measurement point in the recycle bin to the measurement point service through the network service; After receiving the request to restore the measurement point in the recycle bin, the measurement point service first checks whether the transmitted information exists in the recycle bin. If not, it returns a search error to the client and stops the restoration. If it exists, it restores the measurement point information, immediately synchronizes the information to the storage device, updates the measurement point information to the storage file, and returns the restoration success.
3. The real-time database measurement point deletion and recycling method according to claim 1, wherein, The information of the measurement point to be deleted backed up in the recycle bin can be cleared. The clearing method includes the following steps: The client sends a request to clear the measurement point in the recycle bin to the recycle bin through the network service; After receiving the request to clear the measurement point in the recycle bin, the recycle bin clears the corresponding measurement point or empties it and returns the clearing information.
4. The real-time database measuring point deletion and recycling method according to claim 1, wherein The information of the measurement point to be deleted backed up in the recycle bin can locate the measurement point by transmitting the measurement point name or description information.
5. The real-time database measurement point deletion and recycling method according to claim 1, characterized in that When finding the information of the measurement point to be deleted, it is located at the measurement point position through the modulo hash table calculation, and the ID of the measurement point to be deleted is set to 0. When restoring, the ID of the measurement point to be deleted is re-added to the modulo hash table.
6. The real-time database measurement point deletion and recycling method according to claim 1, characterized in that Before backing up the information of the measurement point to be deleted to the recycle bin or restoring or clearing the information of the measurement point to be deleted backed up in the recycle bin, first verify the request data. After successful verification, perform the search for the measurement point to be deleted. If the verification fails, return the verification failure information and stop the deletion.
7. A real-time database measurement point deletion and recovery system, characterized in that, It includes: A request sending module for sending a request to delete a measurement point and the measurement point data to be deleted from the client to the network service; A service forwarding module for forwarding the request to delete a measurement point and the measurement point data to be deleted received by the network service to the measurement point service; A deletion backup module for the measurement point service to perform deletion operation processing to find the information of the measurement point to be deleted; If the information of the measurement point to be deleted can be found, back up the information of the measurement point to be deleted to the recycle bin. If not found, return that the measurement point to be deleted does not exist and stop the deletion operation; A measurement point update module for, after backing up the information of the measurement point to be deleted to the recycle bin, the measurement point service returns the information that the measurement point has been successfully deleted, synchronizes the recycle bin information to the storage device, updates the information in the recycle bin to the storage file, and at the same time notifies other services to delete the measurement point; An information feedback module for the network service to return to the client after receiving the information that the measurement point has been successfully deleted or failed.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the real-time database measurement point deletion and recycling method according to any one of claims 1 to 6.
9. A server, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the real-time database measurement point deletion and recycling method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method for recovering backup of real-time database
CN104850598A
Data deletion method and system for time sequence databases
CN106874343A