Data collection method and device, storage medium and electronic device

By collecting data in batches when the business system is idle, the problem in the existing technology that data collection affects the performance of the business system is solved, and a balance between normal transaction processing and resource utilization during the peak period of the business system is achieved.

CN113672673BActive Publication Date: 2024-09-06吉林亿联银行股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110981670.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-25
Publication Date
2024-09-06
Estimated Expiration
2041-08-25

AI Technical Summary

Technical Problem

The existing data collection method collects data during the peak period of business transactions in the business system, which can easily cause adverse effects on the performance of the business system and affect the normal processing of business transactions.

Method used

By setting the collection batch, data collection is only performed when the business system is idle, and it is judged whether the business system is currently idle. If it is idle, the data collection task is executed, and the data collection process ends after all collection batches are completed. .

Benefits of technology

Avoid data collection during the peak transaction period of the business system, reduce the impact on the performance of the business system, ensure the normal business transaction processing of the business system, and balance the system load while maximizing resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113672673B
    Figure CN113672673B
Patent Text Reader

Abstract

The present invention provides a data collection method and device, a storage medium and an electronic device, the method comprising: when receiving an instruction to collect data from each business system, setting at least one collection batch, determining each business system corresponding to each collection batch in each business system; sequentially collecting data from each business system corresponding to each collection batch; for each business system corresponding to the current collection batch, determining whether the business system is currently in an idle state, if the business system is currently in an idle state, executing the data collection task corresponding to the business system; if the data collection tasks corresponding to each business system corresponding to the current collection batch have been completed, then ending the data collection process of each business system corresponding to the current collection batch. By applying the method of the present invention, data collection can be performed when the business system is in an idle state, avoiding affecting the system performance and ensuring the normal operation of the business system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data acquisition method and device, a storage medium and an electronic device. Background Art

[0002] With the development of computer technology, various business systems have become an important part of the information architecture of enterprises and organizations. In daily work, it is often necessary to collect data from various business systems. For example, in the financial industry, financial institutions need to regularly collect data from various business systems to achieve data synchronization of various business systems.

[0003] At present, the data collection method of each business system is usually to set up a data collection task, and when the data collection task is triggered, directly access the business system to collect data.

[0004] In actual application scenarios, data collection tasks will also occupy certain operating resources of the business system. In the case of data collection task delays, the data collection time may overlap with the business transaction peak period of the business system. Based on the existing data collection method, data collection during the business transaction peak period of the business system is likely to have an adverse effect on the performance of the business system and affect the normal processing of business transactions. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a data collection method to solve the problem that the existing data collection method is likely to cause adverse effects on the performance of the business system and affect the normal processing of business transactions.

[0006] The embodiment of the present invention also provides a data acquisition device to ensure the practical implementation and application of the above method.

[0007] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0008] A data collection method, comprising:

[0009] When receiving an instruction to collect data from each business system, at least one collection batch is set, and in each business system, each business system corresponding to each collection batch is determined;

[0010] Collecting data from each business system corresponding to each of the collection batches in turn;

[0011] The data collection process of each business system corresponding to each collection batch includes:

[0012] For each business system corresponding to the current collection batch, determine whether the business system is currently in an idle state. If the business system is currently in an idle state, execute the data collection task corresponding to the business system;

[0013] If the data collection tasks corresponding to each business system corresponding to the current collection batch have been completed, the data collection process of each business system corresponding to the current collection batch is ended.

[0014] In the above method, optionally, in each of the business systems, determining each business system corresponding to each of the acquisition batches includes:

[0015] Determine the priority corresponding to each business system in the various business systems;

[0016] Determining a batch sequence corresponding to each of the collected batches;

[0017] Based on the priority corresponding to each of the business systems, determine the batch sequence corresponding to each of the business systems in the batch sequences corresponding to the respective acquisition batches;

[0018] Each of the business systems is assigned to a collection batch corresponding to its corresponding batch sequence, and each business system assigned to each of the collection batches is determined as the business system corresponding to the collection batch.

[0019] In the above method, optionally, the step of determining whether the business system is currently in an idle state includes:

[0020] Determine the resource usage parameters corresponding to the current business system;

[0021] Determining whether the resource usage parameter is less than a preset usage threshold;

[0022] If the resource usage parameter is less than the preset usage threshold, it is determined that the business system is currently in an idle state.

[0023] In the above method, optionally, determining the resource usage parameters corresponding to the current business system includes:

[0024] Determine each database node corresponding to the business system;

[0025] Determine a resource usage rate set, wherein the resource usage rate set includes each resource usage rate corresponding to each of the database nodes at present;

[0026] Determine a target resource usage rate in the resource usage rate set, wherein the target resource usage rate is the resource usage rate with the largest value in the resource usage rate set;

[0027] The target resource utilization rate is determined as the resource utilization parameter corresponding to the current business system.

[0028] The above method may optionally further include:

[0029] If the business system is not currently in an idle state, the system state of the business system is judged according to a preset judgment cycle;

[0030] When entering the current judgment cycle, determining whether the business system is currently in an idle state, if the business system is not currently in an idle state, determining the current number of judgments, and determining whether the current number of judgments is less than a preset number;

