


技术领域technical field
本发明涉及数据处理,尤其涉及一种基于业务系统的数据抽取方法、装置及存储介质。The present invention relates to data processing, in particular to a data extraction method, device and storage medium based on a business system.
背景技术Background technique
对于现有的能耗监控业务中,由于监测设备与节点绑定关系混乱的原因,导致在后续抽取历史数据时,很容易出现错误的监测数据。比如,对于酒店的业务系统来说,当一个房间所绑定的监测仪表发生变化时,如果还是按照节点来进行数据抽取时,很容易导致抽取的数据出现错误。在每次进行抽取时,都需要对抽取数据的参数进行设置,比如指定抽取数据的监测仪表,才能保证抽取的数据正确,操作繁琐,不利于后续使用。For the existing energy consumption monitoring business, due to the confusing binding relationship between monitoring equipment and nodes, it is easy to generate wrong monitoring data when historical data is subsequently extracted. For example, for the business system of a hotel, when the monitoring instrument bound to a room changes, if the data extraction is still performed according to the node, it is easy to cause errors in the extracted data. In each extraction, the parameters of the extracted data need to be set, such as specifying the monitoring instrument for extracting the data, in order to ensure that the extracted data is correct, the operation is cumbersome, and it is not conducive to subsequent use.
发明内容SUMMARY OF THE INVENTION
为了克服现有技术的不足,本发明的目的之一在于提供基于业务系统的数据抽取方法,其能够解决现有技术中业务系统的数据抽取操作复杂等问题。In order to overcome the deficiencies of the prior art, one of the purposes of the present 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 business system in the prior art.
本发明的目的之二在于提供基于业务系统的数据抽取装置,其能够解决现有技术中业务系统的数据抽取操作复杂等问题。The second purpose of the present invention is to provide a data extraction device based on a business system, which can solve the problems of complex data extraction operations in the business system in the prior art.
本发明的目的之三在于提供一种存储介质,其能够解决现有技术中业务系统的数据抽取操作复杂等问题。The third object of the present invention is to provide a storage medium, which can solve the problems of complex data extraction operations in business systems in the prior art.
本发明的目的之一采用如下技术方案实现:One of the objects of the present invention adopts the following technical scheme to realize:
基于业务系统的数据抽取方法,所述数据抽取方法包括以下步骤:A data extraction method based on a business system, the data extraction method includes the following steps:
配置步骤:根据业务系统确定业务系统的所有节点并根据业务系统构建节点的树形结构,以及根据所述业务系统确定业务系统的每个节点所绑定的监测设备并根据每个节点所绑定的监测设备、当前的绑定日期生成每个节点的绑定记录并存储于系统中;Configuration step: determine all nodes of the business system according to the business system and build a tree structure of nodes according to the business system, and determine the monitoring equipment bound to each node of the business system according to the business system and bind according to each node. The monitoring equipment and the current binding date generate the binding records of each node and store them in the system;
获取节点步骤:获取需要抽取的所有节点及抽取时间,并按照节点优先级从需要抽取的所有节点中依次取出每个节点;Steps of obtaining nodes: obtain all the nodes to be extracted and the extraction time, and sequentially extract each node from all the nodes to be extracted according to the node priority;
绑定判断步骤:判断每个节点是否绑定监测设备,若是,则执行直接获取步骤;若否,则执行间接获取步骤;Binding judgment step: judge whether each node is bound to a monitoring device, if so, execute the direct acquisition step; if not, execute the indirect acquisition step;
直接获取步骤:根据所述抽取时间获取每个节点所绑定的监测设备,进而根据每个节点所绑定的监测设备得出对应节点的监测数据;The direct obtaining step: obtaining the monitoring equipment bound to each node according to the extraction time, and then obtaining the monitoring data of the corresponding node according to the monitoring equipment bound to each node;
间接获取步骤:判断每个节点是否有子节点,若是,则获取每个节点的每个子节点的监测数据进而得出对应节点的监测数据;若否,对应节点的监测数据为空。Indirect acquisition step: determine whether each node has child nodes, if so, obtain the monitoring data of each child node of each node to obtain the monitoring data of the corresponding node; if not, the monitoring data of the corresponding node is empty.
进一步地,还包括:绑定记录更新步骤:获取待更新节点以及所述待更新节点所绑定的新的监测设备,并根据所述待更新节点所绑定的新的监测设备、当前的绑定日期生成新的绑定记录并存储于系统中。Further, it also includes: a binding record update step: acquiring the node to be updated and the new monitoring device bound to the node to be updated, and according to the new monitoring device bound to the node to be updated, the current binding A new binding record is generated on a fixed date and stored in the system.
进一步地,还包括:节点更新步骤:获取新增节点并确定所述新增节点在所述树形结构中的位置,并将其加入到所述树形结构中,然后根据所述新增节点所绑定的监测设备、当前的绑定日期生成所述新增节点的绑定记录并存储于系统中。Further, it also includes: a node update step: acquiring a new node and determining the position of the new node in the tree structure, adding it to the tree structure, and then according to the new node The bound monitoring device and the current binding date generate a binding record of the newly added node and store it in the system.
进一步地,所述间接获取步骤中获取一个子节点的监测数据具体包括:Further, obtaining the monitoring data of a child node in the indirect obtaining step specifically includes:
首先判断该子节点是否绑定监测设备,若是,则根据所述抽取时间获取该子节点所绑定的监测设备得出该子节点的监测数据;若否,则根据该子节点的所有子节点的监测数据得出该子节点的监测数据。First, determine whether the child node is bound to a monitoring device, if so, obtain the monitoring device bound to the child node according to the extraction time to obtain the monitoring data of the child node; if not, according to all child nodes of the child node The monitoring data of the child node is obtained.
进一步地,所述节点优先级是由节点在树形结构中的深度来确定;其中,节点在树形结构中的深度越大,优先级越小。Further, the node priority is determined by the depth of the node in the tree structure; wherein, the greater the depth of the node in the tree structure, the smaller the priority.
进一步地,所述绑定记录包括一个节点和一个绑定日期;每个节点对应若干条绑定记录。Further, the binding record includes a node and a binding date; each node corresponds to several binding records.
进一步地,所述绑定记录中的监测设备的数量为以下数量中的任意一个:0个、1个或多个。Further, the number of monitoring devices in the binding record is any one of the following numbers: 0, 1 or more.
进一步地,还包括:统计步骤:对需要抽取的所有节点的监测数据进行分类统计并存储。Further, the method also includes: a statistical step: classifying and storing the monitoring data of all nodes that need to be extracted.
本发明的目的之二采用如下技术方案实现:The second purpose of the present invention adopts the following technical scheme to realize:
基于业务系统的数据抽取装置,包括存储器和处理器,所述存储器上存储有在处理器上运行的数据抽取程序,所述数据抽取程序为计算机程序,所述处理器执行所述数据抽取程序时实现如本发明的目的之一采用的基于业务系统的数据抽取方法的步骤。A data extraction device based on a business system includes a memory and a processor, the memory stores a data extraction program running on the processor, the data extraction program is a computer program, and when the processor executes the data extraction program The steps of the data extraction method based on the business system adopted as one of the objectives of the present invention are realized.
本发明的目的之三采用如下技术方案实现:The third purpose of the present invention adopts the following technical scheme to realize:
一种存储介质,所述存储介质为计算机可读存储介质,其上存储有计算机程序,所述计算机程序为数据抽取程序,所述数据抽取程序被处理器执行时如本发明的目的之一采用的基于业务系统的数据抽取方法的步骤。A storage medium, the storage medium is a computer-readable storage medium on which a computer program is stored, the computer program is a data extraction program, and when the data extraction program is executed by a processor, it is adopted as one of the objects of the present invention The steps of the data extraction method based on the business system.
相比现有技术,本发明的有益效果在于:Compared with the prior art, the beneficial effects of the present invention are:
本发明通过将节点与监测设备的绑定关系中增加绑定日期,这样在进行数据抽取时,通过对所有节点进行遍历,并根据抽取时间的范围来检索到每个节点的监测设备,从而获取每个节点的监测数据,保证数据抽取的准确性,解决现有技术中由于节点绑定的监测设备发生变化时导致数据抽取错误的问题。In the present invention, the binding date is added to the binding relationship between the node and the monitoring device, so that during data extraction, all nodes are traversed, and the monitoring device of each node is retrieved according to the range of the extraction time, thereby obtaining The monitoring data of each node ensures the accuracy of data extraction, and solves the problem of data extraction errors in the prior art due to changes in monitoring equipment bound to nodes.
附图说明Description of drawings
图1为本发明提供的基于业务系统的数据抽取方法流程图;1 is a flowchart of a data extraction method based on a business system provided by the present invention;
图2为本发明提供的基于业务系统的数据抽取方法中的节点的树形结构示意图;Fig. 2 is the tree structure schematic diagram of the node in the data extraction method based on business system provided by the present invention;
图3为图1中步骤S7的流程图。FIG. 3 is a flowchart of step S7 in FIG. 1 .
具体实施方式Detailed ways
下面,结合附图以及具体实施方式,对本发明做进一步描述,需要说明的是,在不相冲突的前提下,以下描述的各实施例之间或各技术特征之间可以任意组合形成新的实施例。The present invention will be further described below with reference to the accompanying drawings and specific embodiments. It should be noted that, on the premise of no conflict, the embodiments or technical features described below can be combined arbitrarily to form new embodiments. .
实施例一Example 1
为了解决现有业务系统的数据抽取准确性的问题,本发明将原有的节点与监测设备的静态绑定关系修改为分时段挂表的形式。也即,将对于每个节点与监测设备的绑定关系中增加绑定日期,并生成绑定关系存储于系统中。当需要抽取数据时,根据抽取时间的范围来实现检索到每个节点对应的监测设备,保证数据抽取的准确性。In order to solve the problem of the accuracy of data extraction in the existing business system, the present invention modifies the original static binding relationship between the node and the monitoring device into the form of time-based hanging table. That is, the binding date is added to the binding relationship between each node and the monitoring device, and the binding relationship is generated and stored in the system. When it is necessary to extract data, the monitoring equipment corresponding to each node is retrieved according to the range of extraction time to ensure the accuracy of data extraction.
本发明提供一种优选的实施例,如图1所示,一种基于业务系统的数据抽取方法,包括以下步骤:The present invention provides a preferred embodiment, as shown in Figure 1, a data extraction method based on a business system, comprising the following steps:
步骤S1、根据业务系统确定业务系统的所有节点并根据业务系统确定业务系统的每个节点所绑定的监测设备,以及根据每个节点所绑定的监测设备、当前的绑定日期生成每个节点的绑定关系并存储于系统中。Step S1, determine all nodes of the business system according to the business system and determine the monitoring equipment bound to each node of the business system according to the business system, and generate each node according to the monitoring equipment bound to each node and the current binding date. The binding relationship of nodes is stored in the system.
本实施例中的节点是指业务系统中需要统计数据的节点。比如,对于酒店的业务系统来说,节点也即指XX酒店、各个房间等均可以作为一个节点。监测设备是指监测仪表,监测数据为用电量。比如,XX酒店的总的用电量,各个房间的用电量均可通过绑定对应的监测仪表来实现用电量的监测。A node in this embodiment refers to a node in the service system that needs statistical data. For example, for the business system of the hotel, the node refers to the XX hotel, each room, etc. can be used as a node. Monitoring equipment refers to monitoring instruments, and the monitoring data is electricity consumption. For example, the total electricity consumption of XX Hotel and the electricity consumption of each room can be monitored by binding the corresponding monitoring instrument.
当业务需求发生变化时,酒店的房间其所绑定的监测仪表可能会发生变化,则后续在进行数据抽取时,很容易抽取错误。比如对于B101房间来说,业务需求具有以下两条:When business requirements change, the monitoring instruments bound to the hotel room may change, and it is easy to extract errors in subsequent data extraction. For example, for room B101, the business requirements have the following two:
B101房间在2021年09月01日绑定了监测仪表A;但是,B101房间在2021年09月20日发生变更,绑定了监测仪表A、监测仪表B。Room B101 was bound with monitoring instrument A on September 1, 2021; however, room B101 was changed on September 20, 2021, and monitoring instrument A and monitoring instrument B were bound.
当需要对B101房间的数据进行抽取时,系统很难判断到底时选择监测仪表A的监测数据,还是选择监测以便B的数据,或选择监测仪表A与监测仪表B的数据。When the data of room B101 needs to be extracted, it is difficult for the system to determine whether to choose the monitoring data of monitoring instrument A, the data of monitoring instrument B, or the data of monitoring instrument A and monitoring instrument B.
因此,本发明通过将原有的节点与监测设备之间的绑定关系中增加绑定日期,并形成对应的绑定记录存储于系统中。这样,即使节点所绑定的监测设备发生变化,在后续数据抽取时,只需要增加数据抽取的时间,根据时间以及绑定关系来匹配得出节点所绑定的监测设备,从而对历史数据的准确抽取。如表1所示,表示了XX酒店中A座和B座各个房间所绑定的监测仪表:Therefore, in the present invention, the binding date is added to the binding relationship between the original node and the monitoring device, and a corresponding binding record is formed and stored in the system. In this way, even if the monitoring equipment bound to the node changes, in the subsequent data extraction, only the time for data extraction needs to be increased, and the monitoring equipment bound to the node is matched according to the time and the binding relationship, so that the historical data Extract accurately. As shown in Table 1, it shows the monitoring instruments bound to each room in Building A and Building B in XX Hotel:
表1Table 1
对于XX酒店的业务系统来说,业务系统的节点可包括:XX酒店、A座、B座、一楼、二楼、A101房间、A102房间、B101房间、B102房间、B201房间、B202房间、B203房间等,如表1所示,列举出了该业务系统的部分节点以及对应的绑定设备。其中,B101房间在2019年9月1日绑定监测仪表A,在2019年9月20日绑定监测仪表B。这样,在后续进行数据抽取时,只需要根据抽取时间来选择对应绑定的监测仪表的用电量,即可实现数据的抽取。比如当抽取时间在2021年9月20日之前时,只需要按照监测仪表A的用电量即可;而当抽取时间位于2021年9月20日之后时,则需要同时统计监测仪表A和监测仪表B的用电量。优选地,表1中的每一行均对应一条绑定记录,通过将每次变更的绑定关系均通过绑定记录存储于系统中,即使后续需要获取历史数据,只需要抽取时间即可正确选择对应的监测设备,以获取监测数据。For the business system of XX Hotel, the nodes of the business system can include: XX Hotel, Block A, Block B, First Floor, Second Floor, Room A101, Room A102, Room B101, Room B102, Room B201, Room B202, Room B203 Room, etc., as shown in Table 1, lists some nodes of the service system and the corresponding binding devices. Among them, room B101 was bound to monitoring instrument A on September 1, 2019, and bound to monitoring instrument B on September 20, 2019. In this way, in the subsequent data extraction, it is only necessary to select the power consumption of the corresponding bound monitoring instrument according to the extraction time, and then the data extraction can be realized. For example, when the extraction time is before September 20, 2021, you only need to follow the power consumption of monitoring instrument A; and when the extraction time is after September 20, 2021, you need to count both monitoring instrument A and monitoring instrument A. Meter B's electricity consumption. 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 acquired later, only the extraction time can be selected correctly. Corresponding monitoring equipment to obtain monitoring data.
本实施例中的绑定记录至少包括一个节点和一个绑定日期。一个节点可对应若干条绑定记录,并且不同的绑定记录的绑定日期不同。每个节点可以绑定监测设备,也可以不绑定监测设备,也可以绑定多个监测设备。比如,对于节点A101房间绑定一个监测仪表F,对于节点一楼不绑定监测仪表,对于节点B101房间绑定一个监测仪表A和一个监测仪表B。对于不绑定监测设备的节点来说,其监测数据可根据其子节点获取。The binding record in this embodiment includes at least one node and one binding date. A 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 not bound to a monitoring device, or can be bound to multiple monitoring devices. For example, a monitoring instrument F is bound to the room of node A101, no monitoring instrument is bound to the first floor of the node, and a monitoring instrument A and a monitoring instrument B are bound to the room of node B101. For a node that is not bound to a monitoring device, its monitoring data can be obtained from its child nodes.
另外,在业务系统中,每个监测设备在运行过程中,会实时将监测数据记录到系统的数据库中。In addition, in the business system, each monitoring device will record the monitoring data in the system database in real time during the operation.
优选地,为了便于对节点的检索,本实施例还根据业务系统的所有节点之间的关系构建节点的树形结构,以便后续对所有节点进行检索,如图2所示,为XX酒店的业务系统中各个节点的树形结构。Preferably, in order to facilitate the retrieval of nodes, this embodiment also builds a tree structure of nodes according to the relationship between all nodes of the business system, so that all nodes can be retrieved later, as shown in FIG. 2 , for the business of XX Hotel The tree structure of each node in the system.
步骤S2、获取需要抽取的所有节点及抽取时间,并按照节点优先级从需要抽取的所有节点中顺序取出一个节点,作为待检索节点,然后执行步骤S3。Step S2: Obtain all the nodes to be extracted and the extraction time, and sequentially extract a node from all the nodes to be extracted according to the node priority as a node to be retrieved, and then perform step S3.
由于需要抽取的节点可能不只一个,同时在抽取数据时,还需要设置抽取时间。抽取时间,根据所抽取的需求进行设定。Since there may be more than one node to be extracted, and when extracting data, the extraction time also needs to be set. The extraction time is set according to the extraction requirements.
节点优先级是由节点在树形结构中的深度确定。其中,节点在树形结构中的深度越大、优先级越小。Node priority is determined by the depth of the node in the tree structure. Among them, the greater the depth of the node in the tree structure, the smaller the priority.
通过设置树形结构,以便后续对节点的遍历。By setting the tree structure for subsequent traversal of nodes.
步骤S3、判断待检索节点是否绑定监测设备,若是,则执行步骤S4;若否,则执行步骤S5。Step S3: Determine whether the node to be searched is bound to the monitoring device, if yes, go to Step S4; if not, go to Step S5.
步骤S4、根据抽取时间获取待检索节点所绑定的监测设备,进而根据待检索节点所绑定的监测设备得出待检索节点的监测数据,执行步骤S7。Step S4: Obtain monitoring equipment bound to the node to be searched according to the extraction time, and then obtain monitoring data of the node to be searched according to the monitoring equipment bound to the node to be searched, and perform step S7.
步骤S5、判断待检索节点是否有子节点,若有,则执行步骤S6;若无,则待检索节点的监测数据为空,执行步骤S7。当一个节点既没有绑定监测设备,又没有子结点时,则认为其监测数据为空。Step S5 , judging whether the node to be searched has child nodes, if so, go to step S6 ; if not, then the monitoring data of the node to be searched is empty and go to step S7 . When a node has neither bound monitoring equipment nor child nodes, its monitoring data is considered to be empty.
步骤S6、获取待检索节点的每个子节点的监测数据并得出待检索节点的监测数据,执行步骤S7。In step S6, the monitoring data of each child node of the node to be retrieved is acquired and the monitoring data of the node to be retrieved is obtained, and step S7 is executed.
也即,当某个节点没有绑定监测设备时,可根据其子节点的监测数据作为该节点的监测数据。That is, 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 the node.
步骤S7、从需要抽取的所有节点中取出下一个节点作为待检索节点,执行步骤S3。Step S7, take out the next node from all the nodes to be extracted as the node to be retrieved, and execute step S3.
直到需要抽取的所有节点遍历完成。当需要抽取的所有节点均遍历完成后,数据抽取结束。Until all nodes that need to be extracted are traversed. When all the nodes to be extracted are traversed, the data extraction ends.
优选地,本发明还对抽取完成后的所有节点的监测数据进行分类统计后存储。Preferably, the present invention also performs classification and statistics on the monitoring data of all nodes after the extraction is completed, and then stores them.
优选地,本实施例还可对节点所绑定的监测设备进行更新,也即,本发明还包括:获取待更新节点以及待更新节点所绑定的新的监测设备,并根据待更新节点所绑定的新的监测设备、当前的绑定日期生成新的绑定记录并存储于系统中。这样,该节点在系统中会对应多条绑定记录,在监测数据抽取时,根据抽取时间来选择对应的监测设备进行数据抽取。Preferably, in this embodiment, the monitoring device bound to the node can also be updated, that is, the present invention further includes: acquiring the node to be updated and the new monitoring device bound to the node to be updated, and according to the node to be updated The bound new monitoring device and the current binding date generate a new binding record and store it in the system. In this way, the node will correspond to multiple binding records in the system. When the monitoring data is extracted, the corresponding monitoring device is selected for data extraction according to the extraction time.
优选地,本实施例中的某个节点所绑定的监测设备更新后,并不会对其自身的父节点或子接点所绑定的监测设备有影响,也即,在系统中只是增加该节点的绑定记录即可。Preferably, after the monitoring device bound to a certain node in this embodiment is updated, it will not affect the monitoring device bound to its own parent node or child node, that is, only add the monitoring device in the system. The binding record of the node is sufficient.
优选地,步骤S7中获取一个子节点所绑定的监测数据时,如图3所示,本发明还具体包括:Preferably, when the monitoring data bound to a child node is acquired in step S7, as shown in FIG. 3, the present invention further specifically includes:
步骤S71、判断子节点是否绑定监测设备,若是,则执行步骤S72;若否,则执行步骤S73。Step S71, determine whether the child node is bound to the monitoring device, if yes, go to step S72; if not, go to step S73.
步骤S72、根据抽取时间统计该子节点所绑定的监测设备的监测数据,进而得出该子节点的监测数据。Step S72: Count the monitoring data of the monitoring device bound to the child node according to the extraction time, and then obtain the monitoring data of the child node.
步骤S73、判断该子节点是否有子节点,若有,执行步骤S74;若否,则该子节点的监测数据为0。Step S73 , judging whether the child node has a child node, if so, go to step S74 ; if not, the monitoring data of the child node is 0.
步骤S74、获取该子节点的所有子节点,并根据该子节点的每个子节点所绑定的监测设备得出该子节点的监测数据。Step S74: Acquire all child nodes of the child node, and obtain monitoring data of the child node according to the monitoring device bound to each child node of the child node.
也即,对于每个子节点的监测数据的抽取与前述每个节点的数据抽取过程相同。当子节点没有绑定监测设备时,其监测数据可由该子节点的所有子节点的监测数据得到。当子节点绑定监测设备时,其监测数据直接由其绑定的监测设备得出。That is, the extraction of monitoring data for each child node is the same as the process of data extraction for each node described above. When a child node is not bound to a monitoring device, its monitoring data can be obtained from the monitoring data of all child nodes of the child node. When a child node is bound to a monitoring device, its monitoring data is directly derived from its bound monitoring device.
优选地,本实施例还可实现对节点的扩展。当系统中需要增加新的节点时,本发明还包括:获取新增节点并确定所述新增节点在所述树形结构中的位置,并将其加入到所述树形结构中,然后根据所述新增节点所绑定的监测设备、当前的绑定日期生成所述新增节点的绑定记录并存储于系统中。Preferably, this embodiment can also implement extension of nodes. When a new node needs to be added in the system, the present invention further includes: acquiring the newly added node and determining the position of the newly added node in the tree structure, adding it to the tree structure, and then according to The monitoring device bound to the newly added node and the current binding date generate a binding record of the newly added node and store it in the system.
实施例二Embodiment 2
基于业务系统的数据抽取装置,包括存储器和处理器,所述存储器上存储有在处理器上运行的数据抽取程序,所述数据抽取程序为计算机程序,所述处理器执行所述数据抽取程序时实现如以下步骤:A data extraction device based on a business system includes a memory and a processor, the memory stores a data extraction program running on the processor, and the data extraction program is a computer program. When the processor executes the data extraction program Implement the following steps:
配置步骤:根据业务系统确定业务系统的所有节点并根据业务系统构建节点的树形结构,以及根据所述业务系统确定业务系统的每个节点所绑定的监测设备并根据每个节点所绑定的监测设备、当前的绑定日期生成每个节点的绑定记录并存储于系统中;Configuration steps: determine all nodes of the business system according to the business system and build a tree structure of nodes according to the business system, and determine the monitoring equipment bound to each node of the business system according to the business system and bind each node according to the business system. The monitoring equipment and the current binding date generate the binding records of each node and store them in the system;
获取节点步骤:获取需要抽取的所有节点及抽取时间,并按照节点优先级从需要抽取的所有节点中依次取出每个节点;Steps of obtaining nodes: obtain all the nodes to be extracted and the extraction time, and sequentially extract each node from all the nodes to be extracted according to the node priority;
绑定判断步骤:判断每个节点是否绑定监测设备,若是,则执行直接获取步骤;若否,则执行间接获取步骤;Binding judgment step: judge whether each node is bound to a monitoring device, if so, execute the direct acquisition step; if not, execute the indirect acquisition step;
直接获取步骤:根据所述抽取时间获取每个节点所绑定的监测设备,进而根据每个节点所绑定的监测设备得出对应节点的监测数据;The direct obtaining step: obtaining the monitoring equipment bound to each node according to the extraction time, and then obtaining the monitoring data of the corresponding node according to the monitoring equipment bound to each node;
间接获取步骤:判断每个节点是否有子节点,若是,则获取每个节点的每个子节点的监测数据进而得出对应节点的监测数据;若否,对应节点的监测数据为空。Indirect acquisition step: determine whether each node has child nodes, if so, obtain the monitoring data of each child node of each node to obtain the monitoring data of the corresponding node; if not, the monitoring data of the corresponding node is empty.
进一步地,还包括:绑定记录更新步骤:获取待更新节点以及所述待更新节点所绑定的新的监测设备,并根据所述待更新节点所绑定的新的监测设备、当前的绑定日期生成新的绑定记录并存储于系统中。Further, it also includes: a binding record update step: acquiring the node to be updated and the new monitoring device bound to the node to be updated, and according to the new monitoring device bound to the node to be updated, the current binding A new binding record is generated on a fixed date and stored in the system.
进一步地,还包括:节点更新步骤:获取新增节点并确定所述新增节点在所述树形结构中的位置,并将其加入到所述树形结构中,然后根据所述新增节点所绑定的监测设备、当前的绑定日期生成所述新增节点的绑定记录并存储于系统中。Further, it also includes: a node update step: acquiring a new node and determining the position of the new node in the tree structure, adding it to the tree structure, and then according to the new node The bound monitoring device and the current binding date generate a binding record of the newly added node and store it in the system.
进一步地,所述间接获取步骤中获取一个子节点的监测数据具体包括:Further, obtaining the monitoring data of a child node in the indirect obtaining step specifically includes:
首先判断该子节点是否绑定监测设备,若是,则根据所述抽取时间获取该子节点所绑定的监测设备得出该子节点的监测数据;若否,则根据该子节点的所有子节点的监测数据得出该子节点的监测数据。First, determine whether the child node is bound to a monitoring device, if so, obtain the monitoring device bound to the child node according to the extraction time to obtain the monitoring data of the child node; if not, according to all child nodes of the child node The monitoring data of the child node is obtained.
进一步地,所述节点优先级是由节点在树形结构中的深度来确定;其中,节点在树形结构中的深度越大,优先级越小。Further, the node priority is determined by the depth of the node in the tree structure; wherein, the greater the depth of the node in the tree structure, the smaller the priority.
进一步地,所述绑定记录包括一个节点和一个绑定日期;每个节点对应若干条绑定记录。Further, the binding record includes a node and a binding date; each node corresponds to several binding records.
进一步地,所述绑定记录中的监测设备的数量为以下数量中的任意一个:0个、1个或多个。Further, the number of monitoring devices in the binding record is any one of the following numbers: 0, 1 or more.
进一步地,还包括:统计步骤:对需要抽取的所有节点的监测数据进行分类统计并存储。Further, the method also includes: a statistical step: classifying and storing the monitoring data of all nodes that need to be extracted.
实施例三Embodiment 3
一种存储介质,所述存储介质为计算机可读存储介质,其上存储有计算机程序,所述计算机程序为数据抽取程序,所述数据抽取程序被处理器执行时如以下步骤:A storage medium, wherein the storage medium is a computer-readable storage medium on which a computer program is stored, the computer program is a data extraction program, and the data extraction program is executed by a processor as follows:
配置步骤:根据业务系统确定业务系统的所有节点并根据业务系统构建节点的树形结构,以及根据所述业务系统确定业务系统的每个节点所绑定的监测设备并根据每个节点所绑定的监测设备、当前的绑定日期生成每个节点的绑定记录并存储于系统中;Configuration steps: determine all nodes of the business system according to the business system and build a tree structure of nodes according to the business system, and determine the monitoring equipment bound to each node of the business system according to the business system and bind each node according to the business system. The monitoring equipment and the current binding date generate the binding records of each node and store them in the system;
获取节点步骤:获取需要抽取的所有节点及抽取时间,并按照节点优先级从需要抽取的所有节点中依次取出每个节点;Steps of obtaining nodes: obtain all the nodes to be extracted and the extraction time, and sequentially extract each node from all the nodes to be extracted according to the node priority;
绑定判断步骤:判断每个节点是否绑定监测设备,若是,则执行直接获取步骤;若否,则执行间接获取步骤;Binding judgment step: judge whether each node is bound to a monitoring device, if so, execute the direct acquisition step; if not, execute the indirect acquisition step;
直接获取步骤:根据所述抽取时间获取每个节点所绑定的监测设备,进而根据每个节点所绑定的监测设备得出对应节点的监测数据;The direct obtaining step: obtaining the monitoring equipment bound to each node according to the extraction time, and then obtaining the monitoring data of the corresponding node according to the monitoring equipment bound to each node;
间接获取步骤:判断每个节点是否有子节点,若是,则获取每个节点的每个子节点的监测数据进而得出对应节点的监测数据;若否,对应节点的监测数据为空。Indirect acquisition step: determine whether each node has child nodes, if so, obtain the monitoring data of each child node of each node to obtain the monitoring data of the corresponding node; if not, the monitoring data of the corresponding node is empty.
进一步地,还包括:绑定记录更新步骤:获取待更新节点以及所述待更新节点所绑定的新的监测设备,并根据所述待更新节点所绑定的新的监测设备、当前的绑定日期生成新的绑定记录并存储于系统中。Further, it also includes: a binding record update step: acquiring the node to be updated and the new monitoring device bound to the node to be updated, and according to the new monitoring device bound to the node to be updated, the current binding A new binding record is generated on a fixed date and stored in the system.
进一步地,还包括:节点更新步骤:获取新增节点并确定所述新增节点在所述树形结构中的位置,并将其加入到所述树形结构中,然后根据所述新增节点所绑定的监测设备、当前的绑定日期生成所述新增节点的绑定记录并存储于系统中。Further, it also includes: a node update step: acquiring a new node and determining the position of the new node in the tree structure, adding it to the tree structure, and then according to the new node The bound monitoring device and the current binding date generate a binding record of the newly added node and store it in the system.
进一步地,所述间接获取步骤中获取一个子节点的监测数据具体包括:Further, obtaining the monitoring data of a child node in the indirect obtaining step specifically includes:
首先判断该子节点是否绑定监测设备,若是,则根据所述抽取时间获取该子节点所绑定的监测设备得出该子节点的监测数据;若否,则根据该子节点的所有子节点的监测数据得出该子节点的监测数据。First, determine whether the child node is bound to a monitoring device, if so, obtain the monitoring device bound to the child node according to the extraction time to obtain the monitoring data of the child node; if not, according to all child nodes of the child node The monitoring data of the child node is obtained.
进一步地,所述节点优先级是由节点在树形结构中的深度来确定;其中,节点在树形结构中的深度越大,优先级越小。Further, the node priority is determined by the depth of the node in the tree structure; wherein, the greater the depth of the node in the tree structure, the smaller the priority.
进一步地,所述绑定记录包括一个节点和一个绑定日期;每个节点对应若干条绑定记录。Further, the binding record includes a node and a binding date; each node corresponds to several binding records.
进一步地,所述绑定记录中的监测设备的数量为以下数量中的任意一个:0个、1个或多个。Further, the number of monitoring devices in the binding record is any one of the following numbers: 0, 1 or more.
进一步地,还包括:统计步骤:对需要抽取的所有节点的监测数据进行分类统计并存储。Further, the method also includes: a statistical step: classifying and storing the monitoring data of all nodes that need to be extracted.
上述实施方式仅为本发明的优选实施方式,不能以此来限定本发明保护的范围,本领域的技术人员在本发明的基础上所做的任何非实质性的变化及替换均属于本发明所要求保护的范围。The above-mentioned embodiments are only preferred embodiments of the present invention, and cannot be used to limit the scope of protection of the present invention. Any insubstantial changes and substitutions made by those skilled in the art on the basis of the present invention belong to the scope of the present invention. Scope of protection claimed.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111506231.6ACN114416834A (en) | 2021-12-10 | 2021-12-10 | Data extraction method, device and storage medium based on business system |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111506231.6ACN114416834A (en) | 2021-12-10 | 2021-12-10 | Data extraction method, device and storage medium based on business system |
| Publication Number | Publication Date |
|---|---|
| CN114416834Atrue CN114416834A (en) | 2022-04-29 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111506231.6APendingCN114416834A (en) | 2021-12-10 | 2021-12-10 | Data extraction method, device and storage medium based on business system |
| Country | Link |
|---|---|
| CN (1) | CN114416834A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080114787A1 (en)* | 2006-11-15 | 2008-05-15 | Hitachi, Ltd. | Index processing method and computer systems |
| CN106407171A (en)* | 2016-11-03 | 2017-02-15 | 华能澜沧江水电股份有限公司 | System and method for generating safety monitoring custom report based on tree structure |
| CN109040183A (en)* | 2018-06-27 | 2018-12-18 | 郑州云海信息技术有限公司 | Node information acquisition method, device, equipment and computer readable storage medium |
| CN111078635A (en)* | 2019-12-09 | 2020-04-28 | 北京快友世纪科技股份有限公司 | Data acquisition priority judging and processing method based on Hadoop |
| CN112699280A (en)* | 2020-12-31 | 2021-04-23 | 北京天融信网络安全技术有限公司 | Website monitoring method, website map establishing method and device and electronic equipment |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080114787A1 (en)* | 2006-11-15 | 2008-05-15 | Hitachi, Ltd. | Index processing method and computer systems |
| CN106407171A (en)* | 2016-11-03 | 2017-02-15 | 华能澜沧江水电股份有限公司 | System and method for generating safety monitoring custom report based on tree structure |
| CN109040183A (en)* | 2018-06-27 | 2018-12-18 | 郑州云海信息技术有限公司 | Node information acquisition method, device, equipment and computer readable storage medium |
| CN111078635A (en)* | 2019-12-09 | 2020-04-28 | 北京快友世纪科技股份有限公司 | Data acquisition priority judging and processing method based on Hadoop |
| CN112699280A (en)* | 2020-12-31 | 2021-04-23 | 北京天融信网络安全技术有限公司 | Website monitoring method, website map establishing method and device and electronic equipment |
| Publication | Publication Date | Title |
|---|---|---|
| CN104331446B (en) | A kind of massive data processing method mapped based on internal memory | |
| CN110472068A (en) | Big data processing method, equipment and medium based on heterogeneous distributed knowledge mapping | |
| CN106228306A (en) | Operation flow methods of exhibiting based on modeling configuration and operation flow exhibiting device | |
| CN103426126B (en) | Generation method for segmental contact topological relationship of feeder line group of regional power grid | |
| CN104158682B (en) | Synchronous Digital Hierarchy (SDH) fault positioning method based on contribution degree | |
| CN106302843B (en) | A kind of IP address library update method and device | |
| CN107870949A (en) | Data analysis job dependence relation generation method and system | |
| CN102855332A (en) | Graphic configuration management database based on graphic database | |
| CN103631967B (en) | A kind of processing method and processing device of the tables of data with independent increment identification field | |
| CN117556369B (en) | A method and system for detecting electricity theft based on a dynamically generated residual graph convolutional neural network | |
| CN104636401B (en) | Method and device for data rollback of SCADA (supervisory control and data acquisition) system | |
| CN107689628A (en) | A kind of power network loop detecting method | |
| CN118735144A (en) | A PCBA board test data intelligent management system and method | |
| CN104376174B (en) | Alternating current line parameter identification and correction method based on line impedance ratio | |
| CN105279260A (en) | Space meshing based government affair big data mining method | |
| CN115905564A (en) | Power grid body model construction method based on graph model association recommendation algorithm | |
| CN102508866A (en) | Digital addressing-based method for structured storage and rapid processing of command relation tree | |
| CN110309144A (en) | A kind of method and device with redis building tree form data structure | |
| CN114416834A (en) | Data extraction method, device and storage medium based on business system | |
| CN103955519A (en) | Account inquiring and recording system and inquiring and recording method thereof | |
| CN110399534B (en) | Method, device, device and storage medium for generating terminal performance report | |
| CN104537016B (en) | A kind of method and device of determining file place subregion | |
| CN106202121B (en) | Data storage and derived method and apparatus | |
| CN103684942B (en) | A kind of two-stage method of partition of topological network | |
| CN106597049A (en) | Multi-waveform envelope extraction method based on chain table array |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |