Device inventory data maintenance method and device, program product and electronic equipment

By comparing the device inlet and exit data with the backup database in the inventory data management server, the problem of inaccurate device inventory data is solved, the accuracy and consistency of inventory data is achieved, and the production efficiency and user experience of oil extraction and maintenance are improved.

CN120235560APending Publication Date: 2025-07-01CHINA NAT PETROLEUM CORP +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411191205.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

In oil extraction and maintenance scenarios, device inventory data is prone to inaccurate due to misoperation or malicious tampering by data administrators, resulting in chaotic inventory management and affecting production rhythm and efficiency.

Method used

By obtaining device in the inventory data management server and comparing it with the inventory data in the backup database, we ensure the accuracy of the inventory data of the local database, verify consistency by hashing or attribute value comparison, and synchronously update the local database when there is inconsistency.

Benefits of technology

Improve the accuracy of device inventory data, ensure that the inventory data is consistent with the actual situation, reduce the risk of misoperation and tampering, and improve the efficiency and user experience of inventory management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120235560A_ABST
    Figure CN120235560A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a device inventory data maintenance method and device, a program product and electronic equipment. The method is executed in an inventory data management server, and comprises the following steps: obtaining device in-out stock data and target inventory data currently recorded in a local database; correspondingly obtaining backup inventory data from at least one backup database in a preset backup database cluster; comparing whether the target inventory data is consistent with the backup inventory data or not; if the target inventory data is consistent with the backup inventory data, updating device inventory data currently recorded in a local database based on the device in-out stock data; and if not, synchronizing the backup inventory data to the local database, and updating the device inventory data currently recorded in the local database based on the device input and output data. The accuracy of the device inventory data based on the warehouse can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of warehouse management. Specifically, it relates to a method, device, program product, and electronic device for maintaining device inventory data. Background Art

[0002] In the scenarios of oil extraction and maintenance, a variety of device types are needed, and the quantity is large. Especially in some large-scale scenarios of oil extraction and maintenance, the related devices that need to be warehoused include more than 600 major categories and more than 35,000 minor categories, not to mention the quantity. Currently, the actual inventory situation of devices in the warehouse is generally reflected by the device inventory data stored in the local database. When users (such as oil workers) take devices from the warehouse or store devices in the warehouse, they need to query the device inventory data from the local database to understand information such as which categories of devices are in stock in the warehouse, the quantity of devices, and the storage locations of devices. This can enhance the convenience of users taking and placing devices.

[0003] However, in actual work, sometimes there will be problems where the device inventory data stored in the local database is inaccurate due to misoperations by data administrators. In addition, since the access interface of the local database is open to the outside world, there is a risk that the device inventory data in the local database will be maliciously modified (that is, illegal users invade the local database based on the externally exposed local database access interface and maliciously tamper with the device inventory data in it). Especially in transnational oil and gas exploration projects, oil workers often come from different countries, and the personnel relationship is complex. The risk of device inventory data being tampered with is higher, which will also lead to inaccurate device inventory data stored in the local database. It can be understood that the consequence of inaccurate device inventory data is the chaos in device inventory data management, which affects the normal taking and placing of devices by users, and thus affects the rhythm and efficiency of oil production.

[0004] Based on this, how to ensure that the device inventory data can accurately reflect the actual inventory situation of devices in the warehouse, how to efficiently and accurately maintain the device inventory data, and improve the accuracy of the device inventory data based on the warehouse are technical problems that need to be solved urgently. Summary of the Invention

[0005] Embodiments of this application provide a method, device, computer program product, computer program, computer-readable storage medium, and electronic device for maintaining device inventory data, which can, to a certain extent, improve the accuracy of the device inventory data based on the warehouse.

[0006] Other features and advantages of this application will become apparent through the following detailed description, or be learned in part through the practice of this application.

[0007] According to one aspect of the embodiments of the present application, a method for maintaining device inventory data is provided. The method is executed on an inventory data management server, and the method includes: in response to the incoming and outgoing of devices, obtaining device incoming and outgoing data, and obtaining the device inventory data currently recorded in the local database as target inventory data; correspondingly obtaining backup inventory data from at least one backup database in a pre-set backup database cluster, where the backup inventory data is the device inventory data synchronized from the local database to the backup database after the last incoming and outgoing of devices; comparing whether the target inventory data is consistent with the backup inventory data; if the target inventory data is consistent with the backup inventory data, then based on the device incoming and outgoing data, updating the device inventory data currently recorded in the local database; if the target inventory data is inconsistent with the backup inventory data, then after synchronizing the backup inventory data to the local database, based on the device incoming and outgoing data, updating the device inventory data currently recorded in the local database.