[0031] If the current number of judgments is less than the preset number, the next judgment cycle is entered; if the current number of judgments is not less than the preset number, the judgment of the system status of the business system is terminated, and the corresponding abnormal information of the business system is prompted to complete the data collection task corresponding to the business system.

[0032] In the above method, optionally, the step of executing the data collection task corresponding to the business system includes:

[0033] Determine each database node corresponding to the business system, and determine the collection order corresponding to each of the database nodes corresponding to the business system;

[0034] According to the collection order corresponding to each of the database nodes, the data stored in each of the database nodes is collected in sequence.

[0035] Optionally, in the above method, sequentially collecting data stored in each of the database nodes according to a collection order corresponding to each of the database nodes includes:

[0036] Determine a first database node among the database nodes corresponding to the business system, where the first database node is the first database node among the database nodes;

[0037] Starting a data collection task corresponding to the first database node to collect data stored in the first database node;

[0038] Determine a node set to be collected, wherein the node set to be collected includes each database node among the database nodes except the first database node;

[0039] Determine a target database node corresponding to each database node in the node set to be collected, wherein the target database node corresponding to each database node is a previous database node of the database node;

[0040] For each database node in the set of nodes to be collected, when the data collection task corresponding to the target database node corresponding to the database node is started, it is determined whether the business system is currently in an idle state. If the business system is currently in an idle state, the data collection task corresponding to the database node is started to collect the data stored in the database node.

[0041] A data acquisition device, comprising:

[0042] A determination unit, configured to set at least one collection batch when receiving an instruction to collect data from each business system, and to determine, in each business system, each business system corresponding to each collection batch;

[0043] A collection unit, used to collect data from each business system corresponding to each collection batch in turn;

[0044] Wherein, the acquisition unit comprises:

[0045] The collection subunit is used to determine whether each business system corresponding to the current collection batch is currently in an idle state. If the business system is currently in an idle state, the data collection task corresponding to the business system is executed; if the data collection tasks corresponding to each business system corresponding to the current collection batch have been completed, the data collection process of each business system corresponding to the current collection batch is terminated.

[0046] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the data acquisition method as described above.

[0047] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the above data collection method.

[0048] Based on a data collection method provided by the above embodiment of the present invention, when receiving an instruction to collect data from each business system, at least one collection batch is set, and in each business system, each business system corresponding to each collection batch is determined; data is collected from each business system corresponding to each collection batch in turn; wherein, the data collection process of each business system corresponding to each collection batch includes: for each business system corresponding to the current collection batch, judging whether the business system is currently in an idle state, if the business system is currently in an idle state, executing the data collection task corresponding to the business system; if the data collection tasks corresponding to each business system corresponding to the current collection batch have been completed, then the data collection process of each business system corresponding to the current collection batch is terminated. By applying the method provided by the embodiment of the present invention, the data collection task corresponding to the business system will be executed only when the business system is in an idle state, which can avoid data collection during the peak period of business transactions of the business system, which affects the performance of the business system, and is conducive to ensuring the normal business transaction processing of the business system. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0050] Figure 1 A method flow chart of a data collection method provided by an embodiment of the present invention;

[0051] Figure 2 A schematic diagram of resource usage of a business system provided by an embodiment of the present invention;

[0052] Figure 3 A method flow chart of another method of data collection provided by an embodiment of the present invention;

[0053] Figure 4 A structural schematic diagram of a data acquisition device provided by an embodiment of the present invention;

[0054] Figure 5 Another structural schematic diagram of a data acquisition device provided by an embodiment of the present invention;

[0055] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0057] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0058] As can be seen from the background technology, the existing data collection methods are prone to adversely affect the performance of business systems. For example, in the financial industry, data collection has changed from relying on the upstream business system to push files to active extraction. For data collection of batch business systems, the library-to-library batch collection method is generally adopted. Usually, in the early morning, the idle stage of the business transaction system, the large data batch data collection is completed. At this time, the business system has limited resources, and batch data collection can improve concurrent tasks. However, if the batch data collection task encounters a delay, the efficiency will be greatly reduced. For example, if the core business system fails on the same day, the large data batch collection task must wait until the core business system repairs the fault before data collection can be performed. If the core business system takes a long time to repair the fault, the business transaction volume will begin to surge during the day, and the batch data collection task will have an impact on its performance, and may even directly affect the core business transactions.

[0059] Therefore, the embodiment of the present invention provides a data collection method, which collects data from a business system when the business system is in a relatively idle state, thereby avoiding affecting the normal operation of the business system.

[0060] The embodiment of the present invention provides a data acquisition method, which can be applied to a data acquisition system, and the execution subject can be a processor of the system. The method flow chart of the method is as follows: Figure 1 As shown, including:

[0061] S101: when receiving an instruction to collect data from each business system, setting at least one collection batch, and in each business system, determining each business system corresponding to each collection batch;

[0062] In the method provided by the embodiment of the present invention, when a user (such as a staff member of a financial institution) needs to collect data from multiple business systems through a data collection system, the front-end graphical interface of the data collection system can be used to specify each business system from which data needs to be collected, and send a corresponding data collection instruction. When the processor of the system receives the instruction, at least one collection batch can be set according to the number of business systems from which data needs to be collected and the processing capacity of the system, so as to process each business system in batches. For example, there are a total of fifty business systems from which data needs to be collected, and according to the processing capacity of the current data collection system, it is more reasonable to process the data collection work of ten business systems at the same time, then five collection batches are set, and the fifty business systems are divided into five collection batches, each business system is assigned to one collection batch, and each collection batch contains ten business systems.

[0063] It should be noted that the number of business systems and the number of collection batches mentioned in the embodiment of the present invention are only for better illustrating a specific embodiment provided by the embodiment of the present invention, and do not limit the number of business systems and the number of collection batches in the specific implementation process.

[0064] S102: Determine the current collection batch for data collection;

[0065] In the method provided in the embodiment of the present invention, data collection needs to be performed on each business system corresponding to each collection batch in turn, that is, data collection is performed on the first batch of business systems first, and after the data collection of the first batch of business systems is completed, data collection is performed on the second batch of business systems, until the data collection of the last batch of business systems is completed. It should be noted that if there is only one collection batch, data collection can be performed on all business systems at the same time, which does not affect the function of the method provided in the embodiment of the present invention.

[0066] In the data collection process corresponding to each business system of each collection batch, the collection batch that currently needs to perform data collection is first determined to determine each business system that currently needs to perform data collection.

[0067] S103: for each business system corresponding to the current collection batch, determining whether the business system is currently in an idle state;

[0068] In the method provided in the embodiment of the present invention, it is possible to determine whether each business system in the current acquisition batch is in an idle state through parallel tasks. Specifically, it is possible to determine whether it is in an idle state based on the resource usage of the business system.

[0069] S104: Execute the data collection task corresponding to the business system;

[0070] In the method provided by the embodiment of the present invention, for each business system of the current collection batch, if the business system is currently in an idle state, the data collection task corresponding to the business system is executed, that is, the database corresponding to the business system is accessed to obtain the data stored in the database.

[0071] S105: If the data collection tasks corresponding to each business system corresponding to the current collection batch have been completed, then the data collection process of each business system corresponding to the current collection batch is terminated;

[0072] In the method provided by the embodiment of the present invention, if the data collection task of each business system of the current collection batch has been completed, the data collection process of the current collection batch is completed. The completion of the data collection task can be the end of obtaining the data corresponding to the task or the end of the task failure.

[0073] S106: Determine whether the current collection batch is the last collection batch;

[0074] In the method provided by the embodiment of the present invention, if the data collection process of each business system corresponding to the current collection batch has been completed, it is determined whether the current collection batch is the last batch of all collection batches according to the batch sequence and the total batch sequence of the current collection batch.

[0075] S107: Enter the next collection batch;

[0076] In the method provided by the embodiment of the present invention, if the current collection batch is not the last collection batch among all collection batches, that is, there are still business systems that need to collect data, then the data collection process of each business system corresponding to the next collection batch is entered.

[0077] S108: End.

[0078] In the method provided by the embodiment of the present invention, if the current collection batch is the last collection batch among all collection batches, that is, the data collection tasks of each business system that needs to perform data collection this time have been completed, then the data collection process is terminated.

[0079] Based on the method provided by the embodiment of the present invention, when receiving an instruction to collect data from each business system, each business system can be divided into batches; each business system corresponding to each collection batch is sequentially collected for data; in the data collection process of each business system corresponding to each collection batch, for each business system corresponding to the current collection batch, it is determined whether the business system is currently in an idle state. If the business system is currently in an idle state, the data collection task corresponding to the business system is executed; if the data collection tasks corresponding to each business system corresponding to the current collection batch have been completed, the data collection process of each business system corresponding to the current collection batch is terminated. Applying the method provided by the embodiment of the present invention, for the business system that currently needs to collect data, it can be determined whether it is currently in an idle state, and the business system is accessed for data collection only when the business system is currently in an idle state, which can avoid accessing during the peak transaction period of the business system, further increasing the burden on the business system, and is conducive to ensuring the normal business transaction processing of the business system. Secondly, the data of the business system can be collected in batches, which can maximize the resource utilization of the data collection system while balancing the system load.

[0080] Furthermore, the present invention provides another data collection method. Figure 1 On the basis of the method shown in the figure, in the method provided by the embodiment of the present invention, in the various business systems mentioned in step S101, determining each business system corresponding to each of the acquisition batches includes:

[0081] Determine the priority corresponding to each business system in the various business systems;

[0082] In the method provided by the embodiment of the present invention, the user can set the corresponding priority for each business system in advance according to the importance of data collection of each business system. For example, there are currently ten business systems, namely, system A, system B, system C, system D, system E, system F, system G, system H, system I, and system J. The priorities corresponding to system A, system B, system C, and system D are all high, the priorities corresponding to system E, system F, and system G are all medium, and the priorities corresponding to system H, system I, and system J are all low.

[0083] Determine a batch order corresponding to each of the acquisition batches; based on the priority corresponding to each of the business systems, determine a batch order corresponding to each of the business systems in the batch orders corresponding to each of the acquisition batches;

[0084] In the method provided by the embodiment of the present invention, the batch order of the collection batch corresponding to each business system can be determined according to the priority corresponding to each business system, and the batch order corresponding to the business system with a high priority is in the front. For example, three collection batches are currently set, and each collection batch contains up to four business systems. In order of priority, the systems A, B, C and D corresponding to high priorities correspond to the first batch order, the systems E, F, G and H corresponding to medium priorities correspond to the second batch order, and the systems I and J corresponding to low priorities correspond to the third batch order. In the actual implementation process, there may be business systems corresponding to different priorities in the same collection batch, such as the second collection batch mentioned above, which contains business systems with medium and low priorities, and the business systems corresponding to the same priority may need to correspond to different batch orders, such as the business systems with low priorities mentioned above, which can be randomly assigned at this time, such as randomly assigning system H to the second batch order, and the remaining systems with low priorities correspond to the third batch order.

[0085] Each of the business systems is assigned to a collection batch corresponding to its corresponding batch sequence, and each business system assigned to each of the collection batches is determined as the business system corresponding to the collection batch.

[0086] In the method provided by the embodiment of the present invention, each business system is allocated to the collection batch corresponding to the batch sequence corresponding to each business system. If the allocation is performed according to the corresponding relationship shown in the above steps, system A, system B, system C and system D are allocated to the first collection batch, that is, the first collection batch contains system A, system B, system C and system D. System E, system F, system G and system H are allocated to the second collection batch, that is, the second collection batch contains system E, system F, system G and system H. And system I and system J are allocated to the third collection batch, that is, the third collection batch contains system I and system J.

[0087] It should be noted that the number of business systems, the number of collection batches, the number of systems included in each collection batch, and the representation method of the priority level mentioned in the method provided in the embodiment of the present invention are all for the purpose of better illustrating the method provided in the embodiment of the present invention. In the specific implementation process, the above contents can be determined as needed. Furthermore, in the specific implementation process, the priority can be further refined and graded, and each business system is assigned a priority that represents a unique priority level.

[0088] Based on the method provided in the embodiment of the present invention, a priority can be set for each business system to allocate and collect data according to the priority. Data of business systems with higher importance can be collected first, which is conducive to promoting subsequent work.

[0089] Furthermore, the embodiment of the present invention provides another data collection method. Figure 1 On the basis of the method shown, in the method provided by the embodiment of the present invention, the step S103 of determining whether the business system is currently in an idle state includes:

[0090] Determine the resource usage parameters corresponding to the current business system;

[0091] In the method provided in the embodiment of the present invention, for the currently judged business system, its corresponding resource usage parameter can be determined, and the resource usage parameter is a parameter that characterizes the resource usage of the business system. The resource usage parameter can be resource information such as CPU usage, memory usage or disk I / O occupancy.

[0092] It is determined whether the resource usage parameter is less than a preset usage threshold. If the resource usage parameter is less than the preset usage threshold, it is determined that the business system is currently in an idle state.

[0093] In the method provided by the embodiment of the present invention, a threshold value can be pre-set according to the actual resource demand for ensuring the normal operation of the business system. When the resource usage parameter of the system is lower than the preset usage threshold, it means that the system is currently relatively idle and has a low load, and when the resource usage parameter of the system is higher than the usage threshold, it means that the current load of the system is high. The resource usage parameter corresponding to the current business system can be compared with the preset usage threshold to determine whether the resource usage parameter is less than the preset usage threshold. If the resource usage parameter is less than the preset usage threshold, it is determined that the current business system is in an idle state. For example, if the value of the resource usage parameter corresponding to the current business system is 60%, and the preset usage threshold is 70%, the current business system is in an idle state.

[0094] Based on the method provided in the embodiment of the present invention, whether the business system is currently in an idle state is determined by comparing the resource usage parameters of the business system with the preset usage threshold. The parameter acquisition is relatively convenient and the process is relatively simple, which can further improve the processing efficiency.

[0095] In order to better illustrate the method provided by the embodiment of the present invention, Figure 2 The embodiment of the present invention provides another data collection method. Based on the method provided in the above embodiment, in the method provided in the embodiment of the present invention, the process of determining the resource usage parameters corresponding to the current business system includes:

[0096] Determine each database node corresponding to the business system;

[0097] In the method provided by the embodiment of the present invention, each business system may be provided with multiple database nodes, for example, multiple database node servers may be provided, and Mysql database, Oracle database, etc. may be used. It should be noted that the database type of the specific application does not affect the function of the method provided by the embodiment of the present invention.

[0098] like Figure 2 The schematic diagram of resource usage of the business system shown is that the Mysql cluster corresponding to system A includes node 1, node 2 and node 3.

[0099] Determine a resource usage rate set, wherein the resource usage rate set includes each resource usage rate corresponding to each of the database nodes at present;

[0100] In the method provided in the embodiment of the present invention, the current resource utilization rate of each database node corresponding to the current business system can be obtained, and multiple resource utilization rates, such as CPU utilization rate and memory utilization rate, etc., can be obtained for each database node at the same time. Specifically, the performance monitoring software Prometheus can be used to realize the collection of dynamic resource information. For example, mysqld-exporter can be deployed on each Mysql node server. mysqld-exporter is a monitoring plug-in of Prometheus. The plug-in can read the data about the database status in Mysql, convert it into the indicator format monitored by Prometheus, and expose it as an http interface to be collected by Prometheus, so that Mysql that originally does not support the Prometheus indicator format can be monitored by Prometheus. Prometheus can realize the collection of detailed resource usage of multiple types of databases, and can realize quasi-real-time collection.

[0101] A target resource utilization rate is determined in the resource utilization rate set, where the target resource utilization rate is the resource utilization rate with the largest value in the resource utilization rate set; and the target resource utilization rate is determined as a resource utilization parameter corresponding to the current business system.

[0102] In the method provided by the embodiment of the present invention, the resource utilization rates corresponding to the various database nodes can be compared, and the resource utilization rate with the largest value can be used as the resource utilization parameter corresponding to the current business system. Figure 2 As shown in the figure, among the resource utilization rates corresponding to node 1, the largest resource utilization rate is 50%, among the resource utilization rates corresponding to node 2, the largest resource utilization rate is 60%, and among the resource utilization rates corresponding to node 3, the largest resource utilization rate is 40%. After comparison, the resource utilization rate with the largest value is 60% corresponding to node 2, so it is determined that the value of the resource utilization parameter currently corresponding to system A is 60%.

[0103] Based on the method provided in the embodiment of the present invention, the resource utilization rate with the current maximum value among the various resource utilization rates corresponding to the database nodes corresponding to the business system can be determined as the resource utilization parameter corresponding to the business system. This can fully consider the various resource utilization situations of the database nodes of the business system, which is conducive to improving the accuracy of judging whether the business system is currently in an idle state.

[0104] In order to better illustrate the method provided by the embodiment of the present invention, the embodiment of the present invention provides another data collection method. Figure 1 Based on the method shown, Figure 3 The method flow chart shown in the embodiment of the present invention further includes:

[0105] S201: If the business system is not currently in an idle state, judging the system state of the business system according to a preset judgment cycle;

[0106] In the method provided by the embodiment of the present invention, for each business system, if it is determined in the judgment process mentioned in step S103 that the business system is not currently in an idle state, a cyclic judgment is performed according to a preset judgment cycle. Specifically, the system status of the business system can be judged at a preset time interval, for example, 1 minute is used as a judgment cycle, and a judgment is performed every 1 minute.

[0107] S202: When entering the current judgment cycle, determine whether the business system is currently in an idle state;

[0108] In the method provided in the embodiment of the present invention, when entering the current judgment cycle, that is, when reaching the preset time point, a preset method is used to judge whether the business system is currently in an idle state. The specific judgment method can be judged in the same way as the judgment process mentioned in step S103. For details, please refer to the description in the above embodiment, which will not be repeated here.

[0109] If, during the judgment process of the current judgment cycle, it is determined that the business system is currently in an idle state, the judgment of the system state of the business system is stopped, and the data collection task corresponding to the business system is executed.

[0110] S203: Determine the current number of determinations, and determine whether the current number of determinations is less than a preset number;

[0111] In the method provided by the embodiment of the present invention, the number of times the system status of the business system is judged can be constrained, and a number threshold can be preset. During the judgment process of the current judgment cycle, if the business system is not currently in an idle state, the number of times the system status of the business system has been judged is determined, that is, the number of judgment cycles currently being determined. The current number of judgments is compared with the preset number of times to determine whether the current number of judgments on the system status of the business system has reached the preset threshold.

[0112] S204: Entering the next judgment cycle;

[0113] In the method provided by the embodiment of the present invention, if the current number of judgments is less than the preset number, the system waits to enter the next judgment cycle, and when the next preset time point is reached, the system status of the business system is judged.

[0114] S205: Finish judging the system status of the business system and prompt the abnormal information corresponding to the business system to complete the data collection task corresponding to the business system.

[0115] In the method provided by an embodiment of the present invention, if the current number of judgments is not less than the preset number of times, it means that the number of times the system status of the business system has been judged has reached the preset maximum value, so the system status of the business system is stopped from being judged, and the user is prompted that the data collection work of the business system is abnormal, such as prompting that the system is continuously busy, the data collection task has failed, etc., in order to complete the data collection task corresponding to the business system.

[0116] Based on the method provided by the embodiment of the present invention, when the business system is not currently in an idle state, the system state is repeatedly judged in the subsequent period, and when the business system is still not in an idle state after reaching a predetermined number of judgments, an abnormality is prompted and the task is terminated. The data collection task can be executed in time when the business system is idle, and the task can be terminated and prompted in time when the business system is continuously busy, so as to avoid the impact caused by continuous judgment and increase the burden on the data collection system, which is conducive to further improving efficiency.

[0117] Further, in Figure 1 Based on the method shown, an embodiment of the present invention provides another data collection method, wherein the process of executing the data collection task corresponding to the business system mentioned in step S104 includes:

[0118] Determine each database node corresponding to the business system, and determine the collection order corresponding to each of the database nodes corresponding to the business system;

[0119] In the method provided by the embodiment of the present invention, when there are multiple database nodes in the business system, the collection order of each database node can be determined. Specifically, the collection order of each database node can be randomly determined, or the collection order of each database node can be pre-set according to actual conditions.

[0120] According to the collection order corresponding to each of the database nodes, the data stored in each of the database nodes is collected in sequence.

[0121] In the method provided by the embodiment of the present invention, the data collection task corresponding to each database node can be started in sequence according to the collection order to collect the data stored in each database node.

