Data collector capacity expansion and contraction method and device, computer equipment, readable storage medium and computer program product

By detecting the expansion and contraction events of the data collector, dynamically managing the collection configuration, and decoupling the data collector and configuration, the problem of inefficient expansion and contraction in traditional technology is solved, and efficient and flexible data collector management and resource utilization are achieved. .

CN118659974APending Publication Date: 2024-09-17GUANGZHOU QUYAN NETWORK TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410852926.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Traditional elastic scaling technology is inefficient when expanding and shrinking data collectors, requiring a lot of manpower and material resources, and the collectors and data sources are tightly coupled, resulting in complex management and high costs.

Method used

By detecting the expansion and contraction triggering events of the data collector and dynamically loading and unloading the collection configuration, the data collector and the collection configuration are decoupled, the configuration acquisition and resource management are automated, and the flexibility and efficiency of expansion and contraction are improved.

Benefits of technology

It realizes the flexible expansion and contraction of data collectors according to business needs, improves the efficiency and adaptability of expansion and contraction, simplifies the operation and maintenance process, reduces operation and maintenance costs and technical thresholds, and ensures the high availability of the system when business needs change. and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118659974A
    Figure CN118659974A
Patent Text Reader

Abstract

The invention relates to a data collector capacity expansion and contraction method and device, computer equipment, a computer readable storage medium and a computer program product, relates to the technical field of data collection, and can improve the capacity expansion and contraction efficiency of a data collector. The method comprises the following steps: detecting a capacity expansion and contraction trigger event aiming at a data collector; the capacity expansion and shrinkage trigger event comprises a data collector capacity expansion event and a data collector capacity shrinkage event; if the data collector capacity expansion event is detected, determining a first data collector for capacity expansion, loading a first collection configuration, and controlling the first data collector to collect service data according to the currently loaded first collection configuration; and if the data collector shrinkage event is detected, controlling a corresponding second data collector to stop collecting the service data according to the currently loaded second collection configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data acquisition technology, and in particular to a method, device, computer equipment, readable storage medium, and computer program product for scaling up and down a data collector. Background Art

[0002] As business volume fluctuates, the demand for scaling data collectors is growing. Traditional elastic scaling technology will automatically increase collector instances of a specified type to ensure computing power and collect more business data associated with the collector instance when business demand increases; when business demand decreases, it will reduce collector instances of a specified type to save costs.

[0003] However, although traditional elastic scaling technology can automatically adjust the number of instances to adapt to business needs to a certain extent, the collector is closely related to the data source being collected. When staff need to scale up or down the data collector for different scenarios, it often takes a lot of manpower and material resources, and there is a problem of low efficiency in scaling up or down the data collector. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for expanding and reducing the capacity of a data collector in response to the above-mentioned technical problems.

[0005] In a first aspect, the present application provides a method for scaling up and down a data collector, comprising:

[0006] Detecting expansion and contraction triggering events for data collectors; expansion and contraction triggering events include data collector expansion events and data collector contraction events;

[0007] If a data collector expansion event is detected, a first data collector for expansion is determined, a first collection configuration is loaded, and the first data collector is controlled to collect business data according to the currently loaded first collection configuration;

[0008] If a data collector shrinking event is detected, the corresponding second data collector is controlled to stop collecting business data according to the currently loaded second collection configuration.

[0009] In one embodiment, loading the first acquisition configuration includes:

[0010] Send a configuration acquisition request to the data collection configuration center; the configuration acquisition request is used to trigger the data collection configuration center to search for idle collection configurations and return the configuration search results;

[0011] The first collection configuration is obtained according to the configuration search result returned by the data collection configuration center.

[0012] In one embodiment, obtaining the first acquisition configuration according to the configuration search result returned by the data acquisition configuration center includes:

[0013] If the configuration search result returned by the data collection configuration center includes the collection configuration, the collection configuration is determined as the first collection configuration;

[0014] If the configuration search result returned by the data collection configuration center does not include the collection configuration, a configuration acquisition request is sent to the configuration center at a preset time interval until the acquired configuration search result includes the collection configuration.

[0015] In one embodiment, if a data collector shrinking event is detected, controlling the corresponding second data collector to stop collecting business data according to the currently loaded second collection configuration includes:

[0016] According to a preset time interval, obtaining configuration status information of the second acquisition configuration currently loaded by the second data collector;

[0017] If the configuration status information is an offline state, it is determined that a data collector shrinking event is detected, and the second data collector is controlled to stop collecting business data according to the second collection configuration after completing the most recent data collection task.

[0018] In one embodiment, obtaining the configuration status information of the second acquisition configuration currently loaded by the second data collector at a preset time interval includes:

[0019] According to the preset time interval, query the collection configuration association relationship corresponding to the second data collector; the collection configuration association relationship is the association relationship between the collector identifier corresponding to the second data collector and the second collection configuration currently loaded by the second data collector, and the collection configuration association relationship is generated when the data collection configuration center sends the second collection configuration to the second data collector;

[0020] When the collection configuration association relationship indicates that the second data collector and the second collection configuration have been unbound, it is determined that the configuration status information of the second collection configuration is an offline state.

[0021] In one embodiment, if a data collector expansion event is detected, determining a first data collector for expansion includes:

[0022] If a collector creation request sent by the data collection configuration center is received, it is determined that a data collector expansion event is detected;

[0023] In response to the data collector creation request, a data collector is created to respond, thereby obtaining a first data collector for capacity expansion.

[0024] In a second aspect, the present application also provides a data collector expansion and contraction device, comprising:

[0025] A trigger event detection module, used to detect expansion and contraction trigger events for the data collector; the expansion and contraction trigger events include data collector expansion events and data collector contraction events;

[0026] An expansion module, for determining a first data collector for expansion, loading a first collection configuration, and controlling the first data collector to collect business data according to the first collection configuration currently loaded, if an expansion event of the data collector is detected;

[0027] The capacity reduction module is used to control the corresponding second data collector to stop collecting business data according to the currently loaded second collection configuration if a capacity reduction event of the data collector is detected.

[0028] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0029] Detecting expansion and contraction triggering events for the data collector; the expansion and contraction triggering events include data collector expansion events and data collector contraction events;

[0030] If the data collector expansion event is detected, a first data collector for expansion is determined, a first collection configuration is loaded, and the first data collector is controlled to collect business data according to the first collection configuration currently loaded;

[0031] If a shrinking event of the data collector is detected, the corresponding second data collector is controlled to stop collecting the business data according to the currently loaded second collection configuration.

[0032] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0033] Detecting expansion and contraction triggering events for the data collector; the expansion and contraction triggering events include data collector expansion events and data collector contraction events;

[0034] If the data collector expansion event is detected, a first data collector for expansion is determined, a first collection configuration is loaded, and the first data collector is controlled to collect business data according to the first collection configuration currently loaded;

[0035] If a shrinking event of the data collector is detected, the corresponding second data collector is controlled to stop collecting the business data according to the currently loaded second collection configuration.

[0036] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0037] Detecting expansion and contraction triggering events for the data collector; the expansion and contraction triggering events include data collector expansion events and data collector contraction events;

[0038] If the data collector expansion event is detected, a first data collector for expansion is determined, a first collection configuration is loaded, and the first data collector is controlled to collect business data according to the first collection configuration currently loaded;

[0039] If a shrinking event of the data collector is detected, the corresponding second data collector is controlled to stop collecting the business data according to the currently loaded second collection configuration.

[0040] The above-mentioned data collector expansion and contraction method, device, computer equipment, computer-readable storage medium and computer program product detect expansion and contraction trigger events for data collectors, wherein the expansion and contraction trigger events include data collector expansion events and data collector contraction events; if a data collector expansion event is detected, the first data collector used for expansion is determined, the first collection configuration is loaded, and the first data collector is controlled to collect business data according to the currently loaded first collection configuration; if a data collector contraction event is detected, the corresponding second data collector is controlled to stop collecting business data according to the currently loaded second collection configuration. In this application, by introducing the idea of ​​decoupling the data collector from the data collection configuration, the tight coupling relationship between the data collector state and the business is successfully broken. When the data collector is expanded, by loading the first collection configuration on the corresponding first data collector and controlling the first data collector to collect data according to the first collection configuration, the first data collector can be flexibly added to collect designated business data according to changes in business needs, so that it can flexibly adapt to fluctuations in business needs, and expand and contract each data collector in time, effectively improving the flexibility and efficiency of data collector expansion and contraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0042] Figure 1 A schematic diagram of a flow chart of a method for scaling up and down a data collector in one embodiment;

[0043] Figure 2 A schematic diagram of a flow chart of a data collector expansion step in an embodiment;

[0044] Figure 3 A schematic diagram of a flow chart of a data collector expansion step in another embodiment;

[0045] Figure 4 A schematic diagram of a process of reducing the capacity of a data collector in one embodiment;

[0046] Figure 5 A schematic diagram of a data collector cluster framework in one embodiment;

[0047] Figure 6 A schematic diagram of a flow chart of a method for scaling up and down a data collector in another embodiment;

[0048] Figure 7 It is a structural block diagram of a data collector expansion and contraction device in one embodiment;

[0049] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0051] In an exemplary embodiment, Figure 1 As shown, a data collection expansion and contraction method is provided. This embodiment uses the method applied to a server as an example. It can be understood that the method can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the following steps S102 to S106 are included. Among them:

[0052] Step S102, detecting a capacity expansion and contraction triggering event for a data collector; the capacity expansion and contraction triggering event includes a data collector capacity expansion event and a data collector capacity contraction event.

[0053] Among them, the expansion and contraction triggering event can be a specified event that triggers the data collector to expand or shrink, including data collector expansion events and data collector shrink events. In one example, when the data collector is deployed on a cloud platform, it can be deployed based on a distributed architecture of container technology. At this time, the data collector can be the basic unit for running containerized applications, which is also called a Pod.

[0054] A data collector expansion event may be an event in which data collector instances are to be added to cope with the growth of business demand. When a data collector expansion event is detected, the number of data collectors can be increased accordingly, and more business data can be collected through the increased data collectors. A data collector reduction event may be an event in which data collector instances are to be reduced to save resources to cope with the reduction of business demand. When a data collector reduction event is detected, the number of data collectors can be reduced accordingly to reduce the amount of business data collected.

[0055] In some exemplary embodiments, the server can monitor the business flow and load conditions to detect in real time whether there are changes in business demand. When it is detected that the business flow reaches a preset expansion threshold, a data collector expansion event is triggered; when it is detected that the business flow is lower than a preset reduction threshold, a data collector reduction event is triggered. In other embodiments, it is also possible to detect whether a data collector expansion operation or a data collector reduction operation actively triggered by a user is received. When the operation is detected, it can be confirmed that the expansion and reduction trigger event is detected.

[0056] In actual applications, the detection of data collector expansion events and data collector reduction events can be concretized in combination with different business scenarios. For example, on an e-commerce platform, the system can be set to monitor traffic growth during platform activities, and automatically trigger expansion events when traffic surges to ensure the stability and response speed of the platform. Similarly, during business downturns (such as non-peak hours at night), the system can automatically trigger reduction events to save computing resources and costs.

[0057] Step S104: if a data collector expansion event is detected, a first data collector for expansion is determined, a first collection configuration is loaded, and the first data collector is controlled to collect business data according to the currently loaded first collection configuration.

[0058] Among them, the data collector expansion event refers to a specified trigger event that requires adding a data collector instance to collect more business data; to facilitate distinction from other data collectors in this article, the data collector selected for adding a data collector instance during the expansion process is called the first data collector.

[0059] The collection configuration refers to the configuration file required by the data collector when it is running. The collection configuration can be used to indicate the business data to be collected by the data collector and the data collection method. In one example, the collection configuration can record at least one of the following information: data source information corresponding to the business data to be collected and data collection strategy. In order to distinguish it from other collection configurations in this article, the collection configuration loaded by the first data collector is called the first collection configuration.

[0060] In some embodiments, when the business traffic reaches a preset expansion threshold, or when it is detected that a user or other device actively triggers an increase in the number of data collectors, the server can determine the triggering event of the data collector expansion, and determine the corresponding first data collector, and load the first acquisition configuration for the first data collector. Exemplarily, the first acquisition configuration can be obtained from other devices that store acquisition configurations. Of course, if the first data collector can cache data, the first acquisition configuration can also be determined from the acquisition configuration cached by the first data collector. Then, the first data collector starts to collect business data according to the loaded first acquisition configuration. During the collection process, the first data collector will execute the data collection task according to the strategy in the configuration, and send the collected data to the designated storage or processing unit.

[0061] In the specific implementation, the processing of data collector expansion events can be specific in combination with different business scenarios. For example, in the Internet of Things (IoT) system, when an increase in the number of devices or a surge in data traffic is detected, the server can automatically expand capacity to ensure the timeliness and reliability of data collection.

[0062] Step S106: If a data collector shrinking event is detected, the corresponding second data collector is controlled to stop collecting business data according to the currently loaded second collection configuration.

[0063] Among them, the data collector scaling down event refers to a specified trigger event that requires reducing data collector instances to reduce business data collection. In order to distinguish it from other data collectors in this article, the data collector that is selected to stop the collection task during the scaling down process is referred to as the second data collector. In some embodiments, the second data collector that is selected to stop collecting business data has been loaded with the corresponding collection configuration, and the data collector loaded with the collection configuration can be referred to as a data collector instance. For the sake of distinction, the collection configuration loaded by the second data collector at run time is referred to as the second collection configuration. In one example, the second collection configuration may record at least one of the following information: data source information corresponding to the business data to be collected, collection strategy, etc.