[0008] In some embodiments of the present application, based on the foregoing solution, the correspondingly obtaining backup inventory data from at least one backup database in a pre-set backup database cluster includes: obtaining an access interface of the pre-set backup database cluster, where the access permission of the access interface is only open to the inventory data management server; based on the access interface, correspondingly obtaining backup inventory data from at least one backup database in the pre-set backup database cluster.

[0009] In some embodiments of the present application, based on the foregoing solution, both the local database and the backup database include a plurality of data storage units, where each data storage unit is used to correspond to the device inventory data of a certain category of devices; the obtaining the device inventory data currently recorded in the local database includes: according to the device category to which the incoming and outgoing devices belong, determining the target storage unit corresponding to the device category, and obtaining the device inventory data currently recorded in the target storage unit from the local database; the correspondingly obtaining backup inventory data from at least one backup database in a pre-set backup database cluster includes: correspondingly obtaining the device inventory data recorded in the target storage unit in at least one backup database from the pre-set backup database cluster as backup inventory data.

[0010] In some embodiments of the present application, based on the foregoing solution, comparing whether the target inventory data is consistent with the backup inventory data includes: obtaining a first attribute value of the target inventory data on a target data attribute and a second attribute value of the backup inventory data on the target data attribute; if the first attribute value and the second attribute value are the same, determining that the target inventory data is consistent with the backup inventory data; if the first attribute value and the second attribute value are different, determining that the target inventory data is inconsistent with the backup inventory data;

[0011] In some embodiments of the present application, based on the foregoing solution, comparing whether the target inventory data is consistent with the backup inventory data includes: performing hash processing on the target inventory data and the backup inventory data respectively to obtain a first hash value and a second hash value; if the first hash value and the second hash value are the same, determining that the target inventory data is consistent with the backup inventory data; if the first hash value and the second hash value are different, determining that the target inventory data is inconsistent with the backup inventory data;

[0012] In some embodiments of the present application, based on the foregoing solution, after updating the device inventory data currently recorded in the local database, the method further includes: synchronizing the updated device inventory data in the local database to each backup database in the pre-set backup database cluster.

[0013] In some embodiments of the present application, based on the foregoing solution, the method further includes: in response to a user's query request for the device inventory data recorded in the local database, obtaining the device inventory data currently recorded in the local database as the target inventory data; correspondingly obtaining backup inventory data from at least one backup database in the pre-set backup database cluster, where the backup inventory data is the device inventory data synchronized from the local database by the backup database after the last device inbound / outbound; comparing whether the target inventory data is consistent with the backup inventory data; if the target inventory data is consistent with the backup inventory data, feeding back the device inventory data currently recorded in the local database to the user; if the target inventory data is inconsistent with the backup inventory data, after synchronizing the backup inventory data to the local database, feeding back the device inventory data currently recorded in the local database to the user.

[0014] According to one aspect of the embodiments of the present application, a device inventory data maintenance device is provided. The device is disposed in an inventory data management server, and the device includes: a first acquisition unit, configured to acquire device in-out data in response to the in-out of a device, and acquire the device inventory data currently recorded in a local database as target inventory data; a second acquisition unit, configured to correspondingly acquire backup inventory data from at least one backup database in a pre-configured backup database cluster, where the backup inventory data is the device inventory data synchronized from the local database by the backup database after the last in-out of the device; a comparison unit, configured to compare whether the target inventory data is consistent with the backup inventory data; an update unit, configured to, if the target inventory data is consistent with the backup inventory data, update the device inventory data currently recorded in the local database based on the device in-out data; and if the target inventory data is inconsistent with the backup inventory data, after synchronizing the backup inventory data to the local database, update the device inventory data currently recorded in the local database based on the device in-out data.

[0015] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method described in the above embodiments.

[0016] According to one aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in the above embodiments is implemented.

[0017] According to one aspect of the embodiments of the present application, an electronic device is provided, including: one or more processors; a storage device, configured to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method described in the above embodiments.

[0018] Based on the technical solution proposed by the present application, after the in-out of the device in the warehouse, by comparing the device inventory data currently recorded in the local database and the backup inventory data in each backup database, it is verified whether the device inventory data in the local database is accurate, so as to ensure that the final device inventory data currently recorded in the local database is accurate, thereby ensuring the consistency between the device inventory data recorded in the local database and the device inventory situation in the warehouse, enabling the device inventory data to accurately reflect the actual inventory situation of the devices in the warehouse, efficiently and accurately maintaining the device inventory data, and improving the accuracy of the device inventory data based on the warehouse.

[0019] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and should not limit this application. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings herein are incorporated into the specification and form a part of this specification, showing embodiments consistent with this application, and are used together with the specification to explain the principles of this application. Obviously, the drawings in the following description are only some embodiments of this application, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts. In the drawings:

[0021] Figure 1 shows an architecture diagram of a device inventory data maintenance system according to an embodiment of this application;

[0022] Figure 2 shows a flowchart of a method for maintaining device inventory data according to an embodiment of this application;

[0023] Figure 3 shows a block diagram of a device inventory data maintenance apparatus according to an embodiment of this application;

[0024] Figure 4 shows a schematic structural diagram of a computer system of an electronic device suitable for implementing the embodiments of this application. DETAILED DESCRIPTION

[0025] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more complete and comprehensive, and will fully convey the concept of the example embodiments to those skilled in the art.

[0026] In addition, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. However, those skilled in the art will realize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of this application.

[0027] The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0028] The flowcharts shown in the accompanying drawings are only illustrative and not necessarily include all the content and operations / steps, nor are they necessarily executed in the described order. For example, some operations / steps can be decomposed, while some operations / steps can be combined or partially combined. Therefore, the actual execution order may change according to the actual situation.

[0029] It should be noted that: "a plurality of" mentioned in this article means two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned accompanying drawings are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the objects used in this way can be interchanged under appropriate circumstances so that the embodiments of this application described here can be implemented in an order other than those shown or described.

[0031] In some embodiments of this application, the proposed device inventory data maintenance solution can be applied to the management of device inventory data in the oil and gas extraction and maintenance scenarios. In the oil and gas extraction and maintenance scenarios, there are many categories of oil and gas extraction and maintenance devices (tools), such as underground devices, logging devices, drilling devices, and other maintenance devices. The underground devices can include sub-categories such as drill bits, drill strings, and core drill tools. The logging devices can include sub-categories such as ultrasonic logging tools, cable logging tools, and nuclear magnetic logging tools. The drilling devices can include sub-categories such as drill pipes and drill-stopping devices. The other maintenance devices can include sub-categories such as ventilation blowers, pyrolyzers, and risers.

[0032] First, this application combines Figure 1 to introduce the system framework for implementing the device inventory data maintenance solution. Please refer to Figure 1 which shows the architecture diagram of the device inventory data maintenance system according to an embodiment of this application.

[0033] As Figure 1 shown, the device inventory data maintenance system proposed in this application includes an inventory data management server 104. Among them, a local database is configured in the inventory data management server 104, and the local database is used to record device inventory data. In addition, the device inventory data maintenance system also includes a pre-configured backup database cluster 106. Among them, the pre-configured backup database cluster 106 includes a plurality of backup databases 107, and each backup database is used to store the device inventory data synchronized from the local database.

[0034] In some embodiments of the present application, as Figure 1 shown. When a user needs to retrieve a device from the warehouse or store a device in the warehouse, based on a user terminal (such as Figure 1 one or more of the smart phone 101, tablet computer 102, and portable computer 103 shown in

[0035] ), the device inventory data can be queried from the local database to understand information such as which categories of devices are in stock in the warehouse, the quantity of devices, and the storage location of the devices.

[0036] It should be noted that in the present application, the network 105 is a medium for providing a communication link between the user side and the inventory data management server 104, and between the inventory data management server 104 and the pre-configured backup database cluster 106. The network 105 can include various connection types, such as wired communication links, wireless communication links, and so on.

[0037] Specifically, for example. In the local database and the backup database, the device inventory data used to characterize the inventory situation of ultrasonic logging tools can be stored in one data storage unit, and the device inventory data used to characterize the inventory situation of drill bits can be stored in another data storage unit.

[0038] In the present application, the local database and the backup database are split into multiple data storage units, and each data storage unit is used to store the device inventory data corresponding to one category of devices. In fact, the device inventory data is classified and stored according to the categories of devices. The advantage is that it can standardize the storage structure of the device inventory data, ensure the orderliness of the device inventory data, and is beneficial to improving the efficiency of processing the device inventory data in subsequent data processing.

[0039] The implementation details of the technical solution of the embodiments of the present application are elaborated in detail below:

[0040] Figure 2 shows a flowchart of a method for maintaining device inventory data according to an embodiment of the present application. This method for maintaining device inventory data can be executed by a device with computing and processing capabilities. For example, the method is executed on the inventory data management server. Referring to Figure 2 shown, this method for maintaining device inventory data includes at least steps 210 to 250, which are introduced in detail as follows:

[0041] In step 210, in response to the incoming and outgoing of devices, obtain the device incoming and outgoing data, and obtain the device inventory data currently recorded in the local database as the target inventory data.

[0042] In this application, when a device is taken out of or put into the warehouse, device in-out data (i.e., the out-bound data or in-bound data of the device) can be obtained. Specifically, the device in-out data may include information such as the device category, device code, device quantity, and device in-out time of the in-out device.

[0043] In this application, in an embodiment where the local database includes multiple data storage units, the obtaining of the device inventory data currently recorded in the local database can be performed according to the following steps 211 to 212:

[0044] Step 211, determine the target storage unit corresponding to the device category according to the device category to which the in-out device belongs.

[0045] Step 212, obtain the device inventory data currently recorded in the target storage unit from the local database.

[0046] In this application, since the in-out device only belongs to one or several device categories, therefore, in the process of obtaining the device inventory data currently recorded in the local database, only the device inventory data needs to be obtained from the target storage unit corresponding to the device category to which the in-out device belongs, and the device inventory data corresponding to the in-out device can be obtained, without obtaining the full amount of device inventory data stored in the local database. In this way, the device inventory data that needs to be obtained can be accurately obtained, and at the same time, the data acquisition volume can be reduced, thereby reducing the data transmission volume, which is beneficial to improving the acquisition efficiency of the device inventory data.

[0047] Continue to refer to Figure 2 , in step 220, obtain the backup inventory data correspondingly from at least one backup database in the pre-configured backup database cluster, where the backup inventory data is the device inventory data synchronized from the local database to the backup database after the last device in-out.

[0048] In this application, in an embodiment where the backup database includes multiple data storage units, the obtaining of the backup inventory data correspondingly from at least one backup database in the pre-configured backup database cluster can be performed according to the following step 221:

[0049] Step 221, obtain the device inventory data recorded in the target storage unit in at least one backup database correspondingly from the pre-configured backup database cluster as the backup inventory data.

[0050] In this application, since the inbound and outbound devices only belong to one or several device categories, when obtaining the device inventory data recorded in each backup database, it is only necessary to obtain the device inventory data from the target storage unit corresponding to the device category to which the inbound and outbound devices belong in the backup database, so as to obtain the device inventory data corresponding to the inbound and outbound devices, without the need to obtain the full amount of device inventory data stored in the backup database. In this way, the required device inventory data can be accurately obtained, while reducing the amount of data acquisition, thereby reducing the amount of data transmission, which is beneficial to improving the acquisition efficiency of device inventory data.

[0051] In this application, the corresponding acquisition of backup inventory data from at least one backup database in the pre-set backup database cluster can be specifically executed according to the following steps 231 to step 232:

[0052] Step 231, obtain the access interface of the pre-set backup database cluster, and the access permission of the access interface is only open to the inventory data management server.

[0053] Step 232, based on the access interface, correspondingly obtain backup inventory data from at least one backup database in the pre-set backup database cluster.

[0054] In this application, it can be understood that since the access permission of the access interface of the pre-set backup database cluster is only open to the inventory data management server, only the inventory data management server can obtain the device inventory data from the backup database in the pre-set backup database cluster, and other access requests cannot access the pre-set backup database cluster. This ensures that illegal users cannot invade the backup database in the pre-set backup database cluster, and thus can largely avoid the device inventory data in the backup database from being misoperated or tampered with. Ensure the security of the device inventory data in the backup database.

[0055] In this application, for the backup database, the device inventory data stored therein is mainly obtained from the local database. Specifically, after each device inbound and outbound, the local database will synchronize the device inventory data stored in itself to the backup database. Since the device inventory data in the local database after device inbound and outbound is accurate, synchronizing the device inventory data in the local database to the backup database after device inbound and outbound can enable the backup database to retain accurate device inventory data, so as to facilitate subsequent verification of whether the device inventory data in the local database has been misoperated or tampered with.

[0056] Continue to refer to Figure 2 , in step 230, compare whether the target inventory data is consistent with the backup inventory data.

[0057] In the embodiments of the present application where the local database includes multiple data storage units, comparing the target inventory data with the backup inventory data is actually comparing the device inventory data of the target storage unit in the local database with the device inventory data of the target storage unit in the backup database. Therefore, the local database and the backup database are split into multiple data storage units, and the device inventory data of different types of devices are independently stored in the corresponding data storage units. When comparing the target inventory data with the backup inventory data, it is only necessary to compare whether the device inventory data corresponding to the device category to which the incoming and outgoing devices belong is consistent, without comparing all the data in the local database and the backup database. In this way, the amount of data to be compared is reduced, the computing load of computer comparison is reduced, and the data comparison efficiency is improved.

[0058] In Figure 2 In one embodiment of step 230 shown, comparing whether the target inventory data is consistent with the backup inventory data can be specifically performed according to the following steps 231 to 233:

[0059] Step 231, obtain a first attribute value of the target inventory data on a target data attribute and a second attribute value of the backup inventory data on the target data attribute.

[0060] Step 232, if the first attribute value and the second attribute value are the same, determine that the target inventory data is consistent with the backup inventory data.