[0122] Based on the method provided in the embodiment of the present invention, for a business system, data can be collected in sequence for each corresponding database node, which can avoid unexpected burdens caused by collecting data from each database node at the same time, and can further ensure the normal operation of the business system.

[0123] In order to better illustrate the method provided by the embodiment of the present invention, based on the method provided by the above embodiment, the embodiment of the present invention provides another data collection method, wherein the process of sequentially collecting data stored in each database node according to the collection order corresponding to each database node mentioned in the above embodiment includes:

[0124] Determine a first database node among the database nodes corresponding to the business system, where the first database node is the first database node among the database nodes;

[0125] Starting a data collection task corresponding to the first database node to collect data stored in the first database node;

[0126] Determine a node set to be collected, wherein the node set to be collected includes each database node among the database nodes except the first database node;

[0127] Determine a target database node corresponding to each database node in the node set to be collected, wherein the target database node corresponding to each database node is a previous database node of the database node;

[0128] For each database node in the set of nodes to be collected, when the data collection task corresponding to the target database node corresponding to the database node is started, it is determined whether the business system is currently in an idle state. If the business system is currently in an idle state, the data collection task corresponding to the database node is started to collect the data stored in the database node.

[0129] In the method provided by the embodiment of the present invention, when executing the data collection task of the business system, for each database node corresponding to the business system except the first database node, it is determined whether to start the data collection task corresponding to the database node after the data collection task corresponding to the previous database node of the database node is started. When it is first determined that the business system is currently in an idle state, the data collection task corresponding to the first database node is started, that is, the database node is accessed to obtain the data stored in the node. After the data collection task of the first database node is started, it is determined whether the business system is currently in an idle state. If the business system is currently in an idle state, the data collection task corresponding to the second database node is started, and so on, and the data collection task corresponding to each database node is started in sequence. If it is determined that the business system is not currently in an idle state, the data collection task corresponding to the next database node is not started temporarily, but it is determined again at a preset time interval whether the business system is currently in an idle state, and the next data collection task is started when the business system is in an idle state. If the number of judgments exceeds the threshold, an abnormal information can also be prompted.

[0130] Specifically, the process of determining whether the service system is currently in an idle state mentioned in the method provided in the embodiment of the present invention can be adopted in the same Figure 1 The determination process mentioned in step S103 of the method shown is implemented in the same manner, and the details can be found in the above embodiments, which will not be described again here.

[0131] In the specific implementation process, batch collection tasks can be executed based on the distributed system basic framework Hadoop. The concurrency parameters of the data collection system can be set. During the execution of data collection tasks of each database node of each business system, when the number of tasks that have been started and not completed does not exceed the system concurrency, each database collection task can be started in sequence according to the execution order of each business system and the collection order of the database nodes in each business system. When a high-priority task has been submitted and has not started execution, tasks with lower priority than it cannot be submitted.

[0132] Based on the method provided by the embodiment of the present invention, before starting the data collection task of each specific database node, the system status of the business system is judged, which can ensure that the performance of the business system is not affected on the basis of achieving the maximum concurrency of the data collection system.

[0133] and Figure 1 Corresponding to the data acquisition method shown in FIG. 1 , the embodiment of the present invention further provides a data acquisition device for Figure 1 The specific implementation of the method shown in is shown in the structural diagram Figure 4 As shown, including:

[0134] The determining unit 301 is used for setting at least one collection batch when receiving an instruction to collect data from each business system, and determining each business system corresponding to each collection batch in each business system;

[0135] A collection unit 302 is used to collect data from each business system corresponding to each collection batch in turn;

[0136] The acquisition unit 302 includes:

[0137] The collection subunit 303 is used to determine whether each business system corresponding to the current collection batch is currently in an idle state. If the business system is currently in an idle state, the data collection task corresponding to the business system is executed; if the data collection tasks corresponding to each business system corresponding to the current collection batch have been completed, the data collection process of each business system corresponding to the current collection batch is terminated.

[0138] Based on the device provided by the embodiment of the present invention, when receiving the instruction to collect data from each business system, each business system can be divided into batches; each business system corresponding to each collection batch is sequentially collected for data; in the data collection process of each business system corresponding to each collection batch, for each business system corresponding to the current collection batch, it is determined whether the business system is currently in an idle state, if the business system is currently in an idle state, the data collection task corresponding to the business system is executed; if the data collection tasks corresponding to each business system corresponding to the current collection batch have been completed, the data collection process of each business system corresponding to the current collection batch is terminated. Applying the device provided by the embodiment of the present invention, for the business system that currently needs to collect data, it can be determined whether it is currently in an idle state, and the business system is accessed for data collection only when the business system is currently in an idle state, which can avoid accessing during the peak transaction period of the business system, further increasing the burden of the business system, and is conducive to ensuring the normal business transaction processing of the business system. Secondly, the data of the business system can be collected in batches, which can maximize the resource utilization of the data collection system while balancing the system load.

[0139] exist Figure 4 On the basis of the device shown in the figure, in the device provided by the embodiment of the present invention, the determining unit 301 includes:

[0140] A first determining subunit, used to determine the priority corresponding to each business system in the various business systems;

[0141] A second determining subunit is used to determine a batch sequence corresponding to each of the collected batches;

