Data extraction method and device based on business system and storage medium
By adding binding dates and constructing a tree structure to the binding relationship between nodes and monitoring devices, the problem of data extraction errors in the business system was solved, and the accuracy of data extraction and the simplification of operation were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHUHAI PILOT TECH
- Filing Date
- 2021-12-10
- Publication Date
- 2026-05-19
AI Technical Summary
In existing technologies, the chaotic binding relationship between monitoring devices and nodes leads to errors in data extraction and complex operations in business systems. This is especially true in hotel business systems, where it is difficult to accurately obtain historical data when node binding changes.
By adding a binding date to the binding relationship between nodes and monitoring devices, binding records are generated and stored in the system. Monitoring devices are matched according to the extraction time, and a tree structure of nodes is constructed. The priority is determined by the node depth, thereby achieving the accuracy of data extraction.
Ensuring the accuracy of data extraction simplifies the operation process, reduces errors, and improves the efficiency and accuracy of data extraction.
Smart Images

Figure CN114416834B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to data processing, and more particularly to a data extraction method, apparatus, and storage medium based on a business system. Background Technology
[0002] In existing energy consumption monitoring systems, the chaotic binding relationships between monitoring devices and nodes easily lead to erroneous monitoring data when extracting historical data. For example, in a hotel's business system, when the monitoring instrument bound to a room changes, extracting data based on nodes can easily result in incorrect data. Each extraction requires setting parameters, such as specifying the monitoring instrument to be extracted, to ensure data accuracy, which is cumbersome and inconvenient for future use. Summary of the Invention
[0003] In order to overcome the shortcomings of the prior art, one of the objectives of this invention is to provide a data extraction method based on a business system, which can solve the problems of complex data extraction operations in the prior art.
[0004] The second objective of this invention is to provide a data extraction device based on a business system, which can solve the problems of complex data extraction operations in existing technologies.
[0005] The third objective of this invention is to provide a storage medium that can solve problems such as the complexity of data extraction operations in existing business systems.
[0006] One of the objectives of this invention is achieved through the following technical solution:
[0007] The data extraction method based on the business system includes the following steps:
[0008] Configuration steps: Determine all nodes of the business system based on the business system and construct a tree structure of the nodes based on the business system; determine the monitoring device bound to each node of the business system based on the business system and generate a binding record for each node based on the monitoring device bound to each node and the current binding date, and store it in the system;
[0009] Steps to obtain nodes: Obtain all nodes to be extracted and the extraction time, and extract each node from all nodes to be extracted in sequence according to node priority;
[0010] Binding determination steps: Determine whether each node is bound to a monitoring device. If yes, execute the direct acquisition step; otherwise, execute the indirect acquisition step.
[0011] Direct acquisition steps: Obtain the monitoring device bound to each node according to the extraction time, and then obtain the monitoring data of the corresponding node according to the monitoring device bound to each node;
[0012] Indirect acquisition steps: Determine whether each node has child nodes. If so, acquire the monitoring data of each child node of each node to obtain the monitoring data of the corresponding node; otherwise, the monitoring data of the corresponding node is empty.
[0013] Furthermore, it also includes: a binding record update step: obtaining the node to be updated and the new monitoring device bound to the node to be updated, and generating a new binding record based on the new monitoring device bound to the node to be updated and the current binding date, and storing it in the system.
[0014] Furthermore, it also includes: a node update step: obtaining the new node and determining the position of the new node in the tree structure, adding it to the tree structure, and then generating a binding record for the new node based on the monitoring device bound to the new node and the current binding date, and storing it in the system.
[0015] Furthermore, the indirect acquisition step of acquiring monitoring data for a child node specifically includes:
[0016] First, determine whether the child node is bound to a monitoring device. If so, obtain the monitoring data of the child node by acquiring the monitoring device bound to the child node based on the extraction time. If not, obtain the monitoring data of the child node based on the monitoring data of all its child nodes.
[0017] Furthermore, the node priority is determined by the node's depth in the tree structure; wherein, the greater the node's depth in the tree structure, the lower its priority.
[0018] Furthermore, the binding record includes a node and a binding date; each node corresponds to several binding records.
[0019] Furthermore, the number of monitoring devices in the binding record is any one of the following: one or more.
[0020] Furthermore, it also includes: statistical steps: classifying, statistically analyzing, and storing the monitoring data of all nodes that need to be extracted.
[0021] The second objective of this invention is achieved by the following technical solution:
[0022] A data extraction device based on a business system includes a memory and a processor. The memory stores a data extraction program that runs on the processor. The data extraction program is a computer program. When the processor executes the data extraction program, it implements the steps of a data extraction method based on a business system as one of the objectives of this invention.
[0023] The third objective of this invention is achieved by the following technical solution:
[0024] A storage medium, which is a computer-readable storage medium, stores a computer program thereon, the computer program being a data extraction program, which, when executed by a processor, implements the steps of a data extraction method based on a business system as one of the objectives of this invention.
[0025] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0026] This invention adds a binding date to the binding relationship between nodes and monitoring devices. When extracting data, all nodes are traversed, and the monitoring device of each node is retrieved according to the range of extraction time, thereby obtaining the monitoring data of each node. This ensures the accuracy of data extraction and solves the problem of data extraction errors caused by changes in the monitoring device bound to a node in the prior art. Attached Figure Description
[0027] Figure 1 Flowchart of the data extraction method based on a business system provided by the present invention;
[0028] Figure 2 A tree structure diagram of nodes in the data extraction method based on a business system provided by the present invention;
[0029] Figure 3 for Figure 1 The flowchart for step S7. Detailed Implementation
[0030] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments. It should be noted that, without conflict, the various embodiments or technical features described below can be arbitrarily combined to form new embodiments.
[0031] Example 1
[0032] To address the accuracy issue in data extraction from existing business systems, this invention modifies the static binding relationship between nodes and monitoring devices into a time-segmented table format. Specifically, a binding date is added to the binding relationship between each node and monitoring device, and this binding relationship is stored in the system. When data extraction is needed, the corresponding monitoring device for each node is retrieved based on the extraction time range, ensuring the accuracy of data extraction.
[0033] This invention provides a preferred embodiment, such as... Figure 1 As shown, a data extraction method based on a business system includes the following steps:
[0034] Step S1: Determine all nodes of the business system based on the business system, determine the monitoring device bound to each node of the business system based on the business system, and generate the binding relationship of each node based on the monitoring device bound to each node and the current binding date, and store it in the system.
[0035] In this embodiment, a node refers to a node in the business system that requires statistical data. For example, in a hotel's business system, a node could be the hotel itself, or each room, etc. Monitoring equipment refers to monitoring instruments, and the monitored data is electricity consumption. For example, the total electricity consumption of the hotel and the electricity consumption of each room can be monitored by binding corresponding monitoring instruments.
[0036] When business requirements change, the monitoring instruments associated with hotel rooms may also change, which can easily lead to data extraction errors later. For example, for room B101, the business requirements are as follows:
[0037] Room B101 was bound to monitoring instrument A on September 1, 2021; however, on September 20, 2021, room B101 underwent a change, with monitoring instrument A and monitoring instrument B being bound to it.
[0038] When data needs to be extracted from room B101, the system has difficulty determining whether to select monitoring data from monitoring instrument A, monitoring data from monitoring instrument B, or both monitoring data from monitoring instrument A and monitoring instrument B.
[0039] Therefore, this invention adds a binding date to the existing binding relationship between nodes and monitoring devices, and stores the corresponding binding record in the system. This way, even if the monitoring device bound to a node changes, during subsequent data extraction, only the data extraction time needs to be added. The binding relationship and the time are used to match and determine the monitoring device bound to the node, thus ensuring accurate extraction of historical data. Table 1 shows the monitoring instruments bound to each room in Building A and Building B of the XX Hotel:
[0040]
[0041] Table 1
[0042] For the business system of XX Hotel, the nodes of the business system may include: XX Hotel, Building A, Building B, First Floor, Second Floor, Room A101, Room A102, Room B101, Room B102, Room B201, Room B202, Room B203, etc., as shown in Table 1, which lists some of the nodes of the business system and their corresponding bound devices. Room B101 was bound to monitoring instrument A on September 1, 2019, and monitoring instrument B was bound on September 20, 2019. Thus, when extracting data subsequently, it is only necessary to select the power consumption of the corresponding bound monitoring instrument based on the extraction time to achieve data extraction. For example, when the extraction time is before September 20, 2021, only the power consumption of monitoring instrument A needs to be calculated; while when the extraction time is after September 20, 2021, the power consumption of both monitoring instrument A and monitoring instrument B needs to be calculated simultaneously. Preferably, each row in Table 1 corresponds to a binding record. By storing the binding relationship of each change in the system through the binding record, even if historical data needs to be obtained later, only the time needs to be extracted to correctly select the corresponding monitoring device to obtain the monitoring data.
[0043] In this embodiment, the binding record includes at least one node and one binding date. One node can correspond to several binding records, and different binding records have different binding dates. Each node can be bound to a monitoring device, or it can be unbound, or it can be bound to multiple monitoring devices. For example, node A101 room can be bound to one monitoring instrument F, node 101 floor can be unbound, and node B101 room can be bound to one monitoring instrument A and one monitoring instrument B. For nodes unbound to monitoring devices, their monitoring data can be obtained from their child nodes.
[0044] In addition, in the business system, each monitoring device records monitoring data to the system's database in real time during operation.
[0045] Preferably, to facilitate node retrieval, this embodiment also constructs a tree structure of nodes based on the relationships between all nodes in the business system, so as to facilitate subsequent retrieval of all nodes, such as... Figure 2 The image shows the tree structure of each node in the XX Hotel's business system.
[0046] Step S2: Obtain all nodes to be extracted and the extraction time, and select one node from all nodes to be extracted in order according to node priority as the node to be retrieved, and then execute step S3.
[0047] Since there may be more than one node to extract, and the extraction time also needs to be set during data extraction, the extraction time should be set according to the extraction requirements.
[0048] Node priority is determined by the node's depth within the tree structure. The greater the node's depth within the tree structure, the lower its priority.
[0049] By setting up a tree structure, subsequent traversal of nodes can be facilitated.
[0050] Step S3: Determine whether the node to be searched is bound to a monitoring device. If yes, proceed to step S4; otherwise, proceed to step S5.
[0051] Step S4: Obtain the monitoring device bound to the node to be searched based on the extraction time, and then obtain the monitoring data of the node to be searched based on the monitoring device bound to the node to be searched, and then execute step S7.
[0052] Step S5: Determine if the node to be searched has child nodes. If it does, proceed to step S6; otherwise, the monitoring data of the node to be searched is empty, and proceed to step S7. When a node has neither a bound monitoring device nor child nodes, its monitoring data is considered empty.
[0053] Step S6: Obtain the monitoring data of each child node of the node to be searched and derive the monitoring data of the node to be searched. Then proceed to step S7.
[0054] In other words, when a node is not bound to a monitoring device, the monitoring data of its child nodes can be used as the monitoring data of that node.
[0055] Step S7: Take the next node from all the nodes that need to be extracted as the node to be retrieved, and execute step S3.
[0056] The data extraction process continues until all nodes to be extracted have been traversed. Once all nodes to be extracted have been traversed, the data extraction is complete.
[0057] Preferably, the present invention further classifies, statistically analyzes, and stores the monitoring data of all nodes after extraction.
[0058] Preferably, this embodiment can also update the monitoring devices bound to the node. That is, the invention further includes: obtaining the node to be updated and the new monitoring devices bound to the node to be updated, and generating a new binding record based on the new monitoring devices bound to the node to be updated and the current binding date, and storing it in the system. In this way, the node will correspond to multiple binding records in the system, and when extracting monitoring data, the corresponding monitoring device is selected for data extraction based on the extraction time.
[0059] Preferably, in this embodiment, updating the monitoring device bound to a node will not affect the monitoring devices bound to its parent node or child node. That is, the system only needs to add the binding record of that node.
[0060] Preferably, when obtaining the monitoring data bound to a child node in step S7, such as Figure 3 As shown, the present invention further includes:
[0061] Step S71: Determine whether the child node is bound to the monitoring device. If yes, proceed to step S72; otherwise, proceed to step S73.
[0062] Step S72: Based on the extraction time, collect the monitoring data of the monitoring device bound to the sub-node, and then obtain the monitoring data of the sub-node.
[0063] Step S73: Determine whether the child node has any child nodes. If it does, proceed to step S74; otherwise, the monitoring data of the child node is 0.
[0064] Step S74: Obtain all child nodes of the child node, and obtain the monitoring data of the child node based on the monitoring device bound to each child node.
[0065] In other words, the data extraction process for each child node is the same as that for each node. When a child node is not bound to a monitoring device, its monitoring data can be obtained from the monitoring data of all its child nodes. When a child node is bound to a monitoring device, its monitoring data is directly obtained from the monitoring device it is bound to.
[0066] Preferably, this embodiment can also expand the nodes. When a new node needs to be added to the system, the present invention further includes: acquiring the new node and determining the position of the new node in the tree structure, adding it to the tree structure, and then generating a binding record for the new node according to the monitoring device bound to the new node and the current binding date, and storing it in the system.
[0067] Example 2
[0068] A data extraction device based on a business system includes a memory and a processor. The memory stores a data extraction program that runs on the processor. The data extraction program is a computer program. When the processor executes the data extraction program, it performs the following steps:
[0069] Configuration steps: Determine all nodes of the business system based on the business system and construct a tree structure of the nodes based on the business system; determine the monitoring device bound to each node of the business system based on the business system and generate a binding record for each node based on the monitoring device bound to each node and the current binding date, and store it in the system;
[0070] Steps to obtain nodes: Obtain all nodes to be extracted and the extraction time, and extract each node from all nodes to be extracted in sequence according to node priority;
[0071] Binding determination steps: Determine whether each node is bound to a monitoring device. If yes, execute the direct acquisition step; otherwise, execute the indirect acquisition step.
[0072] Direct acquisition steps: Obtain the monitoring device bound to each node according to the extraction time, and then obtain the monitoring data of the corresponding node according to the monitoring device bound to each node;
[0073] Indirect acquisition steps: Determine whether each node has child nodes. If so, acquire the monitoring data of each child node of each node to obtain the monitoring data of the corresponding node; otherwise, the monitoring data of the corresponding node is empty.
[0074] Furthermore, it also includes: a binding record update step: obtaining the node to be updated and the new monitoring device bound to the node to be updated, and generating a new binding record based on the new monitoring device bound to the node to be updated and the current binding date, and storing it in the system.
[0075] Furthermore, it also includes: a node update step: obtaining the new node and determining the position of the new node in the tree structure, adding it to the tree structure, and then generating a binding record for the new node based on the monitoring device bound to the new node and the current binding date, and storing it in the system.
[0076] Furthermore, the indirect acquisition step of acquiring monitoring data for a child node specifically includes:
[0077] First, determine whether the child node is bound to a monitoring device. If so, obtain the monitoring data of the child node by acquiring the monitoring device bound to the child node based on the extraction time. If not, obtain the monitoring data of the child node based on the monitoring data of all its child nodes.
[0078] Furthermore, the node priority is determined by the node's depth in the tree structure; wherein, the greater the node's depth in the tree structure, the lower its priority.
[0079] Furthermore, the binding record includes a node and a binding date; each node corresponds to several binding records.
[0080] Furthermore, the number of monitoring devices in the binding record is any one of the following: one or more.
[0081] Furthermore, it also includes: statistical steps: classifying, statistically analyzing, and storing the monitoring data of all nodes that need to be extracted.
[0082] Example 3
[0083] A storage medium, which is a computer-readable storage medium, stores a computer program thereon, the computer program being a data extraction program, which, when executed by a processor, performs the following steps:
[0084] Configuration steps: Determine all nodes of the business system based on the business system and construct a tree structure of the nodes based on the business system; determine the monitoring device bound to each node of the business system based on the business system and generate a binding record for each node based on the monitoring device bound to each node and the current binding date, and store it in the system;
[0085] Steps to obtain nodes: Obtain all nodes to be extracted and the extraction time, and extract each node from all nodes to be extracted in sequence according to node priority;
[0086] Binding determination steps: Determine whether each node is bound to a monitoring device. If yes, execute the direct acquisition step; otherwise, execute the indirect acquisition step.
[0087] Direct acquisition steps: Obtain the monitoring device bound to each node according to the extraction time, and then obtain the monitoring data of the corresponding node according to the monitoring device bound to each node;
[0088] Indirect acquisition steps: Determine whether each node has child nodes. If so, acquire the monitoring data of each child node of each node to obtain the monitoring data of the corresponding node; otherwise, the monitoring data of the corresponding node is empty.
[0089] Furthermore, it also includes: a binding record update step: obtaining the node to be updated and the new monitoring device bound to the node to be updated, and generating a new binding record based on the new monitoring device bound to the node to be updated and the current binding date, and storing it in the system.
[0090] Furthermore, it also includes: a node update step: obtaining the new node and determining the position of the new node in the tree structure, adding it to the tree structure, and then generating a binding record for the new node based on the monitoring device bound to the new node and the current binding date, and storing it in the system.
[0091] Furthermore, the indirect acquisition step of acquiring monitoring data for a child node specifically includes:
[0092] First, determine whether the child node is bound to a monitoring device. If so, obtain the monitoring data of the child node by acquiring the monitoring device bound to the child node based on the extraction time. If not, obtain the monitoring data of the child node based on the monitoring data of all its child nodes.
[0093] Furthermore, the node priority is determined by the node's depth in the tree structure; wherein, the greater the node's depth in the tree structure, the lower its priority.
[0094] Furthermore, the binding record includes a node and a binding date; each node corresponds to several binding records.
[0095] Furthermore, the number of monitoring devices in the binding record is any one of the following: one or more.
[0096] Furthermore, it also includes: statistical steps: classifying, statistically analyzing, and storing the monitoring data of all nodes that need to be extracted.
[0097] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.
Claims
1. A data extraction method based on a business system, characterized in that, The data extraction method includes the following steps: Configuration steps: Determine all nodes of the business system based on the business system and construct a tree structure of nodes based on the business system; determine the monitoring devices bound to each node of the business system based on the business system and generate a binding record for each node based on the monitoring devices bound to each node and the current binding date, and store it in the system; wherein, each node corresponds to several binding records, and the binding dates of different binding records are different; Steps to obtain nodes: Obtain all nodes to be extracted and the extraction time, and extract each node from all nodes to be extracted in sequence according to node priority; Binding determination steps: Determine whether each node is bound to a monitoring device. If yes, execute the direct acquisition step; otherwise, execute the indirect acquisition step. Direct acquisition steps: Obtain the monitoring device bound to each node according to the extraction time, and then obtain the monitoring data of the corresponding node according to the monitoring device bound to each node; Indirect acquisition steps: Determine if each node has child nodes. If so, acquire the monitoring data of each child node of each node to obtain the monitoring data of the corresponding node; otherwise, the monitoring data of the corresponding node is empty. The indirect acquisition step of acquiring monitoring data for a child node specifically includes: First, determine whether the child node is bound to a monitoring device. If so, obtain the monitoring data of the child node by acquiring the monitoring device bound to the child node based on the extraction time. If not, obtain the monitoring data of the child node based on the monitoring data of all its child nodes.
2. The data extraction method based on a business system according to claim 1, characterized in that, Also includes: Binding record update steps: Obtain the node to be updated and the new monitoring device bound to the node to be updated, and generate a new binding record based on the new monitoring device bound to the node to be updated and the current binding date, and store it in the system.
3. The data extraction method based on a business system according to claim 1, characterized in that, Also includes: Node update steps: Obtain the new node and determine its position in the tree structure, add it to the tree structure, and then generate and store the binding record of the new node in the system based on the monitoring device it is bound to and the current binding date.
4. The data extraction method based on a business system according to claim 1, characterized in that, The node priority is determined by the node's depth in the tree structure; the greater the node's depth in the tree structure, the lower its priority.
5. The data extraction method based on a business system according to claim 1, characterized in that, The binding record includes a node and a binding date; each node corresponds to several binding records.
6. The data extraction method based on a business system according to claim 1, characterized in that, The number of monitoring devices in the binding record is any one of the following: one or more.
7. The data extraction method based on a business system according to claim 1, characterized in that, Also includes: Statistical steps: Classify, statistically analyze, and store the monitoring data of all nodes that need to be extracted.
8. A data extraction device based on a business system, comprising a memory and a processor, wherein the memory stores a data extraction program that runs on the processor, the data extraction program being a computer program, characterized in that: When the processor executes the data extraction program, it implements the steps of the data extraction method based on the business system as described in any one of claims 1-7.
9. A storage medium, said storage medium being a computer-readable storage medium, having stored thereon a computer program, said computer program being a data extraction program, characterized in that: When the data extraction program is executed by the processor, it implements the steps of the data extraction method based on the business system as described in any one of claims 1-7.