[0061] Step 233, if the first attribute value and the second attribute value are different, determine that the target inventory data is inconsistent with the backup inventory data.

[0062] In the present application, the data attributes of the device inventory data may refer to the number of bytes of the data, the data size, etc.

[0063] Specifically, for example, obtaining a first attribute value of the target inventory data on a target data attribute and a second attribute value of the backup inventory data on the target data attribute may be obtaining a first number of bytes of the target inventory data on the number-of-bytes attribute and a second number of bytes of the backup inventory data on the number-of-bytes attribute. If the first number of bytes is equal to the second number of bytes, it can be determined to a certain extent that the target inventory data is consistent with the backup inventory data. If the first number of bytes is not equal to the second number of bytes, it can be definitely determined that the target inventory data is inconsistent with the backup inventory data.

[0064] In this embodiment, the advantage is that by comparing the attribute values of the target inventory data and the backup inventory data on a certain data attribute, it is not necessary to compare the specific content of the device inventory data. In this way, the amount of data to be compared is reduced, the load of computer comparison calculation is reduced, and at the same time, the data comparison efficiency can be improved.

[0065] In Figure 2 In another embodiment of step 230 shown above, to compare whether the target inventory data and the backup inventory data are consistent, it can be specifically executed according to the following steps 234 to step 236:

[0066] Step 234, perform hash processing on the target inventory data and the backup inventory data respectively to obtain a first hash value and a second hash value.

[0067] Step 235, if the first hash value and the second hash value are the same, it is determined that the target inventory data and the backup inventory data are consistent.

[0068] Step 236, if the first hash value and the second hash value are different, it is determined that the target inventory data and the backup inventory data are inconsistent.

[0069] Specifically, since the results after different data are processed by the hash algorithm are unique. Therefore, by performing hash processing on the target inventory data and the backup inventory data and comparing whether the obtained first hash value and second hash value are consistent, it can be accurately determined whether the target inventory data and the backup inventory data are consistent. At the same time, by comparing the hash values corresponding to the target inventory data and the backup inventory data, without having to compare the specific content of the device inventory data, the amount of data to be compared can also be reduced, the load of computer comparison calculation can be reduced, and at the same time, the data comparison efficiency can be improved.

[0070] Continue to refer to Figure 2 , in step 240, if the target inventory data and the backup inventory data are consistent, then based on the device incoming and outgoing data, update the device inventory data currently recorded in the local database.

[0071] In this application, since the backup inventory data in the backup database is synchronized from the local database after the last device incoming and outgoing, and there is no risk of misoperation or tampering with the device inventory data in the backup database, the device inventory data in the backup database has relatively reliable accuracy. Based on this, if the target inventory data and the backup inventory data are consistent, it means that the device inventory data in the local database has not been misoperated or tampered with, so the device inventory data currently recorded in the local database can be directly updated based on the device incoming and outgoing data.

[0072] Continue to refer to Figure 2 In step 250, if the target inventory data is inconsistent with the backup inventory data, after synchronizing the backup inventory data to the local database, based on the device in-out data, update the device inventory data currently recorded in the local database.

[0073] In this application, similarly, since the backup inventory data in the backup database is synchronized from the local database after the last device in-out, and there is no risk of misoperation or tampering with the device inventory data in the backup database, the device inventory data in the backup database has relatively reliable accuracy. Based on this, if the target inventory data is inconsistent with the backup inventory data, it means that the device inventory data in the local database has been misoperated or tampered with. At this time, it is necessary to synchronize the accurate backup inventory data in the backup database to the local database, and then based on the device in-out data, update the device inventory data currently recorded in the local database.

[0074] In this application, based on the device in-out data of the in-out devices, the device inventory data currently recorded in the local database can be updated. Specifically, for example, in a specific embodiment, after a certain type of device is out of stock, if the out-of-stock quantity is 8 pieces, then in the local database, the inventory quantity of this type of device will be reduced by 8 pieces. Another example is in another specific embodiment, after a certain type of device is in stock, if the in-stock quantity is 12 pieces, then in the local database, the inventory quantity of this type of device will be increased by 12 pieces.

[0075] Further, in this application, after updating the device inventory data currently recorded in the local database, the following step 261 can also be executed:

[0076] Step 261, synchronize the updated device inventory data in the local database to each backup database in the pre-configured backup database cluster.

[0077] In this application, since after the device in-out, the updated device inventory data in the local database is accurate, at this time, synchronizing the device inventory data in the local database to each backup database in the pre-configured backup database cluster can enable the backup database to retain relatively accurate device inventory data, so as to facilitate subsequent verification of whether the device inventory data in the local database has been misoperated or tampered with.

[0078] In this application, the following steps 271 to 275 can also be executed:

[0079] Step 271, in response to a user's query request for device inventory data recorded in the local database, obtain the device inventory data currently recorded in the local database as the target inventory data.

[0080] Step 272, obtain backup inventory data correspondingly from at least one backup database in the pre-configured backup database cluster, where the backup inventory data is the device inventory data synchronized from the local database to the backup database after the last device receipt and issue.

[0081] Step 273, compare whether the target inventory data is consistent with the backup inventory data.

[0082] Step 274, if the target inventory data is consistent with the backup inventory data, feedback the device inventory data currently recorded in the local database to the user.

[0083] Step 275, if the target inventory data is inconsistent with the backup inventory data, after synchronizing the backup inventory data to the local database, feedback the device inventory data currently recorded in the local database to the user.

[0084] In this application, when a user (such as an oil worker) needs to retrieve devices from the warehouse, they may access the local database in the inventory data management server to query the device inventory data, understand which categories of devices are in the warehouse, the quantity of each category of device, and the storage location of the devices, etc., in order to help the user make corresponding device retrieval plans. However, if the device inventory data in the local database is misoperated or tampered with, the device inventory data in the local database will bring incorrect references and bases to the user. For example, the user hopes to retrieve a cable logging tool to carry out a certain oil and gas exploration and maintenance work, and in fact, the cable logging tool also exists in the warehouse. However, because the device inventory data in the local database has been misoperated or tampered with, when the user queries the device inventory data, they learn the incorrect information that this category of device no longer exists in the warehouse. As a result, the user makes the decision not to retrieve devices from the warehouse temporarily and puts the oil and gas exploration and maintenance work on hold for the time being. It can be seen that this situation seriously affects the smooth progress of oil and gas exploration and maintenance work and also affects the user experience.

[0085] Based on this, in the present application, after a user sends a request to query device inventory data to the local database, by obtaining the target inventory data currently recorded in the local database and the backup inventory data in the backup database, and by comparing whether the target inventory data is consistent with the backup inventory data, to verify whether the device inventory data in the local database is accurate. If the target inventory data in the local database is inaccurate, after synchronizing the accurate backup inventory data to the local database, then the device inventory data currently recorded in the local database is fed back to the user, which can avoid the device inventory data in the local database from bringing incorrect references and bases to the user, can ensure the accuracy of the device inventory data fed back to the user, ensure the smooth progress of the user's work, and improve the user experience.

[0086] Based on the technical solution proposed in the present application, after the devices in the warehouse are received and dispatched, by comparing the device inventory data currently recorded in the local database and the backup inventory data in each backup database, to verify whether the device inventory data in the local database is accurate, so as to ensure that the final device inventory data currently recorded in the local database is accurate, thereby ensuring the consistency between the device inventory data recorded in the local database and the device inventory situation in the warehouse, enabling the device inventory data to accurately reflect the actual inventory situation of the devices in the warehouse, efficiently and accurately maintaining the device inventory data, and improving the accuracy of the device inventory data based on the warehouse.

[0087] The following introduces the device embodiments of the present application, which can be used to execute the device inventory data maintenance method in the above embodiments of the present application. For the details not disclosed in the device embodiments of the present application, please refer to the embodiments of the device inventory data maintenance method above of the present application.

[0088] Figure 3 The block diagram of a device inventory data maintenance device according to an embodiment of the present application is shown.

[0089] Refer to Figure 3 As shown, the device is set in the inventory data management server. The device inventory data maintenance device 300 according to an embodiment of the present application includes: a first acquisition unit 301, a second acquisition unit 302, a comparison unit 303, and an update unit 304.

[0090] Among them, the first acquisition unit 301 is configured to, in response to the incoming and outgoing of devices, acquire device incoming and outgoing data, and acquire the device inventory data currently recorded in the local database as target inventory data; the second acquisition unit 302 is configured to correspondingly acquire backup inventory data from at least one backup database in the pre-configured backup database cluster, where the backup inventory data is the device inventory data synchronized from the local database to the backup database after the last device incoming and outgoing; the comparison unit 303 is configured to compare whether the target inventory data is consistent with the backup inventory data; the update unit 304 is configured to, if the target inventory data is consistent with the backup inventory data, update the device inventory data currently recorded in the local database based on the device incoming and outgoing data; if the target inventory data is inconsistent with the backup inventory data, after synchronizing the backup inventory data to the local database, update the device inventory data currently recorded in the local database based on the device incoming and outgoing data.

[0091] In some embodiments of the present application, based on the foregoing solution, the second acquisition unit 302 is configured to: acquire an access interface of the pre-configured backup database cluster, where the access permission of the access interface is only open to the inventory data management server; based on the access interface, correspondingly acquire backup inventory data from at least one backup database in the pre-configured backup database cluster.

[0092] In some embodiments of the present application, based on the foregoing solution, both the local database and the backup database include a plurality of data storage units, where each data storage unit is used to correspond to the device inventory data of a certain type of device; the first acquisition unit 301 is configured to: according to the device type to which the incoming and outgoing devices belong, determine the target storage unit corresponding to the device type, and acquire the device inventory data currently recorded in the target storage unit from the local database; the second acquisition unit 302 is further configured to: correspondingly acquire the device inventory data recorded in the target storage unit in at least one backup database from the pre-configured backup database cluster as backup inventory data.

[0093] In some embodiments of the present application, based on the foregoing solution, the comparison unit 303 is configured to: acquire a first attribute value of the target inventory data on a target data attribute and a second attribute value of the backup inventory data on the target data attribute; if the first attribute value and the second attribute value are the same, determine that the target inventory data is consistent with the backup inventory data; if the first attribute value and the second attribute value are different, determine that the target inventory data is inconsistent with the backup inventory data;

[0094] In some embodiments of the present application, based on the foregoing solution, the comparison unit 303 is further configured to: perform hash processing on the target inventory data and the backup inventory data respectively to obtain a first hash value and a second hash value; if the first hash value is the same as the second hash value, determine that the target inventory data is consistent with the backup inventory data; if the first hash value is different from the second hash value, determine that the target inventory data is inconsistent with the backup inventory data;

[0095] In some embodiments of the present application, based on the foregoing solution, after updating the device inventory data currently recorded in the local database, the device further includes: a synchronization unit configured to synchronize the updated device inventory data in the local database to each backup database in the pre-configured backup database cluster.

[0096] In some embodiments of the present application, based on the foregoing solution, the device further includes: a feedback unit configured to, in response to a user's query request for the device inventory data recorded in the local database, obtain the device inventory data currently recorded in the local database as target inventory data; obtain corresponding backup inventory data from at least one backup database in the pre-configured backup database cluster, where the backup inventory data is the device inventory data synchronized from the local database by the backup database after the last device inbound / outbound; compare whether the target inventory data is consistent with the backup inventory data; if the target inventory data is consistent with the backup inventory data, feedback the device inventory data currently recorded in the local database to the user; if the target inventory data is inconsistent with the backup inventory data, after synchronizing the backup inventory data to the local database, feedback the device inventory data currently recorded in the local database to the user.

[0097] As another embodiment of the present application, there is also provided a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to execute the method described in the foregoing embodiments.

[0098] Based on the same inventive concept, an embodiment of the present application also provides an electronic device. Referring to Figure 4 , which shows a schematic structural diagram of the electronic device in the embodiment of the present application, the electronic device includes one or more memories 404, one or more processors 402, and at least one computer program (program code) stored on the memory 404 and executable on the processor 402. When the processor 402 executes the computer program, the method described above is implemented.

[0099] Among them, in Figure 4 , the bus architecture (represented by bus 400), bus 400 may include any number of interconnected buses and bridges. Bus 400 links together various circuits of one or more processors represented by processor 402 and a memory represented by memory 404. Bus 400 may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and thus will not be further described herein. Bus interface 405 provides an interface between bus 400 and receiver 401 and transmitter 403. Receiver 401 and transmitter 403 may be the same element, i.e., a transceiver, providing a unit for communicating with various other devices over a transmission medium. Processor 402 is responsible for managing bus 400 and general processing, while memory 404 may be used to store data used by processor 402 when performing operations.

[0100] As another embodiment of the present application, a computer-readable storage medium is also provided. The computer-readable storage medium may be included in the electronic device described in the above embodiment; or it may exist separately and not be assembled into the electronic device. The above computer-readable storage medium carries one or more programs. When the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.

[0101] The functions described herein may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. If implemented in software executed by a processor, the functions may be stored as one or more instructions or codes on a computer-readable medium or transmitted via a computer-readable medium. Other examples and implementations are within the scope and spirit of the present application and the appended claims. For example, due to the nature of software, the functions described above may be implemented using software executed by a processor, hardware, firmware, hardwiring, or any combination thereof. In addition, each functional unit may be integrated in one processing unit, or each unit may exist physically separately, or two or more units may be integrated in one unit.

[0102] In several embodiments provided by this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.

[0103] The units described as separate components may or may not be physically separated. The components serving as control devices may or may not be physical units, that is, they can be located in one place or distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0104] If 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 such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs and other various media that can store program codes.

[0105] The above is only the embodiments of this application and is not used to limit this application. For those skilled in the art, this application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included within the scope of the claims of this application.

Claims

1. A device inventory data maintenance method, characterized in that: The method is executed on an inventory data management server, and the method includes: In response to the entry and exit of the device, the device entry and exit data is obtained, and the device inventory data currently recorded in the local database is obtained as the target inventory data; Acquire corresponding backup inventory data from at least one backup database in a preset backup database cluster, wherein the backup inventory data is the device inventory data synchronized from the local database by the backup database after the last device entry and exit; Comparing the target inventory data with the backup inventory data to see whether they are consistent; If the target inventory data is consistent with the backup inventory data, then based on the device in-and-out data, updating the device inventory data currently recorded in the local database; If the target inventory data is inconsistent with the backup inventory data, after synchronizing the backup inventory data to the local database, the device inventory data currently recorded in the local database is updated based on the device in-and-out data.

2. The method according to claim 1, characterized in that The step of obtaining the backup inventory data from at least one backup database in the preset backup database cluster includes: Obtaining an access interface of a preset backup database cluster, wherein the access permission of the access interface is only open to the inventory data management server; Based on the access interface, the backup inventory data is correspondingly obtained from at least one backup database in a preset backup database cluster.

3. The method according to claim 1, characterized in that The local database and the backup database each include a plurality of data storage units, wherein each data storage unit is used for device inventory data corresponding to a category of devices; The step of obtaining the device inventory data currently recorded in the local database includes: Determine the target storage unit corresponding to the device category according to the device category to which the in-and-out devices belong, and obtain the device inventory data currently recorded in the target storage unit from the local database; The step of obtaining the backup inventory data from at least one backup database in the preset backup database cluster includes: The device inventory data recorded in the target storage unit in at least one backup database is correspondingly obtained from a preset backup database cluster as backup inventory data.

4. The method according to claim 1, characterized in that: The comparing whether the target inventory data is consistent with the backup inventory data includes: Acquire a first attribute value of the target inventory data on a target data attribute and a second attribute value of the backup inventory data on a target data attribute; If the first attribute value and the second attribute value are the same, determining that the target inventory data is consistent with the backup inventory data; If the first attribute value and the second attribute value are not the same, it is determined that the target inventory data is inconsistent with the backup inventory data.

5. The method according to claim 1, characterized in that The comparing whether the target inventory data is consistent with the backup inventory data includes: Performing hash processing on the target inventory data and the backup inventory data respectively to obtain a first hash value and a second hash value; If the first Hash value and the second Hash value are the same, it is determined that the target inventory data is consistent with the backup inventory data; If the first hash value and the second hash value are not identical, it is determined that the target inventory data is inconsistent with the backup inventory data.

6. The method according to claim 1, characterized in that After updating the device inventory data currently recorded in the local database, the method further includes: The updated device inventory data in the local database is synchronized to each backup database in the preset backup database cluster.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: In response to a user's query request for device inventory data recorded in a local database, obtaining the device inventory data currently recorded in the local database as target inventory data; Acquire corresponding backup inventory data from at least one backup database in a preset backup database cluster, wherein the backup inventory data is the device inventory data synchronized from the local database by the backup database after the last device entry and exit; Comparing the target inventory data with the backup inventory data to see whether they are consistent; If the target inventory data is consistent with the backup inventory data, the device inventory data currently recorded in the local database is fed back to the user; If the target inventory data is inconsistent with the backup inventory data, after synchronizing the backup inventory data to the local database, the device inventory data currently recorded in the local database is fed back to the user.

8. A device for maintaining device inventory data, characterized in that: The device is arranged on an inventory data management server, and comprises: A first acquisition unit is used to acquire device in-and-out data in response to device in-and-out storage, and acquire device inventory data currently recorded in a local database as target inventory data; A second acquisition unit is used to obtain backup inventory data from at least one backup database in a preset backup database cluster, wherein the backup inventory data is the device inventory data synchronized from the local database by the backup database after the device is last put in and taken out of the warehouse; A comparison unit, used for comparing whether the target inventory data is consistent with the backup inventory data; An updating unit is used to update the device inventory data currently recorded in the local database based on the device in-and-out data if the target inventory data is consistent with the backup inventory data; if the target inventory data is inconsistent with the backup inventory data, after synchronizing the backup inventory data to the local database, update the device inventory data currently recorded in the local database based on the device in-and-out data.

9. A computer program product, characterized in that The computer program product comprises computer instructions which are stored in a computer-readable storage medium and are suitable for being read and executed by a processor, so as to enable a computer device having the processor to perform the method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: The electronic device includes one or more processors and one or more memories, wherein the one or more memories store at least one program code, and the at least one program code is loaded and executed by the one or more processors to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Warehouse in and out report transmission, inventory information updating method and apparatus

    CN106980948A

  • An inventory data management and synchronization method and device, and readable storage medium

    CN112416952A

  • Database cluster backup system

    CN115202929A

  • Inventory data updating method and device, equipment and medium

    CN118096011A