[0142] A third determining subunit is used to determine the batch sequence corresponding to each of the business systems in the batch sequences corresponding to the respective acquisition batches based on the priority corresponding to each of the business systems;

[0143] The fourth determining subunit is used to allocate each of the business systems to a collection batch corresponding to its corresponding batch sequence, and determine each business system allocated to each of the collection batches as a business system corresponding to the collection batch.

[0144] exist Figure 4 On the basis of the device shown in the figure, in the device provided by the embodiment of the present invention, the collection subunit 303 includes:

[0145] A fifth determining subunit, used to determine resource usage parameters corresponding to the current business system;

[0146] The first judgment subunit is used to judge whether the resource usage parameter is less than a preset usage threshold; if the resource usage parameter is less than the preset usage threshold, it is determined that the business system is currently in an idle state.

[0147] On the basis of the device provided in the above embodiment, in the device provided in the embodiment of the present invention, the fifth determining subunit includes:

[0148] A sixth determination subunit, used to determine each database node corresponding to the business system;

[0149] The seventh determination subunit is used to determine a resource utilization set, wherein the resource utilization set includes the resource utilizations corresponding to each of the database nodes at present; determine a target resource utilization in the resource utilization set, wherein the target resource utilization is the resource utilization with the largest value in the resource utilization set; and determine the target resource utilization as the resource utilization parameter corresponding to the current business system.

[0150] In order to better illustrate the device provided by the embodiment of the present invention, the embodiment of the present invention provides another data acquisition device, whose structural diagram is as shown in FIG. Figure 5 As shown, in Figure 1 On the basis of the device shown, the device provided in the embodiment of the present invention further includes:

[0151] The second judgment subunit 304 is used to judge the system state of the business system according to a preset judgment cycle if the business system is not currently in an idle state; when entering the current judgment cycle, judge whether the business system is currently in an idle state, and if the business system is not currently in an idle state, determine the current judgment number, and judge whether the current judgment number is less than the preset number;

[0152] The eighth determination subunit 305 is used to enter the next judgment cycle if the current number of judgments is less than the preset number of times; if the current number of judgments is not less than the preset number of times, end the judgment on the system status of the business system, and prompt the corresponding abnormal information of the business system to complete the data collection task corresponding to the business system.

[0153] exist Figure 4 On the basis of the device shown in the figure, in the device provided by the embodiment of the present invention, the collection subunit 303 includes:

[0154] A ninth determination subunit is used to determine each database node corresponding to the business system, and determine a collection order corresponding to each database node corresponding to the business system;

[0155] The sequential collection subunit is used to sequentially collect the data stored in each of the database nodes according to the collection order corresponding to each of the database nodes.

[0156] On the basis of the device provided in the above embodiment, in the device provided in the embodiment of the present invention, the sequential collection subunit includes:

[0157] A tenth determining subunit is used to determine a first database node among the database nodes corresponding to the business system, where the first database node is the first database node among the database nodes;

[0158] A starter unit, used to start the data collection task corresponding to the first database node to collect data stored in the first database node;

[0159] An eleventh determining subunit is used to determine a node set to be collected, wherein the node set to be collected includes each database node among the database nodes except the first database node; determine a target database node corresponding to each database node in the node set to be collected, wherein the target database node corresponding to each database node is a previous database node of the database node;

[0160] The third judgment subunit is used to determine whether the business system is currently in an idle state for each database node in the node set to be collected, after the data collection task corresponding to the target database node corresponding to the database node is started. If the business system is currently in an idle state, the data collection task corresponding to the database node is started to collect the data stored in the database node.

[0161] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the data collection method as described above.

[0162] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 6 As shown, it specifically includes a memory 401 and one or more instructions 402, wherein the one or more instructions 402 are stored in the memory 401 and are configured to be executed by one or more processors 403 to perform the following operations:

[0163] When receiving an instruction to collect data from each business system, at least one collection batch is set, and in each business system, each business system corresponding to each collection batch is determined;

[0164] Collecting data from each business system corresponding to each of the collection batches in turn;

[0165] The data collection process of each business system corresponding to each collection batch includes:

[0166] For each business system corresponding to the current collection batch, determine whether the business system is currently in an idle state. If the business system is currently in an idle state, execute the data collection task corresponding to the business system;

[0167] If the data collection tasks corresponding to each business system corresponding to the current collection batch have been completed, the data collection process of each business system corresponding to the current collection batch is ended.