[0064] In some embodiments, when the business traffic is lower than a preset reduction threshold, or when it is detected that a user or other device actively triggers a reduction in the number of data collectors, the server can determine that a data collector reduction event has been triggered. At this time, the server can control the second data collector to continue collecting data according to the second collection configuration that has been loaded. In some embodiments, after the second data collector has stopped collecting business data according to the second collection configuration, the collection configuration loaded in the second data collector can be deleted, and the server can be waited for to reload the new collection configuration into the second data collector according to relevant instructions.

[0065] In the above-mentioned method for scaling up and down of a data collector, a scaling up and down triggering event for a data collector is detected, wherein the scaling up and down triggering event includes a data collector scaling up event and a data collector scaling down event; if a data collector scaling up event is detected, a first data collector for scaling up is determined, a first collection configuration is loaded, and the first data collector is controlled to collect business data according to the first collection configuration currently loaded; if a data collector scaling down event is detected, the corresponding second data collector is controlled to stop collecting business data according to the second collection configuration currently loaded. In this embodiment, by introducing the idea of ​​decoupling the data collector from the data collection configuration, the tight coupling relationship between the data collector state and the business is successfully broken. When the data collector is scaled up, by loading the first collection configuration on the corresponding first data collector and controlling the first data collector to collect data according to the first collection configuration, the first data collector can be flexibly added to collect designated business data according to changes in business needs, thereby being able to flexibly adapt to fluctuations in business needs, and scaling up and down each data collector in a timely manner, effectively improving the flexibility and efficiency of scaling up and down of the data collector.

[0066] In addition, this application not only simplifies the process of scaling up and down, but also improves the adaptability of the data collector, achieving higher management flexibility and efficiency, simplified operating procedures and rapid scaling response capabilities, so that the system can quickly expand capacity when business demand surges, ensuring the performance and efficiency of data collection, and shrink capacity in time when business demand decreases, saving resources and costs.

[0067] In one embodiment, in step S104, loading the first acquisition configuration may include the following steps:

[0068] A configuration acquisition request is sent to a data acquisition configuration center; the configuration acquisition request is used to trigger the data acquisition configuration center to search for data acquisition configurations in an idle state and return configuration search results; and a first acquisition configuration is obtained according to the configuration search results returned by the data acquisition configuration center.

[0069] In a specific implementation, a data collection configuration center may be set up, and the data collection configuration center may be responsible for creating, allocating, updating, and deleting one or more collection configurations. After determining the first data collector, the first data collector may send a first collection configuration request to the data collection configuration center, and after receiving the request, the data collection configuration center may search for an idle collection configuration from the stored collection configurations, wherein the idle collection configuration may be a collection configuration that has not been sent to the data collector.

[0070] Optionally, the data collection configuration center can generate a new first collection configuration file according to business needs. The generated collection configuration file is stored in the configuration library and marked as enabled to ensure that the new collection configuration is available. After receiving the expansion instruction, the data collection configuration center can call the preset interface to increase the number of container copies of the specified service. When the server manages containerized applications on multiple hosts in the cloud platform through the target application (such as kubernetes, i.e. K8s), the k8s interface can be called to increase the number of container copies, thereby increasing the number of data collectors. For example, from the current 10 copies to 20 copies to cope with the growth of business needs. K8s starts a new Pod instance (i.e., the first data collector) according to the instructions of the data collection configuration center. Each new Pod instance is created according to a predefined template and is ready to run the data collection task. After the newly created Pod instance is started, the first data collector obtains the latest first collection configuration file from the data collection configuration center. The first data collector verifies the integrity and correctness of the configuration file and executes the data collection task according to the policy in the configuration file.

[0071] In one embodiment, Figure 2 As shown, users can create and enable new collection configurations in the configuration center. In response to user operations, the data collection configuration center can call the Kubernetes interface and send a collector creation request to increase the number of container copies, that is, to increase the number of data collectors. After receiving the collector creation request, Kubernetes can create a new pod and obtain the first collection configuration from the data collection configuration center to start data collection.

[0072] During the detection process of expansion and reduction events, the configuration center calls the K8s interface to adjust the number of container replicas, perform elastic scaling and automated management, further optimize resource utilization, ensure high availability and stability of the system, and ensure that the system can flexibly respond to changes in business needs.

[0073] In this embodiment, by dynamically allocating idle collection configurations, effective use of resources is ensured, and idle or wasted resources are avoided. The automated configuration acquisition process reduces manual intervention, reduces errors caused by manual operations, and improves management efficiency. Through the data collection configuration center, system operation and maintenance work is simplified, dependence on professional technicians is reduced, and operation and maintenance costs and technical barriers are reduced.

[0074] In one embodiment, in step S104, before the first data collector starts to collect data, the first collection configuration is obtained according to the configuration search result returned by the data collection configuration center, and the following steps may also be included:

[0075] If the configuration search result returned by the data collection configuration center includes the collection configuration, the collection configuration is determined as the first collection configuration; if the configuration search result returned by the data collection configuration center does not include the collection configuration, a configuration acquisition request is sent to the configuration center at a preset time interval until the acquired configuration search result includes the collection configuration.

[0076] In this embodiment, when the search results returned by the data collection configuration center do not include the collection configuration, by continuously sending the configuration to the configuration center, the server can automatically obtain the idle collection configuration added by the user in the data collection configuration center as soon as possible, and start normal collection work, thereby improving the expansion efficiency of the data collector.

[0077] In order to better understand the above embodiment, an illustrative example is provided below for explanation. Figure 3 As shown, when the Pod of the data collector is started, a configuration request can be initiated to the configuration center through its Pod name, which includes the Pod name and the request identifier. After receiving the first collection configuration request, the data collection configuration center checks whether there is an available idle configuration, that is, an idle collection configuration. If there is an idle configuration, the data collection configuration center randomly selects a collection configuration, binds the collection configuration with the requested Pod name, stores the binding relationship in the MySQL relationship table, and returns the selected collection configuration to the first data collector through the network. If there is no idle configuration available for allocation, the data collection configuration center will send an empty configuration or configuration missing indication to the data collector. After the data collector receives the collection configuration (that is, the first collection configuration) returned by the data collection configuration center, it performs a detection of the legality of the collection configuration. Among them, the detection of legality refers to whether the received collection configuration is an empty configuration. If the collection configuration verification passes, the first data collector executes the normal data collection process according to the configuration. If the configuration verification fails, the first data collector enters a dormant state and waits for a period of time before initiating the first collection configuration request to the data collection configuration center again.

[0078] The automatic initiation of configuration requests reduces manual intervention and improves the automation of system management. Automatically checking and distributing configuration files improves the efficiency of system management. At the same time, the configuration center can distribute configuration files in real time to ensure that the data collector can obtain the configuration in time and start the data collection task. When there is no idle configuration, by sending an indication of empty configuration or missing configuration, the data collector can enter a dormant state and wait for the configuration to be re-acquired, which enhances the system's fault tolerance.

[0079] In one embodiment, in step S106, controlling the corresponding second data collector to stop collecting business data according to the currently loaded second collection configuration may include the following steps:

[0080] At preset time intervals, the configuration status information of the second collection configuration currently loaded by the second data collector is obtained; if the configuration status information is offline, it is determined that a data collector shrinkage event has been detected, and the second data collector is controlled to stop collecting business data according to the second collection configuration after completing the most recent data collection task.

[0081] In a specific implementation, the preset time interval may refer to a fixed time period set by the system for periodically executing specific operations or tasks. The offline state may be a state where the collection configuration is currently unusable or has been cancelled. The offline state of the collection configuration may be determined by the management policy of the data collection configuration center or set by the administrator.

[0082] Optionally, the data acquisition configuration center sets a preset time interval, for example, every 5 minutes, and the server can send a request to the second data collector at the preset time interval to obtain the status information of the currently loaded second acquisition configuration. The server receives and analyzes the returned configuration status information to check whether the second acquisition configuration is offline. If the data acquisition configuration center confirms that the second acquisition configuration is offline based on the configuration status information, the server will trigger a corresponding reduction event. The reduction event includes notifying the second data collector to stop collecting business data according to the second acquisition configuration after completing the current task.

[0083] Specifically, when the server determines that the second collection configuration is offline according to the status information of the second collection configuration, the second data collector can be controlled to start executing a graceful shutdown process. The second data collector completes the most recent data collection task, such as the data collection task currently being executed, and ensures that all collected data has been properly processed and stored. Then the second data collector stops the collection work and releases resources.

[0084] In this embodiment, the configuration status information of the second data collector is automatically obtained at a preset time interval, thereby achieving real-time monitoring of the data collector status. By ensuring that the second data collector completes the current task before it stops collecting, data loss or collection interruption is avoided, thereby ensuring the continuity of the data collection task. In one embodiment, in step 106, controlling the corresponding second data collector to stop collecting business data according to the currently loaded second collection configuration may also include the following steps:

[0085] According to the preset time interval, the collection configuration association relationship corresponding to the second data collector is queried; the collection configuration association relationship is the association relationship between the collector identifier corresponding to the second data collector and the second collection configuration currently loaded by the second data collector, and the collection configuration association relationship is generated when the data collection configuration center issues the second collection configuration to the second data collector; when the collection configuration association relationship indicates that the second data collector and the second collection configuration have been unbound, it is determined that the configuration status information of the second collection configuration is offline.

[0086] In a specific implementation, after the data acquisition configuration center finds out the idle acquisition configuration and sends it to the corresponding data collector, it can associate the acquisition configuration with the data collector, specifically by generating and storing an association relationship between the collector identifier corresponding to the data collector and the issued acquisition configuration, wherein the association relationship can indicate whether the data collector is currently bound to the acquisition configuration. Correspondingly, the association relationship between the second data collector and the second acquisition configuration it has loaded can also be stored in the data acquisition configuration center.

[0087] Then, the server can send a request to the second data collector at a preset time interval to obtain the association relationship of the second collection configuration currently loaded by the second data collector from the data collection configuration center. After the server obtains the collection configuration association relationship, it checks whether the collection configuration association relationship indicates that the second collection configuration has been unbound from the second data collector. If the collection configuration association relationship is the unbinding of the second data collector and the second collection configuration, the server will confirm that the configuration status of the second collection configuration is offline. At this time, the server notifies the second data collector to stop collecting business data according to the second collection configuration.

[0088] In one embodiment, if Figure 4 As shown, the data collection configuration center changes the configuration of the second data collector to stop collection, the data collection configuration center releases the relationship between the second collection configuration and the pod name, the second data collector periodically refreshes the second collection configuration to obtain the offline signal, the second data collector gracefully exits and then restarts, and re-enters the waiting configuration state after restarting.

[0089] In one embodiment, after receiving the scaling-down instruction, the data collection configuration center updates the collection configuration (i.e., the second collection configuration) of the data collector (i.e., the second data collector), and changes the state of the data collector to stop collection. This collection configuration change includes setting the task state of the data collector to unavailable and stopping receiving new tasks. After updating the collection configuration, the data collection configuration center releases the binding relationship between the collection configuration and the corresponding Pod name, deletes the relevant binding record in the MySQL relationship table, and ensures that the collection configuration is no longer associated with the Pod. Then, the data collector can send a collection configuration refresh request to the data collection configuration center at a preset time interval to obtain the latest collection configuration status. After receiving the offline signal, the data collector completes the current data collection task, ensures that all data has been processed and stored, stops all processes, releases resources, and then restarts itself. After the data collector restarts, it enters the initial waiting configuration state, and again initiates a configuration request to the data collection configuration center, waiting for the allocation of a new configuration file.

[0090] In this embodiment, by checking the collection configuration association relationship, the configuration status information of the second data collector can be updated in real time, and the automated unbinding operation improves the efficiency of system management and ensures that the configuration file is not used incorrectly. When the association relationship indicates that the binding has been untied, it can be accurately determined that the configuration status information of the second collection configuration is offline. Only when the collection configuration is no longer needed, it is marked as offline, which allows for reasonable recycling and reallocation of resources. It is understandable that the first data collector used for expansion can also be determined before loading the first collection configuration.

[0091] In one embodiment, if a data collector creation request sent by a data collection configuration center is received, it is determined that a data collector expansion event is detected; a data collector is created in response to the collector creation request to obtain a first data collector for expansion.

[0092] Optionally, when the data collection configuration center receives a data collector creation request, the server determines that a data collector expansion event is detected. The data collector responds and creates a responsive data collector instance based on the received creation request. The first data collector creation service creates a first data collector for expansion based on the requirements of the expansion event. This includes loading the first collection configuration and starting to collect business data according to the current configuration.

[0093] In some embodiments, Figure 5As shown in the figure, the data collector is deployed on the K8s cluster and centrally managed through a unified container. Kubernetes (K8s) is an open source container orchestration platform for automating the deployment, expansion and management of containerized applications. The number of container replicas is the number of container instances running an application in Kubernetes. Pod is the smallest deployment unit in Kubernetes and contains one or more containers. The number of Pods associated with a container is dynamically scaled according to the number of real-time online data sources for collection. After each Pod is successfully started, it will automatically obtain its corresponding first collection configuration from the configuration center and start the service accordingly. The Pod itself is designed to be stateless, that is, it does not store any persistent data. All scheduling and configuration are uniformly controlled and managed by the data collection configuration center, ensuring the high availability and flexibility of the system.

[0094] In this embodiment, the creation request issued by the data collection configuration center is quickly identified and responded to to ensure timely processing of expansion events. By creating a new data collector instance, it helps to maintain or increase the coverage and processing capacity of data collection, and ensure the continuity and integrity of data collection. At the same time, the automated expansion mechanism enables the system to flexibly adapt to changes in data collection requirements, thereby enhancing the scalability of the system.

[0095] In order to enable those skilled in the art to better understand the above steps, the embodiment of the present application is illustrated below by using an example, but it should be understood that the embodiment of the present application is not limited to this.

[0096] In traditional data collector expansion and contraction technologies, simple elastic scaling technology is often used, which requires data collectors to establish a tight coupling relationship with data sources. Each data collector needs to establish a tight coupling relationship with a specific data source, which leads to complex configuration and management difficulties in the system. With the growth of business and the increase of data sources, managing multiple tightly coupled data collectors becomes complex and prone to errors. Relying solely on elastic scaling technology may lead to an increase in operation and maintenance management costs. The deployment and scheduling of each data collector requires more manpower and time investment, especially when facing large-scale data source changes or business demand changes. Although elastic scaling technology can dynamically adjust the number of service replicas according to the load, for each specific data collector, due to the tight coupling relationship with the data source, more manual intervention and adjustment are required when expanding and upgrading services, which is inefficient. Due to the tight coupling relationship, once a failure occurs or adjustment is required, it may affect the stability and service quality of multiple data collectors, resulting in an increase in failure rate and low adjustment efficiency.

[0097] In this embodiment, if Figure 6 As shown, this example includes the following steps:

[0098] Step S602: Detecting a capacity expansion and contraction triggering event for a data collector; the capacity expansion and contraction triggering event includes a data collector capacity expansion event and a data collector capacity contraction event;

[0099] Step S604: If a data collector expansion event is detected, a configuration acquisition request is sent to the data collection configuration center. The configuration acquisition request is used to trigger the data collection configuration center to search for an idle collection configuration and return a configuration search result. If the configuration search result returned by the data collection configuration center contains the collection configuration, the collection configuration is determined as the first collection configuration. If the configuration search result returned by the data collection configuration center does not contain the collection configuration, a configuration acquisition request is sent to the configuration center at a preset time interval until the acquired configuration search result contains the collection configuration.

[0100] Step S606: If a data collector shrinkage event is detected, obtain the configuration status information of the second collection configuration currently loaded by the second data collector at a preset time interval. If the configuration status information is offline, it is determined that a data collector shrinkage event has been detected, and control the second data collector to stop collecting business data according to the second collection configuration after completing the most recent data collection task.

[0101] The method for data acquisition and expansion provided in the embodiment of the present application has the following technical effects: on the one hand, the system can detect expansion and contraction triggering events to ensure timely response to changes in business needs, and at the same time realize an automated configuration acquisition process, which can trigger the data acquisition configuration center to find and allocate idle acquisition configurations without manual intervention. By monitoring the acquisition configuration, the error rate of the system is reduced. At the same time, in the case of idle configurations, the system periodically obtains new configurations to ensure the consistency of system processes, the rational use of resources, and improved flexibility. On the other hand, when a contraction event is detected, the system is allowed to check and recycle no longer needed resources at preset time intervals to achieve flexible resource management. The second data collector will complete the current task before stopping the acquisition to ensure the integrity of the data and the continuity of the acquisition task.

[0102] In this embodiment, by automatically detecting expansion and contraction events, dynamically allocating or reclaiming configuration resources, and ensuring the continuity of task completion, efficient response of the data acquisition system, optimal utilization of resources and improvement of cost-effectiveness are achieved, while ensuring the stability of the system and the integrity of task execution.

[0103] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0104] Based on the same inventive concept, the embodiment of the present application also provides a data collector expansion and contraction device for implementing the data collector expansion and contraction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data collector expansion and contraction device embodiments provided below can refer to the limitations of the data collector expansion and contraction method above, and will not be repeated here.

[0105] In an exemplary embodiment, Figure 7 As shown, a data collector expansion and contraction device is provided, including: a trigger event detection module 710, an expansion module 720 and a contraction module 730, wherein:

[0106] The trigger event detection module 710 is used to detect the expansion and contraction trigger events for the data collector; the expansion and contraction trigger events include the data collector expansion event and the data collector contraction event;

[0107] The expansion module 720 is used to determine the first data collector for expansion if the data collector expansion event is detected, load the first collection configuration, and control the first data collector to collect business data according to the first collection configuration currently loaded;

[0108] The shrinking module 730 is used to control the corresponding second data collector to stop collecting business data according to the currently loaded second collection configuration if a shrinking event of the data collector is detected.

[0109] In one embodiment, the expansion module 720 is used to:

[0110] Send a configuration acquisition request to the data acquisition configuration center; the configuration acquisition request is used to trigger the data acquisition configuration center to search for data acquisition configurations that are in an idle state and return the configuration search result;

[0111] The first collection configuration is obtained according to the configuration search result returned by the data collection configuration center.

[0112] In one embodiment, the expansion module 720 is used to:

[0113] If the configuration search result returned by the data collection configuration center includes the collection configuration, the collection configuration is determined as the first collection configuration;

[0114] If the configuration search result returned by the data collection configuration center does not include the collection configuration, a configuration request is initiated to the configuration center at a preset time interval until the configuration search result obtained includes the collection configuration.

[0115] In one embodiment, the capacity reduction module 730 is used to:

[0116] According to a preset time interval, obtaining configuration status information of the second acquisition configuration currently loaded by the second data collector;

[0117] If the configuration status information is an offline state, it is determined that a data collector shrinking event is detected, and the second data collector is controlled to stop collecting business data according to the second collection configuration after completing the most recent data collection task.

[0118] In one embodiment, the capacity reduction module 730 is used to:

[0119] According to a preset time interval, query the collection configuration association relationship corresponding to the second data collector; the collection configuration association relationship is the association relationship between the collector identifier corresponding to the second data collector and the second collection configuration currently loaded by the second data collector, and the collection configuration association relationship is generated when the data collection configuration center issues the second collection configuration to the second data collector;

[0120] When the collection configuration association relationship indicates that the second data collector and the second collection configuration have been unbound, it is determined that the configuration status information of the second collection configuration is an offline state.

[0121] In one embodiment, the expansion module 720 is used to:

[0122] If a collector creation request sent by the data collection configuration center is received, it is determined that the data collector expansion event is detected;

[0123] In response to the data collector creation request, a responding data collector is created to obtain a first data collector for capacity expansion.

[0124] Each module in the above-mentioned data acquisition expansion and contraction device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0125] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a data acquisition expansion and contraction method is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0126] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0127] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0128] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0129] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0130] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0131] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0132] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0133] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for expanding and contracting a data collector, characterized in that: The method comprises: Detecting expansion and contraction triggering events for the data collector; the expansion and contraction triggering events include data collector expansion events and data collector contraction events; If the data collector expansion event is detected, a first data collector for expansion is determined, a first collection configuration is loaded, and the first data collector is controlled to collect business data according to the first collection configuration currently loaded; If a shrinking event of the data collector is detected, the corresponding second data collector is controlled to stop collecting the business data according to the currently loaded second collection configuration.

2. The method according to claim 1, characterized in that The loading of the first acquisition configuration includes: Sending a configuration acquisition request to a data acquisition configuration center; the configuration acquisition request is used to trigger the data acquisition configuration center to search for an idle acquisition configuration and return a configuration search result; A first acquisition configuration is obtained according to the configuration search result returned by the data acquisition configuration center.

3. The method according to claim 2, characterized in that The obtaining of the first acquisition configuration according to the configuration search result returned by the data acquisition configuration center includes: If the configuration search result returned by the data acquisition configuration center includes an acquisition configuration, determining the acquisition configuration as the first acquisition configuration; If the configuration search result returned by the data acquisition configuration center does not include the acquisition configuration, a configuration acquisition request is sent to the configuration center at a preset time interval until the acquired configuration search result includes the acquisition configuration.

4. The method according to claim 1, characterized in that If the data collector shrinking event is detected, controlling the corresponding second data collector to stop collecting business data according to the currently loaded second collection configuration includes: According to a preset time interval, obtaining configuration status information of the second acquisition configuration currently loaded by the second data collector; If the configuration status information is an offline state, it is determined that a shrinking event of the data collector is detected, and the second data collector is controlled to stop collecting business data according to the second collection configuration after completing a recent data collection task.

5. The method according to claim 4, characterized in that The step of obtaining the configuration status information of the second acquisition configuration currently loaded by the second data collector at a preset time interval includes: According to a preset time interval, query the collection configuration association relationship corresponding to the second data collector; the collection configuration association relationship is the association relationship between the collector identifier corresponding to the second data collector and the second collection configuration currently loaded by the second data collector, and the collection configuration association relationship is generated when the data collection configuration center issues the second collection configuration to the second data collector; When the collection configuration association relationship indicates that the second data collector and the second collection configuration have been unbound, it is determined that the configuration status information of the second collection configuration is an offline state.

6. The method according to any one of claims 1 to 5, characterized in that If the data collector expansion event is detected, determining a first data collector for expansion includes: If a collector creation request sent by the data collection configuration center is received, it is determined that the data collector expansion event is detected; In response to the data collector creation request, a responding data collector is created to obtain a first data collector for capacity expansion.

7. A data collector expansion and contraction device, characterized in that: The device comprises: A trigger event detection module, used to detect expansion and contraction trigger events for the data collector; the expansion and contraction trigger events include data collector expansion events and data collector contraction events; An expansion module, for determining a first data collector for expansion, loading a first collection configuration, and controlling the first data collector to collect business data according to the first collection configuration currently loaded, if an expansion event of the data collector is detected; The capacity reduction module is used to control the corresponding second data collector to stop collecting business data according to the currently loaded second collection configuration if a capacity reduction event of the data collector is detected.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Data acquisition method and device, computer equipment and storage medium

    CN119603119A

  • Data acquisition method and device, computer device and storage medium

    CN119603119B