Oil well alarm data processing method, device, storage medium and electronic device
By determining whether to update the database based on progress and working status during oil well alarm data processing, the problem of high data storage pressure for oil well alarms was solved, resulting in reduced database storage pressure and a decrease in alarm frequency.
Patent Information
- Application Number
- CN201910937052.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-29
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2039-09-29
AI Technical Summary
There is currently no effective solution to the problem of high storage pressure caused by storing all oil well alarm data in a database.
The system generates the first alarm data by acquiring the detection data of the oil well and retrieves the second alarm data from the database. The system decides whether to update the database based on the progress and working status, thus avoiding storing all alarm data in the database.
This reduced the storage pressure on the database, decreased the query pressure, improved the performance of subsequent alarm devices, and reduced the alarm frequency.
Smart Images

Figure CN112579617B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method, device, storage medium and electronic equipment for processing alarm data of an oil well. Background Art
[0002] At present, oil wells generate a large amount of alarm data every day. If all the generated alarm data are stored in the database, it will cause great storage pressure on the database. For example, if the scheduling frequency is 1 minute, two major types of alarm judgments can be added, which can be parameter alarms and power diagram alarms. If there are 1,000 oil wells, a total of 1,000 data can be generated per minute. In actual situations, the number of oil wells in an oil production plant will be more, and there will be many operating parameters to be judged. Therefore, storing the alarm data of the oil wells directly in the database will cause great storage pressure on the database.
[0003] With regard to the technical problem in the prior art that all alarm data are stored in the database, resulting in a large storage pressure on the database, no effective solution has been proposed yet. Summary of the invention
[0004] The main purpose of the present invention is to provide a method, device, storage medium and electronic device for processing oil well alarm data, so as to at least solve the technical problem of high storage pressure on the database caused by storing all alarm data in the database.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present invention, a method for processing alarm data of an oil well is provided. The method may include: obtaining detection data of the oil well, and generating first alarm data of the oil well based on the detection data; obtaining second alarm data in a database, wherein the second alarm data is the latest alarm data stored in the database, and the oil well alarm type is the same as the oil well alarm type in the first alarm data; if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the first progress, then updating the database based on the first alarm data; if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the second progress, then prohibiting the database from being updated based on the first alarm data.
[0006] Optionally, after generating first alarm data of the oil well based on the detection data, the method further comprises: determining a working state of the oil well according to the first alarm data.
[0007] Optionally, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the first progress, updating the database based on the first alarm data includes: when it is determined that the working state of the oil well is an abnormal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a progress that has ended, storing the first alarm data in the database, wherein the first progress includes the progress that has ended; and / or if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the second progress, prohibiting updating the database based on the first alarm data includes: when it is determined that the working state of the oil well is an abnormal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a progress that is in progress, prohibiting storing the first alarm data in the database, wherein the second progress includes the progress that is in progress.
[0008] Optionally, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the first progress, updating the database based on the first alarm data includes: when it is determined that the working status of the oil well is a normal working status, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is an ongoing progress, updating the second alarm data based on the first alarm data to obtain an update result, wherein the first progress includes the ongoing progress; and / or if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the second progress, then prohibiting the updating of the database based on the first alarm data includes: when it is determined that the working status of the oil well is a normal working status, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is an ended progress, prohibiting the storage of the first alarm data in the database, wherein the second progress includes the ended progress.
[0009] Optionally, updating the second alarm data based on the first alarm data to obtain an update result, and storing the update result in a database includes: obtaining the time when the oil well in the first alarm data starts to be in a normal working state, and determining the time as the target end time of the oil well alarm event; updating the original end time in the second alarm data to the target end time, wherein the update result includes the target end time; and / or determining the duration of the oil well alarm event through the target end time, wherein the update result includes the duration.
[0010] Optionally, the method also includes: obtaining a target field in the database, wherein the target field is used to record the progress of the oil well alarm event; when the target field is empty, determining the progress of the oil well alarm event to be an ongoing progress; when the target field is not empty, determining the progress of the oil well alarm event to be an ended progress.
[0011] Optionally, when the second alarm data does not exist in the database, the method further includes: if it is determined that the working state of the oil well is an abnormal working state, storing the first alarm data in the database; if it is determined that the working state of the oil well is a normal working state, prohibiting the storage of the first alarm data in the database.
[0012] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a device for processing alarm data of an oil well is also provided. The device may include: a first acquisition unit, used to acquire detection data of the oil well, and generate first alarm data of the oil well based on the detection data; a second acquisition unit, used to acquire second alarm data in a database, wherein the second alarm data is the alarm data that is most recently stored in the database and the oil well alarm type is the same as the oil well alarm type in the first alarm data; an update unit, used to update the database based on the first alarm data when it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the first progress; and a prohibition unit, used to prohibit updating the database based on the first alarm data when it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the second progress.
[0013] To achieve the above object, according to another aspect of the present invention, a storage medium is provided, which includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the method for processing the alarm data of the oil well according to the embodiment of the present invention.
[0014] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, an electronic device is also provided. The electronic device includes a processor, at least one memory connected to the processor, and a bus; wherein the processor and the memory communicate with each other through the bus; the processor is used to call the program instructions in the memory to execute the method for processing the alarm data of the oil well according to the embodiment of the present invention.
[0015] Through the present invention, the detection data of the oil well is obtained, and the first alarm data of the oil well is generated based on the detection data; the second alarm data is obtained in the database, wherein the second alarm data is the alarm data that is most recently stored in the database and the oil well alarm type is the same as the oil well alarm type in the first alarm data; if the progress of the oil well alarm event corresponding to the second alarm data is detected to be the first progress, the database is updated based on the first alarm data; if the progress of the oil well alarm event corresponding to the second alarm data is detected to be the second progress, it is prohibited to update the database based on the first alarm data. That is to say, the present invention determines whether to update the database through the second alarm data of the oil well alarm type that is most recently stored in the database and is the same as the oil well alarm type in the detected first alarm data, and avoids storing all the generated alarm data in the database, thereby solving the technical problem of high storage pressure on the database due to storing all the alarm data in the database, and achieving the technical effect of reducing the storage pressure of the database and. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings constituting a part of this application are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0017] Figure 1 is a flow chart of a method for processing alarm data of an oil well according to an embodiment of the present invention;
[0018] Figure 2 is a flow chart of another method for processing alarm data of an oil well according to an embodiment of the present invention;
[0019] Figure 3 is a schematic diagram of a device for processing alarm data of an oil well according to an embodiment of the present invention; and
[0020] Figure 4 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0022] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] Example 1
[0025] An embodiment of the present invention provides a method for processing alarm data of an oil well.
[0026] Figure 1 FIG. 1 is a flow chart of a method for processing alarm data of an oil well according to an embodiment of the present invention. Figure 1 As shown, the method may include the following steps:
[0027] Step S102: acquiring detection data of the oil well, and generating first alarm data of the oil well based on the detection data.
[0028] In the technical solution provided in the above step S102 of the present invention, the oil wells of the oil production plant can be pumping wells, screw pump wells, water injection wells, etc., without any limitation here, and each oil well has a unique identification (ID). During the operation of the oil well, a large amount of data is generated every day, and the oil well can be detected by a sensor to obtain the detection data of the oil well. Optionally, this embodiment processes the detection data of the oil well according to a specific algorithm to obtain the first alarm data, wherein the specific algorithm can be a model algorithm, and the model algorithm can be a frequency scheduling model algorithm, and the first alarm data is also the newly determined alarm data.
[0029] In this embodiment, the alarm data may include data such as the oil well identification, the oil well alarm type, the oil well alarm start time, the oil well alarm end time, and the oil well alarm duration.
[0030] Step S104, obtaining second alarm data in the database, wherein the second alarm data is the latest alarm data stored in the database and the oil well alarm type is the same as the oil well alarm type in the first alarm data.
[0031] In the technical solution provided in the above step S104 of the present invention, the first alarm data includes an oil well alarm type, for example, the oil well alarm type may be a parameter over-limit alarm type, a power diagram alarm type, a pump leakage type, etc., wherein the parameter over-limit alarm type may be an oil pressure over-limit type, and no limitation is made here. After the first alarm data of the oil well is generated based on the detection data, second alarm data is obtained in the database for the same oil well, wherein the database is used to store alarm data, and the alarm data may be stored in an alarm data table of the database, and for the same oil well, second alarm data of the same oil well alarm type as the oil well alarm type in the first alarm data is obtained in the alarm data table, and the second alarm data is the latest alarm data of the same oil well alarm type as the first alarm data stored in the database.
[0032] Step S106: if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the first progress, the database is updated based on the first alarm data.
[0033] In the technical solution provided in the above step S106 of the present invention, after the second alarm data is acquired in the database, the progress of the oil well alarm event corresponding to the second alarm data is detected.
[0034] In this embodiment, the second alarm data is used to indicate an oil well alarm event, that is, an event that alarms the oil well. The progress of the oil well alarm event may include the first progress. If the progress of the oil well alarm event corresponding to the second alarm data is detected to be the first progress, the database can be updated based on the first alarm data. For example, the first alarm data can be stored in the database, and the end time or duration of the alarm event corresponding to the second alarm data can also be updated.
[0035] Step S108: If it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the second progress, updating the database based on the first alarm data is prohibited.
[0036] In the technical solution provided in the above step S108 of the present invention, the progress of the oil well alarm event may include a second progress. If it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the second progress, it is prohibited to update the database based on the first alarm data. For example, it is prohibited to store the first alarm data in the database. That is, this embodiment does not store all the alarm data in the database, but stores the alarm data in the database under certain conditions to reduce the storage pressure and query pressure of the database. It is also beneficial to improve the performance of subsequent alarm devices and reduce the frequency of alarms in various ways. For example, it reduces the frequency of alarms through text messages or instant messaging tools, thereby avoiding storing all the alarm data generated by the algorithm in the database, resulting in a technical problem of high storage pressure on the database.
[0037] The steps of the above method of this embodiment are further described below.
[0038] As an optional implementation, after generating first alarm data of the oil well based on the detection data in step S102, the method further includes: determining a working state of the oil well according to the first alarm data.
[0039] In this embodiment, the first alarm data can be used to reflect the working state of the oil well. After the first alarm data of the oil well is generated based on the detection data, the working state of the oil well can be determined according to the first alarm data, and the working state can include the normal working state of the oil well and the abnormal working state of the oil well.
[0040] Optionally, if the oil well parameters included in the first alarm data of this embodiment exceed a certain threshold value, it can be determined that the oil well is in an abnormal working state, and the first alarm data can be determined as abnormal data; if the oil well parameters included in the first alarm data of this embodiment are lower than a certain threshold value, it can be determined that the oil well is in a normal working state, and the first alarm data can be determined as a normal working state.
[0041] The following introduces a method for updating the database based on the first alarm data if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the first progress.
[0042] As an optional implementation, step S106, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the first progress, updating the database based on the first alarm data includes: when it is determined that the working state of the oil well is an abnormal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a progress that has been completed, storing the first alarm data in the database, wherein the first progress includes the progress that has been completed; and / or, step S108, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the second progress, prohibiting updating the database based on the first alarm data includes: when it is determined that the working state of the oil well is an abnormal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a progress that is in progress, prohibiting storing the first alarm data in the database, wherein the second progress includes the progress that is in progress.
[0043] In this embodiment, when it is determined that the working state of the oil well is an abnormal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the progress that has been completed, for example, the alarm data of the same oil well alarm type for the same oil well that is most recently stored in the alarm data table, the corresponding oil well alarm event has ended, then the first alarm data can be inserted into the database, thereby realizing the update of the database.
[0044] When it is determined that the working state of the oil well is an abnormal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is an ongoing progress, that is, the oil well alarm event corresponding to the alarm data of the same oil well alarm type of the same oil well stored most recently in the database has not ended, then in order to avoid duplicate storage, it is prohibited to store the first alarm data in the database, for example, the first alarm data is not inserted into the alarm data table.
[0045] As an optional implementation, step S106, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the first progress, updating the database based on the first alarm data includes: when it is determined that the working status of the oil well is a normal working status, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is an ongoing progress, updating the second alarm data based on the first alarm data to obtain an update result, wherein the first progress includes the ongoing progress; and / or, step S108, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the second progress, prohibiting updating the database based on the first alarm data includes: when it is determined that the working status of the oil well is a normal working status, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is an already ended progress, prohibiting storing the first alarm data in the database, wherein the second progress includes the already ended progress.
[0046] In this embodiment, when it is determined that the working state of the oil well is a normal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is an ongoing progress, that is, the oil well alarm event corresponding to the alarm data of the same oil well alarm type of the same oil well stored in the database has not yet ended, then the second alarm data stored in the database can be updated based on the comparison of the first alarm data to obtain an update result, thereby realizing the update of the database.
[0047] Optionally, the database of this embodiment may only store alarm data indicating that the oil well is in an abnormal working state. When it is determined that the working state of the oil well is a normal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a completed progress, it is prohibited to store the first alarm data in the database, for example, the first alarm data is not inserted into the alarm data table.
[0048] The following describes the method for updating the second alarm data based on the first alarm data in this example to obtain an update result and to introduce the method for updating the result.
[0049] As an optional implementation, the second alarm data is updated based on the first alarm data, and the update result includes: obtaining the time when the oil well in the first alarm data starts to be in normal working state, and determining the time as the target end time of the oil well alarm event; updating the original end time in the second alarm data to the target end time, wherein the update result includes the target end time; and / or determining the duration of the oil well alarm event through the target end time, wherein the update result includes the duration.
[0050] In this embodiment, when it is determined that the working state of the oil well is a normal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is an ongoing progress, the end time of the alarm event can be updated, and the time when the oil well in the first alarm data starts to be in a normal working state can be obtained, and then the original end time in the second alarm data is updated according to the time when the oil well starts to be in a normal working state, and the target end time of the corresponding oil well alarm event is obtained, and the target end time indicates that the oil well alarm event has ended.
[0051] Optionally, this embodiment can also record the duration of the oil well alarm event, obtain the start time of the oil well alarm event, and then obtain the difference between the above-mentioned updated target end time and the start time, determine the difference as the duration of the oil well alarm event, and then record the duration in the database, thereby updating the database.
[0052] As an optional implementation, the method also includes: obtaining a target field in a database, wherein the target field is used to record the progress of the oil well alarm event; when the target field is empty, determining the progress of the oil well alarm event as an ongoing progress; when the target field is not empty, determining the progress of the oil well alarm event as an ended progress.
[0053] In the database of this embodiment, a target field is also provided for recording the progress of the oil well alarm event. The target field may be a field for the target end time. If the target field is empty, it can be determined that the progress of the oil well alarm event is an ongoing progress, that is, the oil well alarm event has not ended yet; if the target field is not empty, it can be determined that the progress of the oil well alarm event is an ended progress.
[0054] Optionally, this embodiment also sets a field to indicate the oil well alarm handling stage, so that subsequent alarm handling can be performed through this field, thereby improving the performance of subsequent alarm handling, thereby reducing the alarm frequency of text messages and instant messaging tools.
[0055] As an optional implementation, when the second alarm data does not exist in the database, the method also includes: if it is determined that the working state of the oil well is an abnormal working state, storing the first alarm data in the database; if it is determined that the working state of the oil well is a normal working state, prohibiting the storage of the first alarm data in the database.
[0056] In this embodiment, the second alarm data is the latest alarm data stored in the database, and the oil well alarm type is the same as the oil well alarm type in the first alarm data. If the second alarm data does not exist in the database, for example, when the alarm data is stored in the database for the first time, if it is determined that the working state of the oil well is an abnormal working state, the first alarm data can be directly stored in the database, for example, the first alarm data can be directly inserted into the alarm data table; if it is determined that the working state of the oil well is a normal working state, since the database can only record the alarm data corresponding to the abnormal working state of the oil well, it is prohibited to store the first alarm data in the database, for example, the first alarm data is not inserted into the alarm data table.
[0057] Through the present invention, the detection data of the oil well is obtained, and the first alarm data of the oil well is generated based on the detection data; the second alarm data is obtained in the database, wherein the second alarm data is the alarm data that is most recently stored in the database and the oil well alarm type is the same as the oil well alarm type in the first alarm data; if the progress of the oil well alarm event corresponding to the second alarm data is detected to be the first progress, the database is updated based on the first alarm data; if the progress of the oil well alarm event corresponding to the second alarm data is detected to be the second progress, it is prohibited to update the database based on the first alarm data. That is to say, the present invention determines whether to update the database through the second alarm data of the oil well alarm type that is most recently stored in the database and is the same as the oil well alarm type in the detected first alarm data, and avoids storing all the generated alarm data in the database, thereby solving the technical problem of high storage pressure on the database due to storing all the alarm data in the database, and achieving the technical effect of reducing the storage pressure of the database and.
[0058] Example 2
[0059] The technical solution of the embodiment of the present invention is described below in conjunction with a preferred implementation manner.
[0060] Figure 2 FIG. 1 is a flow chart of another method for processing alarm data of an oil well according to an embodiment of the present invention. Figure 2 As shown, the method may include the following steps:
[0061] Step S201, processing the detection data obtained by the sensor through the model algorithm to obtain new alarm data.
[0062] In this embodiment, the model algorithm may be a frequency scheduling model algorithm, which detects the oil well through sensors to obtain detection data, and processes the detection data through the model algorithm to obtain new alarm data.
[0063] Step S202, determining whether the new alarm data is normal data.
[0064] After the detection data obtained by the sensor is processed by the model algorithm to obtain new alarm data, it is determined whether the new alarm data is normal data. The normal data here is data used to indicate that the working state of the oil well is a normal working state.
[0065] Step S203, when it is determined that the new alarm data is normal data, the original alarm data of the same type of the same oil well that already exists in the data table is determined, and it is determined whether the alarm event corresponding to the original alarm data has ended.
[0066] In this embodiment, the database can store the alarm data of the oil well through a data table. When it is determined that the new alarm data is the above-mentioned normal data, the original alarm data of the same oil well (the ID of the oil well is the same) with the same alarm type as the new alarm data that already exists can be determined from the data table, and whether the corresponding alarm event has ended can be determined based on the original alarm data, wherein the alarm type can be pump leakage.
[0067] Step S204: No new alarm data is inserted into the data table.
[0068] In this embodiment, when it is determined that the new alarm data is normal data, if the alarm event corresponding to the original alarm data has ended, the new alarm data is not inserted into the data table.
[0069] Step S205, updating the alarm end time and recording the alarm duration.
[0070] When it is determined that the new alarm data is normal data, if the alarm event corresponding to the original alarm data has not ended, the alarm end time in the original alarm data can be updated by the alarm end time in the new alarm data. The updated end time of the alarm event marks the end of the alarm event and records the duration of the alarm event, thereby achieving the purpose of merging the alarm data, wherein the duration can be the updated end time of the alarm event minus the start time of the alarm event.
[0071] Step S206, when it is determined that the new alarm data is abnormal data, the original alarm data of the same type for the same oil well that already exists in the data table is determined, and it is determined whether the alarm event corresponding to the original alarm data has ended.
[0072] In this embodiment, the new alarm data is abnormal data, which is data used to indicate that the working state of the oil well is an abnormal working state. At this time, the original alarm data of the same type of the same oil well that already exists in the data table is determined, and it is determined whether the alarm event corresponding to the original alarm data has ended.
[0073] Step S207: insert new alarm data into the data table.
[0074] In the case where it is determined that the new alarm data is abnormal data, if it is determined that the alarm event corresponding to the original alarm data has ended, the new alarm data may be inserted into the data table.
[0075] Step S208: No new alarm data is inserted into the data table.
[0076] In the case where it is determined that the new alarm data is abnormal data, if it is determined that the alarm event corresponding to the original alarm data has not ended, the new alarm data is not inserted into the data table.
[0077] It should be noted that in this embodiment, in addition to storing alarm data, the data alarm table can also be used to store the unique ID of the oil well, the alarm type, the alarm start time, the alarm end time, the alarm duration, etc., wherein, if the alarm end time is empty, it means that the alarm event has not yet ended. This embodiment may also include a field for marking the alarm handling stage for subsequent alarm handling.
[0078] This embodiment stores massive amounts of alarm data, and there is no need to store all the alarm data generated by the model algorithm into the database, thereby reducing the storage pressure and query pressure on the database side. It is also beneficial to improve the performance of subsequent alarm devices, reduce the alarm frequency of text messages and instant messaging tools, and thus improve the alarm efficiency of oil wells.
[0079] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0080] Example 3
[0081] The embodiment of the present invention further provides a device for processing the alarm data of an oil well. It should be noted that the device for processing the alarm data of an oil well of the embodiment can be used to execute the method for processing the alarm data of an oil well of the embodiment of the present invention.
[0082] Figure 3 Schematic diagram of a device for processing alarm data of an oil well according to an embodiment of the present invention. Figure 3 As shown, the device 30 for processing the alarm data of the oil well may include: a first acquisition unit 31 , a second acquisition unit 32 , an updating unit 33 and a prohibition unit 34 .
[0083] The first acquisition unit 31 is used to acquire detection data of the oil well and generate first alarm data of the oil well based on the detection data.
[0084] The second acquisition unit 32 is used to acquire second alarm data from the database, wherein the second alarm data is the latest alarm data stored in the database and the oil well alarm type is the same as the oil well alarm type in the first alarm data.
[0085] The updating unit 33 is configured to update the database based on the first alarm data when it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the first progress.
[0086] The prohibition unit 34 is used to prohibit updating the database based on the first alarm data when it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the second progress.
[0087] Optionally, the device further comprises: a first determining unit, configured to determine the working state of the oil well according to the first alarm data after generating the first alarm data of the oil well based on the detection data.
[0088] Optionally, the updating unit 33 includes: a first storage module, used for storing the first alarm data in the database if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a completed progress when the working state of the oil well is determined to be an abnormal working state, wherein the first progress includes the completed progress; and / or the prohibition unit 34 includes: a second prohibition module, used for prohibiting the storage of the first alarm data in the database if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is an ongoing progress when the working state of the oil well is determined to be an abnormal working state, wherein the second progress includes the ongoing progress.
[0089] The updating unit 33 includes: an updating module, which is used to update the second alarm data based on the first alarm data to obtain an updated result if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is an ongoing progress when the working state of the oil well is determined to be a normal working state, wherein the first progress includes the ongoing progress; and / or the prohibition unit 34 includes: a second prohibition module, which is used to prohibit the storage of the first alarm data in the database if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is an already ended progress when the working state of the oil well is determined to be a normal working state, wherein the second progress includes the already ended progress.
[0090] Optionally, the update module includes: an acquisition submodule, used to acquire the time when the oil well in the first alarm data starts to be in normal working state, and determine the time as the target end time of the oil well alarm event; an update submodule, used to update the original end time in the second alarm data to the target end time, wherein the update result includes the target end time; and / or, a determination submodule, used to determine the duration of the oil well alarm event through the target end time, wherein the update result includes the duration.
[0091] Optionally, the device also includes: a third acquisition unit, used to acquire a target field in a database, wherein the target field is used to record the progress of the oil well alarm event; a second determination unit, used to determine that the progress of the oil well alarm event is an ongoing progress when the target field is empty; and a fourth determination unit, used to determine that the progress of the oil well alarm event is an ended progress when the target field is not empty.
[0092] The device also includes: when there is no second alarm data in the database, if it is determined that the working state of the oil well is an abnormal working state, then the first alarm data is stored in the database; if it is determined that the working state of the oil well is a normal working state, then the first alarm data is prohibited from being stored in the database.
[0093] In this embodiment, the detection data of the oil well is acquired by the first acquisition unit 31, and the first alarm data of the oil well is generated based on the detection data. The second alarm data is acquired in the database by the second acquisition unit 32, wherein the second alarm data is the alarm data that is most recently stored in the database and the oil well alarm type is the same as the oil well alarm type in the first alarm data. When the progress of the oil well alarm event corresponding to the second alarm data is detected to be the first progress, the database is updated based on the first alarm data by the updating unit 33. When the progress of the oil well alarm event corresponding to the second alarm data is detected to be the second progress, the updating of the database based on the first alarm data is prohibited by the prohibition unit 34. That is, whether to update the database is determined by the second alarm data that is most recently stored in the database and the oil well alarm type is the same as the oil well alarm type in the detected first alarm data, and all the generated alarm data is avoided from being stored in the database, thereby solving the technical problem of high storage pressure on the database due to storing all the alarm data in the database, and achieving the technical effect of reducing the storage pressure of the database.
[0094] Example 4
[0095] In this embodiment, the data processing device includes a processor and a memory. The first acquisition unit 31, the second acquisition unit 32, the update unit 33 and the prohibition unit 34 are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
[0096] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the purpose of reducing the storage pressure of the database can be achieved by adjusting the kernel parameters.
[0097] Example 5
[0098] An embodiment of the present invention provides a storage medium on which a program is stored. When the program is executed by a processor, the method for processing the alarm data of the oil well is implemented.
[0099] Example 6
[0100] Figure 4 is a schematic diagram of an electronic device according to an embodiment of the present invention. Figure 4 As shown, the electronic device 40 includes at least one processor 401, at least one memory 402 and a bus 403 connected to the processor 401; wherein the processor 401 and the memory 402 communicate with each other through the bus 403; the processor 401 is used to call the program instructions in the memory 302 to execute the above-mentioned method for processing the alarm data of the oil well. The electronic device 40 in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0101] Example 7
[0102] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing the following method steps:
[0103] Acquire detection data of the oil well, and generate first alarm data of the oil well based on the detection data; acquire second alarm data in the database, wherein the second alarm data is the alarm data most recently stored in the database, and the oil well alarm type is the same as the oil well alarm type in the first alarm data; if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the first progress, update the database based on the first alarm data; if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the second progress, it is prohibited to update the database based on the first alarm data.
[0104] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: after generating first alarm data of the oil well based on the detection data, determining the working state of the oil well according to the first alarm data.
[0105] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: when it is determined that the working state of the oil well is an abnormal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a progress that has been completed, then the first alarm data is stored in the database, wherein the first progress includes the progress that has been completed; and / or if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a second progress, then updating the database based on the first alarm data is prohibited, including: when it is determined that the working state of the oil well is an abnormal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a progress that is in progress, then the first alarm data is prohibited from being stored in the database, wherein the second progress includes the progress that is in progress.
[0106] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: when it is determined that the working state of the oil well is a normal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is an ongoing progress, then the second alarm data is updated based on the first alarm data to obtain an update result, wherein the first progress includes the ongoing progress; and / or if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a second progress, then it is prohibited to update the database based on the first alarm data, including: when it is determined that the working state of the oil well is a normal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is an already ended progress, then it is prohibited to store the first alarm data in the database, wherein the second progress includes the already ended progress.
[0107] When executed on a data processing device, it is also suitable for executing a program that initializes the following method steps: obtaining the time when the oil well in the first alarm data starts to be in normal working condition, and determining the time as the target end time of the oil well alarm event; updating the original end time in the second alarm data to the target end time, wherein the update result includes the target end time; and / or determining the duration of the oil well alarm event through the target end time, wherein the update result includes the duration.
[0108] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: obtaining a target field in a database, wherein the target field is used to record the progress of an oil well alarm event; when the target field is empty, determining the progress of the oil well alarm event as an ongoing progress; when the target field is not empty, determining the progress of the oil well alarm event as an ended progress.
[0109] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: if the second alarm data does not exist in the database, if it is determined that the working state of the oil well is an abnormal working state, the first alarm data is stored in the database; if it is determined that the working state of the oil well is a normal working state, it is prohibited to store the first alarm data in the database.
[0110] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0111] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for processing oil well alarm data, characterized in that: include: Acquire detection data of the oil well, and generate first alarm data of the oil well based on the detection data; Acquire second alarm data in the database, wherein the second alarm data is the alarm data most recently stored in the database and the oil well alarm type is the same as the oil well alarm type in the first alarm data; If it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a first progress, storing the first alarm data in the database, wherein the first progress includes a progress that has been completed; If it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a second progress, prohibiting the first alarm data from being stored in the database, wherein the second progress includes an ongoing progress; Wherein, after generating the first alarm data of the oil well based on the detection data, the method further comprises: determining the working state of the oil well according to the first alarm data; If it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the first progress, storing the first alarm data in the database includes: when it is determined that the working state is an abnormal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the completed progress, storing the first alarm data in the database; and / or If it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the second progress, prohibiting the first alarm data from being stored in the database includes: if it is determined that the working state is an abnormal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the ongoing progress, prohibiting the first alarm data from being stored in the database; If it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the first progress, storing the first alarm data in the database includes: when it is determined that the working state is the normal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the ongoing progress, updating the second alarm data based on the first alarm data to obtain an update result; and / or If it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the second progress, it is prohibited to store the first alarm data in the database, including: when it is determined that the working state is a normal working state, if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the progress that has ended, it is prohibited to store the first alarm data in the database.
2. The method according to claim 1, characterized in that The second alarm data is updated based on the first alarm data, and the update result obtained includes: Acquire the time when the oil well starts to be in the normal working state in the first alarm data, and determine the time as the target end time of the oil well alarm event; updating the original end time in the second alarm data to the target end time, wherein the update result includes the target end time; and / or, The duration of the oil well alarm event is determined by the target end time, wherein the update result includes the duration.
3. The method according to claim 1, characterized in that The method further comprises: Acquire a target field in the database, wherein the target field is used to record the stage of the oil well alarm event; When the target field is empty, determining the progress of the oil well alarm event as an ongoing progress; When the target field is not empty, it is determined that the progress of the oil well alarm event is the completed progress.
4. The method according to claim 1, characterized in that In the case that the second alarm data does not exist in the database, the method further includes: If it is determined that the working state of the oil well is an abnormal working state, storing the first alarm data in the database; If it is determined that the working state of the oil well is a normal working state, it is prohibited to store the first alarm data in the database.
5. A device for processing alarm data of an oil well, characterized in that: include: a first acquisition unit, configured to acquire detection data of the oil well, and generate first alarm data of the oil well based on the detection data; A second acquisition unit is used to acquire second alarm data in the database, wherein the second alarm data is the alarm data that is most recently stored in the database and whose oil well alarm type is the same as that in the first alarm data; an updating unit, configured to store the first alarm data in the database if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a first progress, wherein the first progress includes a progress that has been completed; a prohibition unit, configured to prohibit storing the first alarm data into the database if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is a second progress, wherein the second progress includes an ongoing progress; Wherein, after generating the first alarm data of the oil well based on the detection data, the device is further used to: determine the working state of the oil well according to the first alarm data; The updating unit is further configured to store the first alarm data in the database if it is determined that the working state is an abnormal working state and if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the progress that has been completed; and / or The prohibition unit is further configured to prohibit storing the first alarm data into the database if it is determined that the working state is an abnormal working state and if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the ongoing progress; The updating unit is further configured to update the second alarm data based on the first alarm data to obtain an update result if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the ongoing progress when the working state is determined to be the normal working state; and / or The prohibition unit is also used to prohibit storing the first alarm data in the database if it is determined that the working state is a normal working state and if it is detected that the progress of the oil well alarm event corresponding to the second alarm data is the completed progress.
6. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 4.
7. An electronic device, characterized in that: The electronic device includes a processor, at least one memory and a bus connected to the processor; Wherein, the processor and the memory communicate with each other through the bus; The processor is used to call the program instructions in the memory to execute the method according to any one of claims 1 to 4.