[0168] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0169] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0170] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data collection method, characterized in that: include: When receiving an instruction to collect data from each business system, at least one collection batch is set, and in each business system, each business system corresponding to each collection batch is determined; Determining, in each of the business systems, each of the business systems corresponding to the acquisition batches includes: determining the priority corresponding to each of the business systems in the business systems; determining the batch sequence corresponding to each of the acquisition batches; determining the batch sequence corresponding to each of the business systems in the batch sequences corresponding to each of the acquisition batches based on the priority corresponding to each of the business systems; allocating each of the business systems to the acquisition batch corresponding to its corresponding batch sequence, and determining each of the business systems allocated to each of the acquisition batches as the business system corresponding to the acquisition batch; Collecting data from each business system corresponding to each of the collection batches in turn; The data collection process of each business system corresponding to each collection batch includes: For each business system corresponding to the current collection batch, determine whether the business system is currently in an idle state. If the business system is currently in an idle state, execute the data collection task corresponding to the business system; The executing of the data collection task corresponding to the business system includes: determining each database node corresponding to the business system, and determining a collection order corresponding to each database node corresponding to the business system; and sequentially collecting data stored in each database node according to the collection order corresponding to each database node; The step of sequentially collecting the data stored in each of the database nodes according to the collection order corresponding to each of the database nodes includes: determining a first database node among the database nodes corresponding to the business system, the first database node being the first database node among the database nodes; starting a data collection task corresponding to the first database node to collect the data stored in the first database node; determining a node set to be collected, the node set to be collected including each of the database nodes except the first database node among the database nodes; determining a target database node corresponding to each of the database nodes in the node set to be collected, the target database node corresponding to each of the database nodes being the previous database node of the database node; for each of the database nodes in the node set to be collected, after the data collection task corresponding to the target database node corresponding to the database node is started, determining whether the business system is currently in an idle state, and if the business system is currently in an idle state, starting the data collection task corresponding to the database node to collect the data stored in the database node; If the data collection tasks corresponding to each business system corresponding to the current collection batch have been completed, the data collection process of each business system corresponding to the current collection batch is ended.

2. The method according to claim 1, characterized in that The determining whether the business system is currently in an idle state includes: Determine the resource usage parameters corresponding to the current business system; Determining whether the resource usage parameter is less than a preset usage threshold; If the resource usage parameter is less than the preset usage threshold, it is determined that the business system is currently in an idle state.

3. The method according to claim 2, characterized in that The determining of the resource usage parameters corresponding to the current business system includes: Determine each database node corresponding to the business system; Determine a resource usage rate set, wherein the resource usage rate set includes each resource usage rate corresponding to each of the database nodes at present; Determine a target resource usage rate in the resource usage rate set, wherein the target resource usage rate is the resource usage rate with the largest value in the resource usage rate set; The target resource utilization rate is determined as the resource utilization parameter corresponding to the current business system.

4. The method according to claim 1, characterized in that: Also includes: If the business system is not currently in an idle state, the system state of the business system is judged according to a preset judgment cycle; When entering the current judgment cycle, determining whether the business system is currently in an idle state, if the business system is not currently in an idle state, determining the current number of judgments, and determining whether the current number of judgments is less than a preset number; If the current number of judgments is less than the preset number, the next judgment cycle is entered; if the current number of judgments is not less than the preset number, the judgment of the system status of the business system is terminated, and the corresponding abnormal information of the business system is prompted to complete the data collection task corresponding to the business system.

5. A data acquisition device, characterized in that: include: A determination unit, configured to set at least one collection batch when receiving an instruction to collect data from each business system, and to determine, in each business system, each business system corresponding to each collection batch; The determining unit comprises: a first determining subunit, a second determining subunit, a third determining subunit and a fourth determining subunit; The first determining subunit is used to determine the priority corresponding to each business system in the various business systems; The second determining subunit is used to determine a batch sequence corresponding to each of the collected batches; The third determining subunit is used to determine the batch sequence corresponding to each of the business systems in the batch sequences corresponding to the respective acquisition batches based on the priority corresponding to each of the business systems; The fourth determining subunit is used to assign each of the business systems to a collection batch corresponding to its corresponding batch sequence, and determine each business system assigned to each of the collection batches as the business system corresponding to the collection batch; A collection unit, used to collect data from each business system corresponding to each collection batch in turn; Wherein, the acquisition unit comprises: The collection subunit is used to determine whether each business system corresponding to the current collection batch is currently in an idle state, and if the business system is currently in an idle state, execute the data collection task corresponding to the business system; if the data collection tasks corresponding to each business system corresponding to the current collection batch have been completed, then end the data collection process of each business system corresponding to the current collection batch; The collection subunit includes: a ninth determination subunit and a sequential collection subunit; The ninth determining subunit is used to determine each database node corresponding to the business system, and determine the collection order corresponding to each database node corresponding to the business system; The sequential collection subunit is used to sequentially collect the data stored in each of the database nodes according to the collection order corresponding to each of the database nodes; The sequential collection subunits include: a tenth determination subunit, a starter subunit, an eleventh determination subunit and a third judgment subunit; The tenth determining subunit is configured to determine a first database node among the database nodes corresponding to the business system, wherein the first database node is a first database node among the database nodes; The initiator unit is used to initiate a data collection task corresponding to the first database node to collect data stored in the first database node; The eleventh determining subunit is used to determine a node set to be collected, wherein the node set to be collected includes each database node among the database nodes except the first database node; determine a target database node corresponding to each database node in the node set to be collected, wherein the target database node corresponding to each database node is a previous database node of the database node; The third judgment subunit is used to determine whether the business system is currently in an idle state for each database node in the node set to be collected, after the data collection task corresponding to the target database node corresponding to the database node is started. If the business system is currently in an idle state, the data collection task corresponding to the database node is started to collect the data stored in the database node.

6. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the data collection method according to any one of claims 1 to 4.

7. An electronic device, characterized in that: The device comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be used by one or more processors to execute the data collection method according to any one of claims 1 to 4.