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

By establishing a data item collection table and obtaining configuration information, and using the sharding table to determine active clients, automatic data collection is realized, which solves the problem of low data collection efficiency in business splitting and microservice scenarios, and improves the adaptability of data collection. and efficiency.

CN118656262APending Publication Date: 2024-09-17MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410020654.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-04
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

In business splitting and microservice splitting scenarios, existing data collection methods require frequent rewriting of tools, resulting in low data collection efficiency and inability to adapt to rapidly changing application scenarios.

Method used

Provide a general data collection method, by establishing a data item collection table and obtaining configuration information, determining active target clients based on the sharding table, automatically allocating and storing data items, and realizing automatic execution of data collection.

Benefits of technology

This method reduces repetitive intermediate links, adapts to a variety of data collection tasks, improves data collection efficiency, and saves developers' coding costs and time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656262A
    Figure CN118656262A
Patent Text Reader

Abstract

The invention provides a data collection method, device and equipment and a computer readable storage medium. The method comprises the following steps: in response to a data acquisition task, establishing a data item acquisition table, and writing to-be-acquired data items in the data acquisition task into the data item acquisition table; acquiring configuration information for the data acquisition task, wherein the configuration information comprises data acquisition opportunity information and a data storage position; determining a target client in an active state according to a fragment table under the condition that a data acquisition opportunity is reached, and distributing the to-be-acquired data items in the data item acquisition table to the target client; and receiving target data acquired by the target client according to the to-be-acquired data item, and storing the target data in the data storage position. According to the invention, the universal data acquisition method can be provided, and the data acquisition efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data acquisition method, device, equipment and computer-readable storage medium. Background Art

[0002] When a new application is developed and launched, it is necessary to monitor the quality, accuracy, and security of the business in a timely and effective manner. Developers are usually required to write a set of data collection tools to manually collect some data that needs to be monitored for visual output, so as to monitor the data. In scenarios where business splitting and microservice splitting are required, many new applications will be split out and launched independently. At this time, the original solution will not be applicable, and a new set of data collection tools will need to be rewritten. Summary of the invention

[0003] The embodiments of the present application provide a data collection method, a device and a computer-readable storage medium, which can provide a universal data collection method and improve the efficiency of data collection.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present application provides a data collection method, the method comprising:

[0006] In response to a data collection task, a data item collection table is established, and the data items to be collected in the data collection task are written into the data item collection table; configuration information for the data collection task is obtained, and the configuration information includes data collection timing information and data storage location; when the data collection timing is reached, the target client in the active state is determined according to the sharding table, and the data items to be collected in the data item collection table are allocated to the target client; the target data collected by the target client according to the data items to be collected is received, and the target data is stored in the data storage location.

[0007] The present application provides a data acquisition device, the device comprising:

[0008] An establishment module is used to establish a data item collection table in response to a data collection task, and write the data items to be collected in the data collection task into the data item collection table; an acquisition module is used to obtain configuration information for the data collection task, and the configuration information includes data collection timing information and data storage location; a determination module is used to determine the target client in an active state according to the sharding table when the data collection timing is reached, and allocate the data items to be collected in the data item collection table to the target client; a storage module is used to receive the target data collected by the target client according to the data items to be collected, and store the target data in the data storage location.

[0009] An embodiment of the present application provides an electronic device, the electronic device comprising:

[0010] The memory is used to store computer executable instructions; the processor is used to implement the data collection method provided in the embodiment of the present application when executing the computer executable instructions stored in the memory.

[0011] An embodiment of the present application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the data acquisition method provided in the embodiment of the present application when executed by a processor.

[0012] An embodiment of the present application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, the data collection method provided in the embodiment of the present application is implemented.

[0013] The embodiments of the present application have the following beneficial effects:

[0014] When a data collection task is received, a data item collection table can be established according to the data collection task, and the data items to be collected corresponding to the data collection task can be written into the data item collection table. At the same time, the configuration information of the data collection timing and data storage location for this data collection task can be obtained, thereby completing a small configuration of the data collection task, and realizing the automatic execution of data collection. For different data collection tasks, the difference is only in the data items to be collected, the data collection timing and the data storage location. After configuring the data items to be collected, the data collection timing and the data storage location, the process of determining the target client in the active state, allocating the data items to be collected to the target client and the target client performing data collection is the same. Therefore, the data collection method provided in the embodiment of the present application is adapted to a variety of tasks, thereby realizing a general data collection method and improving data collection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1is a structural diagram of a data acquisition system 100 provided in an embodiment of the present application;

[0016] Figure 2 is a schematic diagram of the structure of the server 200 provided in an embodiment of the present application;

[0017] Figure 3 It is a schematic diagram of the implementation process of the data collection method provided in the embodiment of the present application;

[0018] Figure 4 It is a schematic diagram of the implementation process of updating the update time in the shard table provided in an embodiment of the present application;

[0019] Figure 5 It is a schematic diagram of the implementation process of sending a data collection instruction provided in an embodiment of the present application;

[0020] Figure 6 It is a schematic diagram of the implementation process of the target data visualization output provided by the embodiment of the present application;

[0021] Figure 7 It is a schematic diagram of the implementation process of data collection and visual output provided by the embodiment of the present application;

[0022] Figure 8 This is another implementation flow diagram of the data collection method provided in the embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0024] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0025] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0026] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0027] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0028] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0029] 1) Heartbeat data: A custom structure (heartbeat packet) is sent periodically to let the receiver know that the sender is still active, thus ensuring the validity of the connection.

[0030] 2) Distributed: A method of computing and data processing that distributes computing tasks or data to multiple computers or nodes for processing.

[0031] 3) Data monitoring: refers to data collection and data presentation, using data analysis tools to collect available user data and various data generated in the business line. After collection, the data is processed using tools and presented in the form of visual charts.

[0032] 4) Database: A computer software system that stores and manages data according to data structures.

[0033] When a new application is developed and launched, it is necessary to monitor the quality, accuracy, and security of the business effectively and timely. The method in the related art is to have the developer write a set of data collection tools to manually collect some data that needs to be monitored for visual output, thereby monitoring the data. Specifically, the following steps are included:

[0034] The first step is to collect the data items that need to be collected.

[0035] In the second step, developers formulate plans for data collection and visualization output based on the data items that need to be collected.

[0036] In the third step, the developer develops a timed executor.

[0037] The fourth step is to configure the timer for scheduled execution according to the specified data collection plan.

[0038] The fifth step is to obtain the collected data after the timer is executed.

[0039] The sixth step is to visualize the data according to the developed data visualization plan.

[0040] In scenarios where business splitting and microservice splitting are required, many new applications will be split out and launched independently. At this time, when data collection is needed, the original solution will not be applicable, so the above steps need to be repeated again, and developers need to write a new set of data collection tools. Therefore, the above process needs to be repeated every time data collection is performed in the relevant methods, which is inefficient.

[0041] In order to solve the above problems and meet the purpose of quickly collecting data, the embodiments of the present application provide a data collection method, device, equipment and computer-readable storage medium, which realize a distributed and universal data collection method, reduce repetitive intermediate links, and automatically realize new data collection tasks by only configuring the data items to be collected, the timing of data collection, the data storage location, etc.

[0042] The following describes an exemplary application of the electronic device provided by the embodiment of the present application. The device provided by the embodiment of the present application can be implemented as a laptop, a tablet computer, a desktop computer, a set-top box, a mobile device (for example, a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable gaming device), a smart phone, a smart speaker, a smart watch, a smart TV, a vehicle-mounted terminal and other types of user terminals, and can also be implemented as a server. The following describes an exemplary application when the device is implemented as a server.

[0043] See also Figure 1 , Figure 1 is a structural diagram of a data acquisition system 100 provided in an embodiment of the present application, Figure 1 The server 200, network 300, terminal 400, application 410, shard table 500, and data item collection table 600 are involved. It can be understood that application 410 can be multiple applications running in terminal 400. Figure 1 The application 410 is exemplarily shown in FIG. The server 200 and the terminal 400 are connected via a network 300, and the network 300 may be a wide area network or a local area network, or a combination of the two.

[0044] In some embodiments, when a new application 410 is launched in the terminal 400, a data collection task is generated according to demand. When the server 200 receives the start instruction of the data collection task, a sharding table 500 and a data item collection table 600 are established, and the data items that the application 410 needs to collect are obtained and written into the data item collection table. The configuration information for the data collection task is obtained, including: data collection timing information and data storage location. When it is determined that the data collection timing has been reached, the target client in the active state and the target data item corresponding to the target client are determined according to the sharding table. The target client in the terminal 400 is notified to collect the target data through the server 200. After the client in the terminal 400 completes the collection, the server 200 receives the target data and stores it in the data storage location for monitoring the target data.

[0045] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal 400 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a car terminal, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0046] See also Figure 2 , Figure 2 is a schematic diagram of the structure of the server 200 provided in an embodiment of the present application, Figure 2 The server 200 shown includes: at least one processor 210, a memory 230 and at least one network interface 220. The various components in the server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 240 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 240 is not described in detail. Figure 2 Various buses are labeled as bus system 240 .

[0047] The processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0048] The memory 230 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 230 may optionally include one or more storage devices that are physically remote from the processor 210.

[0049] The memory 230 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 230 described in the embodiment of the present application is intended to include any suitable type of memory.

[0050] In some embodiments, memory 230 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0051] Operating system 231, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0052] The network communication module 232 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 220. Exemplary network interfaces 220 include: Bluetooth, Wireless Authentication (WiFi), and Universal Serial Bus (USB).

[0053] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 2 The data acquisition device 233 stored in the memory 230 is shown, including the following software modules: a building module 2331, an acquisition module 2332, a determination module 2333 and a storage module 2334. These modules are logical, and therefore can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.

[0054] In other embodiments, the device provided in the embodiments of the present application can be implemented in hardware. As an example, the device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the data acquisition method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (Application Specific Integ rated Circuit, ASIC), digital signal processors (Digital Signal Processor, DSP), programmable logic devices (Programmable Logic Device, PLD), complex programmable logic devices (Complex Programmable Logic Device, CPLD), field programmable gate arrays (Field-Progr ammable Gate Array, FPGA) or other electronic components.

[0055] The data collection method provided in the embodiment of the present application will be explained in combination with the exemplary application and implementation of the server provided in the embodiment of the present application.

[0056] The following describes the data collection method provided in the embodiment of the present application. As mentioned above, the data collection method provided in the embodiment of the present application is described with the server as the execution subject, so the execution subject of each step will not be repeated below.

[0057] It should be noted that the data collection examples below are illustrated by taking the scenario where data collection is required when an application or project is launched as an example. Those skilled in the art, based on their understanding of the following, can apply the data collection method provided in the embodiments of the present application to the processing of other scenarios including those that require data collection.

[0058] See also Figure 3 , Figure 3 is a schematic diagram of the implementation flow of the data collection method provided in the embodiment of the present application, which will be combined with Figure 3 The steps shown are explained.

[0059] In step 101, in response to a data collection task, a data item collection table is established, and the data items to be collected in the data collection task are written into the data item collection table.

[0060] Here, the data item collection table stores data items that need to be collected, such as order data, amount data, user data and other types of data. The data items to be collected are the data items that need to be collected, and these data items are obtained and written into the data item collection table. Among them, each data item in the data item collection table has a unique data item identifier, and the data item identifier can be the identification information corresponding to the data item automatically generated when the data item to be collected is obtained, or after the data item to be collected is obtained, the relevant identification information is manually set according to the data type and other information of the data item.

[0061] In step 102, configuration information for the data collection task is obtained, and the configuration information includes data collection timing information and data storage location.

[0062] Here, the data collection timing information is used to perform data collection at a fixed time, and the data storage location includes the storage location information of the target data. Exemplarily, the data collection timing information can be set according to the actual application scenario, such as the data collection timing information is set to perform data collection once every 1 second, or once every 10 seconds, or once every 3 seconds, etc.

[0063] In some embodiments, the configuration information also includes: system parameter information of the target client, storage location information of the shard table, storage location information of the data item collection table, shard table update timing information, visualization output configuration information of the target data, and output type information.

[0064] Here, the system parameter information of the target client is used to configure the target client so that the target client is adapted to the data collection method provided in the embodiment of the present application. The sharding table update timing information is used to start the sharding table update at a fixed time, which can be set according to the actual application scenario and requirements, such as starting the sharding table update every 1 second, or every 10 seconds, every 3 seconds, etc. The visual output configuration information and output type information of the target data are used to configure the output location and output data type of the target data, such as outputting amount type data by email, outputting user type data through an instant messaging client, etc.

[0065] In step 103, when the data collection opportunity is reached, the target client in the active state is determined according to the sharding table, and the data items to be collected in the data item collection table are distributed to the target client.

[0066] Here, the shard table is a table that stores database shard information, which is used to manage and track the distribution of shards in the database. It is also used to store client information that sends heartbeat data to the server, so as to determine active clients based on the shard table. Each shard record usually contains the following information: Shard identification (ID): Each shard record has a unique ID in the shard table, which is used to identify different shard records. Shard node Internet Protocol (IP) address (corresponding to the client identification): The IP address of the node where each shard record is located, used to locate and connect to the corresponding shard node. Creation time and update time: records the creation time and the last update time of the shard record, which is used to manage the life cycle and changes of the shard record. Shard key: A field used for data sharding. According to the value of the shard key, the data is divided into different shard records.

[0067] Exemplarily, data collection timing information can be set in the data timing initialization executor, and when the data collection timing is determined to be reached by the data timing initialization executor, step 103 is executed. For example, if the data collection timing information set in the data timing initialization executor is to perform data collection once every 1 second, then after the data collection method starts, it can be determined that the data collection timing is reached every 1 second, and data collection can be started.

[0068] In some embodiments, the above step 103 may be implemented by the following steps:

[0069] The first step is to determine the update time in the shard record corresponding to the client ID for each client ID in the shard table.

[0070] Here, each client has a unique client identifier, which may be the IP address of the client or other identifiers for identifying the client. The update time in the shard record is the time when the terminal corresponding to the client identifier last uploaded heartbeat data to the server.

[0071] In some embodiments, before determining the update time in the shard record corresponding to the client identifier, it is first necessary to search the shard record corresponding to the client identifier in the shard table according to the client identifier. When implementing, the client identifier can be converted into a hash value first; illustratively, taking the client identifier as the client's IP address as an example, a hash function is used to convert the client IP address into a hash value in a fixed range. This hash value is usually an integer, and then the total number of shard records in the shard table is determined, and the hash value and the total number of shard records in the shard table are modulo operations to obtain the shard identifier corresponding to the client identifier. After determining the shard identifier corresponding to the client identifier, the shard record corresponding to the client identifier information can be found from the shard table according to the shard identifier.

[0072] In an embodiment of the present application, the corresponding shard record is searched in the shard table by the client identifier to determine the update time in the shard record corresponding to the client identifier. By converting the client identifier into a hash value, performing a modulo operation on the hash value and the total number of shard records in the shard table to obtain the shard identifier corresponding to the client identifier, and then searching the shard record corresponding to the client in the shard table by the shard identifier, the uniqueness of the shard identifier can be guaranteed, and the efficiency of searching the shard record corresponding to the client identifier in the shard table can be improved.

[0073] In the second step, the time difference between the current time and the update time is determined, and the client corresponding to the client identifier whose time difference is less than a preset time threshold is determined as the target client.

[0074] Here, the current time is the current time information of the system. The update time corresponding to each client ID is subtracted from the current time to obtain the time difference corresponding to each client ID. The time threshold can be set according to the scene requirements. If the time difference is less than the preset time threshold, it means that the corresponding client has reported heartbeat data within the preset time range. This client is in an active state, and the active client is determined as the target client.

[0075] The fourth step is to distribute the data items to be collected in the data item collection table to the target client according to the shard identifier of the target client.

[0076] Here, each client has a unique sharding identifier, which can be determined based on the client's identification information. For example, based on the hash-based IP sharding rule, the client's IP address is converted into a hash value, and the hash value is modulo-calculated to obtain the corresponding sharding identifier. The sharding identifier of each target client is obtained in the sharding table, and the data items that the target client needs to collect are determined based on the sharding identifier of the target client, so that the data items to be collected are allocated to the target client.

[0077] In some embodiments, the data items to be collected may be allocated to the target client according to the shard identifier of the target client through the following steps, specifically including:

[0078] The first step is to determine the total number of shard records based on the shard ID of the target client.

[0079] Here, the total number of shard records is the total number of shard records of the target client. According to the shard identifier of the target client, the total number of shard records including all target clients can be counted. The total number of shard records is used to represent the total number of currently active target clients. Exemplarily, the total number of shard records can be 2.

[0080] In some embodiments, after deleting the shard record corresponding to the to-be-deleted client identifier in the shard table to obtain an updated shard table, the total number of shard records can be determined based on the number of all shard records in the updated shard table.

[0081] The second step is to obtain the data item identifier of each data item in the data item collection table.

[0082] Here, there is a one-to-one correspondence between the data item identifier and the data item, and the data item identifier is used to identify each data item.

[0083] The third step is to perform a modulo operation on the data item identifier of each data item and the total number of shard records to obtain the operation result of each data item.

[0084] Exemplarily, the data item identifiers include 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10, which means that data collection needs to be performed on 10 data items. The total number of shard records in the updated shard table is 2, which means that there are currently 2 active target clients. The modulo operation results of each data item are 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, respectively.

[0085] The fourth step is to distribute the target data item whose operation result is the same as the shard identifier of the target client to the target client.

[0086] Exemplarily, if the shard identifiers of the target client are 0 and 1, then the target data items of the target client with shard identifier 0 include data items with data item identifiers 2, 4, 6, 8, and 10; similarly, the target data items of the target client with shard identifier 1 include data items with data item identifiers 1, 3, 5, 7, and 9. In this way, even distribution of the target data items corresponding to the target clients is achieved.

[0087] In some embodiments, the shard records of inactive clients in the shard table may be deleted by the following steps to obtain an updated shard table, specifically including:

[0088] In the first step, the client identifiers whose time differences are not less than a preset time threshold are determined as the client identifiers to be deleted.

[0089] Here, if the time difference is greater than or equal to the time threshold, it means that the clients corresponding to these client identifiers have not reported heartbeat data within the preset time range, indicating that these clients are inactive clients and may not be able to perform data collection tasks. These client identifiers are determined as client identifiers to be deleted.

[0090] The second step is to delete the shard record corresponding to the client ID to be deleted from the shard table to obtain an updated shard table.

[0091] Here, the shard record corresponding to the to-be-deleted client identifier in the shard table is deleted to obtain the updated shard. Therefore, the updated shard table only contains the shard record corresponding to the active target client.

[0092] In an embodiment of the present application, by deleting the shard records corresponding to the client identifiers whose time difference is greater than or equal to the time threshold, the shard records of inactive clients can be deleted, thereby updating the shard table to save storage space in the shard table.

[0093] Optionally, after updating the shard table, the shard table now stores active clients. The shard ID of the target client can be determined based on the updated shard table, and the data items to be collected can be allocated to the target client, avoiding the allocation of collection tasks to inactive clients, which makes it impossible for the inactive clients to collect data, resulting in failure to collect target data.

[0094] In the embodiment of the present application, when the data collection opportunity is reached, according to the update time corresponding to each client identifier in the shard table, the active client that reports the heartbeat data within the preset time range is screened as the target client, and then the target data item corresponding to the target client is determined by the shard identifier of the target client. In this way, the client that can perform the data collection task can be quickly queried, and the target data that needs to be collected for each target client can be determined. Data collection is performed through multiple clients, thereby improving data collection efficiency.

[0095] In step 104, the target data collected by the target client according to the data items to be collected is received, and the target data is stored in a data storage location.

[0096] Here, after receiving the target data collected by the target client according to the data items to be collected, the target data is stored in the data storage location according to the data storage location in the configuration information, so as to facilitate the subsequent output of the target data.

[0097] In an embodiment of the present application, when a start instruction of a data collection task is received, a sharding table and a data item collection table are established, the data items to be collected are written into the data item collection table, and the data in the data collection method are configured according to the requirements. When the data collection opportunity is reached, the target client in an active state is determined according to the sharding table, and the target data is collected and stored through the target client for further monitoring of the target data. In this way, whenever there is a new data collection task, the data collection method can be slightly configured according to the task requirements, so that the data collection method of the embodiment of the present application can be adapted to a variety of tasks for data collection, thereby realizing a universal data collection method and improving the efficiency of data collection.

[0098] In some embodiments, after the above step 102, that is, after obtaining the configuration information for the data collection task, the following steps may be performed: Figure 4 Steps 201 and 202 shown in the figure update the update time in the shard table. Figure 4 Provide explanation.

[0099] In step 201, when it is determined that the time to update the shard table has been reached, the heartbeat data reported by the client is obtained, where the heartbeat data includes a client identifier and a reporting time.

[0100] Here, the heartbeat data is a heartbeat signal reported by the client, which is used to indicate that the client is in an active state. There is a one-to-one correspondence between the client identifier and the client, and each client has a unique identifier, such as the IP address of the client. The reporting time corresponds to the time when the client reports the heartbeat data. Among them, the shard table update timing information can be set in the data timing initialization executor, and the data timing initialization executor executes step 201 when it is determined that the data collection timing has been reached.

[0101] In step 202, when there is a shard record corresponding to the client identifier in the shard table, the reporting time is determined as the update time in the shard record.

[0102] In some of these embodiments, when there is a shard record corresponding to the client identifier in the shard table, it means that the client has previously reported heartbeat data, so it is only necessary to update the last update time in the shard record corresponding to the client identifier to the current reporting time.

[0103] Wherein, when there is no shard record corresponding to the client identifier in the shard table, the following steps are also included:

[0104] The first step is to add a shard record corresponding to the client identifier to the shard table if there is no shard record corresponding to the client identifier in the shard table.

[0105] Here, when there is no shard record corresponding to the client identifier in the shard table, it means that the client has not reported heartbeat data, or has reported heartbeat data before but the shard record has been deleted, so it is necessary to add a new shard record corresponding to the client identifier.

[0106] The second step is to determine the hash value corresponding to the client ID and obtain the total number of shard records in the shard table.

[0107] Here, the client identifier is converted into a hash value. Taking the client identifier as an IP address as an example, a hash function is used to convert the client's IP address into a hash value in a fixed range, and the total number of all shard records in the shard table is obtained at the same time.

[0108] The third step is to determine the shard ID corresponding to the shard record based on the hash value and the total number of shard records, and add the shard ID to the shard table.

[0109] Exemplarily, the client's IP address is converted into a corresponding hash value, and the total number of shard records that already exist in the shard table is determined. By performing a modulo operation on the client's hash value and the total number of shard records, the index data corresponding to the client can be obtained. The index data is the shard identifier corresponding to the current client. The shard identifier is added to the shard table for searching for the shard record corresponding to the client identifier.

[0110] In an embodiment of the present application, when it is determined that the time for updating the shard table has been reached, the heartbeat data reported by the client is obtained, and the update time in the shard table is updated according to the heartbeat data reported by the client. If there is a shard record corresponding to the client identifier in the shard table, the latest time in the shard record is updated, and if it does not exist, a shard record corresponding to the client identifier is created. In this way, it can be ensured that the client that has reported the heartbeat data has a corresponding shard record in the shard table, and the time information in the shard record is updated in real time, so that the target client in the active state can be accurately determined.

[0111] In some embodiments, before the above step 104, that is, before receiving the target data collected by the target client according to the target data item, the following steps may be performed: Figure 5 Steps 301 to 304 shown in the figure send data collection instructions. Figure 5 Provide explanation.

[0112] In step 301, the historical data item identifier included in the task list of the target client is obtained.

[0113] Here, the task list includes existing historical data item identifiers that need to be collected when the target client previously performs a data collection task.

[0114] In step 302, when there is a historical data item identifier that is the same as the data item identifier of the target data item, the data item corresponding to the historical data item identifier is updated to the target data item, where the target data item is the data item allocated to the target client.

[0115] Here, each data item in the target data item also has a corresponding unique data item identifier. For each data item in the target data item, if there is a historical data item identifier that is the same as the data item identifier of the target data item in the task list, it means that this target data item already exists in the task list, and the data item corresponding to this historical data item identifier in the task list is updated to the target data item.

[0116] Exemplarily, the target data item includes data items with data item identifiers 1 and 4, and the data in the data item with data item identifier 1 is order data. For the data item with data item identifier 1, a search is performed in the task list to determine whether there is a data item with a historical data item identifier 1. If so, the data item with a historical data item identifier 1 in the task list is replaced with the data item with a data item identifier 1 in the target data item. This is because, due to the update of the data item, there is a situation where the data contained in the data item with a historical data item identifier 1 in the task list is different from the data contained in the data item with a data item identifier 1 in the target data item. For example, the data contained in the data item with a historical data item identifier 1 in the task list is user data, while the data in the data item with a data item identifier 1 in the target data item is order data, so the data item with a historical data item identifier 1 in the task list needs to be updated. Then, the above steps are repeated for the data item with a data item identifier 4 in the target data item.

[0117] In step 303 , if there is no historical data item identifier that is identical to the data item identifier of the target data item, the data item identifier of the target data item and the target data item are added to the task list.

[0118] Here, if there is no historical data item identifier identical to the data item identifier of the target data item in the task list, the target data item and the data item identifier of the target data item need to be added to the task list.

[0119] In step 304, a data collection instruction is sent to the target client, informing the target client to collect target data according to the task list.

[0120] Here, a data collection instruction may be sent to the target client based on the task list of the data collection task. After receiving the data collection instruction, the target client collects target data according to the target data item and sends the collected target data for the target data item to the server.

[0121] In the embodiment of the present application, in the embodiment of the present application, through the historical data item identifier and the data item identifier of the target data item in the task list, it is judged whether there is a task for the target data item in the task list, so as to update the task list corresponding to the target client. The data collection instruction is sent to the target client through the task list, and the target client is notified to collect the target data according to the target data item. In this way, it can be ensured that each target client collects the corresponding target data according to the corresponding target data item, thereby improving the efficiency of data collection.

[0122] In some embodiments, after step 104, Figure 6 As shown, the target data visualization output can be realized through steps 401 and 402. Figure 6 Provide explanation.

[0123] In step 401 , in response to a received output instruction for target data, target data is acquired from a data storage location.

[0124] Here, when an output instruction for target data is received, the target data is acquired from the data storage location.

[0125] In step 402, the target data is visualized and output based on the visualization output configuration information in the configuration information.

[0126] Exemplarily, the visualization output configuration information in the configuration information includes: visualization output of data collection results by email output, visualization output of data collection results by instant messaging tool output. Specifically, visualization output of data collection results by email output includes: configuration of information such as sender information of the email, recipient's email address, email sending time, text description in the email, format of target data, etc.; visualization output of data collection results by instant messaging tool output includes: configuration of information such as recipient information, sending time, sending format, related text description, etc. The target data is visualized and output according to the visualization output configuration information to further monitor the target data.

[0127] In the embodiment of the present application, in response to the received output instruction for the target data, the target data is obtained from the data storage location, and the target data is visually output based on the visual output configuration information in the configuration information. In this way, the output mode and output location of the target data can be set according to actual needs, which facilitates the monitoring of the data and improves the adaptability and flexibility of data collection and monitoring.

[0128] Through the method provided by the embodiment of the present application, the following effects are achieved: when the start instruction of the data collection task is received, a sharding table and a data item collection table are established, the data items to be collected are written into the data item collection table, and the data in the data collection method are configured according to the requirements. When the data collection opportunity is reached, the target client in the active state is determined according to the sharding table, and the target data is collected and stored through the target client for monitoring the target data. In this way, whenever there is a new data collection task, the data collection method provided by the embodiment of the present application can be slightly configured according to the task requirements, so that the data collection method of the embodiment of the present application can quickly execute the data collection task and improve the efficiency of data collection.

[0129] The following will describe an exemplary application of the embodiment of the present application in an actual application scenario, taking the scenario where data collection is required when the application is launched as an example. Figure 7 , Figure 7 The data collection and visualization output implementation flow diagram provided in the embodiment of the present application specifically includes the following steps 701 to 709. Figure 7 Provide explanation.

[0130] In step 701, information is initialized and configured.

[0131] Here, you can initialize the global configuration information such as the client's system parameter information, the storage location information of the shard table, the storage location information of the data item collection table, the shard table update timing information, the visualization output configuration information and the output type information.

[0132] In step 702, the data items to be collected are written into the data item collection table.

[0133] Here, the data items to be collected are the data items that need to be collected corresponding to this data collection task.

[0134] In step 703, the data initialization timing executor is started.

[0135] Here, the data initialization timer executor is used to periodically execute the task of obtaining the heartbeat data reported by the client. For example, the data initialization timer executor is set to obtain the heartbeat data reported during this period once every 1 second, or execute once every 10 seconds, once every 3 seconds, etc. Among them, the client reports the heartbeat data 7031, which is used to indicate that the client is active.

[0136] In step 704, the data collection timing executor is started.

[0137] Here, data collection is performed regularly by starting the data collection timing executor. The data collection timing executor is used to perform data collection tasks regularly. For example, the data collection timing executor is set to perform the data collection task once every 1 second, or once every 5 seconds, once every 10 seconds, etc.

[0138] In step 705, the data items to be collected and allocated to the target client are obtained from the data item collection table.

[0139] Here, the target client is a client in an active state, and the data item to be collected corresponding to the target client (corresponding to the above-mentioned target data item) is obtained from the data item collection table through the data collection timing executor.

[0140] In step 706, the target client performs data collection.

[0141] Here, the target client starts to collect data according to the data items to be collected allocated to itself, and reports the collected data to the server.

[0142] In step 707, the collected target data is obtained.

[0143] Here, the server obtains the target data collected by the target client.

[0144] In step 708, the output is visualized.

[0145] Here, the collected data can be visualized and output through emails and instant messaging clients for further data analysis.

[0146] Based on the above embodiments, the present application further provides a data collection method, see Figure 8 , Figure 8 This is another implementation flow diagram of the data collection method provided in the embodiment of the present application, which specifically includes the following steps 801 to 809, which are described in detail below.

[0147] In step 801, access the data acquisition development kit.

[0148] Here, the data acquisition development kit is a data acquisition software development kit (SDK). The SDK can be downloaded from the Internet and includes interface files, library files, help documents, development examples and practical tools, which can help developers integrate third-party software or services.

[0149] In step 802, a new sharding table and a data item collection table are created.

[0150] Here, when starting the data collection method provided by the embodiment of the present application, a sharding table and a data item collection table can be first established. Among them, the sharding table is a table that stores the database sharding information, which is used to manage and track the distribution of shards in the database, and is also used to store the client information that sends heartbeat data to the server, so as to determine the active client based on the sharding table. The data item collection table stores the data items that need to be collected, such as order data, amount data, user data and other types of data, which are used to determine the data items that need to be collected.

[0151] In step 803, the data items to be collected are written into the data item collection table.

[0152] Here, the data items to be collected are determined through data collection structured query language (SQL) and written into the data item collection table.

[0153] In some embodiments, a data collection task may be started first, and in response to the data collection task, a new shard table and a data item collection table may be automatically created through a data collection development kit, and initial configuration may be performed to determine the data items that need to be collected.

[0154] In step 804, the global configuration is initialized.

[0155] Here, the global configuration may include: client system parameter information, storage location information of the shard table, storage location information of the data item collection table, shard table update timing information, visualization output configuration information, output type information, etc.

[0156] In some embodiments, step 804 can be implemented through the following steps 8041 to 8043, which are described in detail below.

[0157] In step 8041, the database configuration information is initialized.

[0158] Here, by initializing the configuration information, the data collection timing information, the data storage location, the system parameter information of the target client, etc. are configured.

[0159] In step 8042, the data item collection table is initialized.

[0160] Here, the storage location information of the data item collection table is configured by initializing the data item collection table.

[0161] In step 8043, the data visualization monitoring processor is initialized.

[0162] Here, by initializing the data visualization monitoring processor, the visualization output configuration information and output type information of the target data are configured.

[0163] In step 805, a data initialization timing executor is started.

[0164] Here, the heartbeat data reported by the client is obtained by starting the data initialization timer executor.

[0165] In step 806, the local Internet Protocol address is obtained.

[0166] Here, the Internet Protocol (IP) address (corresponding to the client ID) of the local machine (corresponding to the client ID) is obtained. The local machine will report the time while reporting the IP address.

[0167] In step 807, the fragmentation record is obtained according to the local Internet Protocol address.

[0168] Here, based on the hash-based IP fragmentation rule, the IP address is converted into a hash value, and the hash value is modulo-calculated to obtain the fragmentation identifier corresponding to the local machine. The fragmentation identifier is used to connect to the corresponding fragmentation record to obtain the fragmentation record.

[0169] In step 808, it is determined whether the fragment record exists.

[0170] Here, the shard table is searched for a shard record with the same shard ID as the local machine. If a shard record with the same shard ID as the local machine is found, it indicates that the local machine's shard record exists in the shard table; otherwise, it indicates that the local machine's shard record does not exist in the shard table. If the shard record exists, the judgment result is yes, and step 809 is executed. Otherwise, the local machine's shard record needs to be added to the shard table for subsequent distributed shard query.

[0171] In step 809, the slice is updated to record the latest time.

[0172] Here, the latest time in the shard record is updated to the reporting time, so that the program thinks that the shard record is active, which means that the local machine is in an active state. In this way, by reporting the local machine's IP address, it is proved that the local machine is still active, indicating that the local machine can perform the data collection task.

[0173] In step 810, a data collection timing executor is started.

[0174] Here, the data collection timer executor is used to query whether the shard records are active and perform data collection at a fixed time.

[0175] When a task is added or updated in the data collection tasks stored in the data collection timing executor, steps 811 to 817 are executed, as follows:

[0176] In step 811, the shard record is queried.

[0177] Here, all shard records in the shard table are queried, and all shard records are checked to see whether the client corresponding to the shard record is still active.

[0178] In step 812, the invalid shard records are deleted.

[0179] Here, if a client does not send heartbeat data for a long time, it is considered that the client is no longer active, and the shard records of the inactive client are removed.

[0180] In step 813, the number of local shards and the total number of shards are calculated.

[0181] Here, the number of local shards corresponds to the above shard identifier, and the total number of shards corresponds to the total number of shard records.

[0182] In step 814, the target data item is queried according to the number of local shards.

[0183] Here, the target data item is queried in the data item collection table according to the number of local shards.

[0184] Exemplarily, the pseudo code for searching is: SELECT * FROM data item collection table WHERE mod (id, total number of shards) = number of local shards. Where id represents the data item ID of each data item in the data item collection table, a modulo operation is performed on each data item ID and the total number of shards, and the data item with the same operation result as the number of local shards is determined as the target data item.

[0185] The above steps 811 to 814 are executed in a loop.

[0186] In step 815, it is determined whether the target data item identifier already exists in the data collection list corresponding to the target client.

[0187] Here, according to the target data item table that the target client needs to execute, the target data item table is queried cyclically to determine whether the target data item representation already exists in the data collection list in the data collection timing executor. The data collection list in the data collection timing executor stores the historical data item identifiers when the target client previously executed the data collection task; if the target data item identifier already exists in the data collection list corresponding to the target client, the judgment result is yes, and step 817 is executed; otherwise, the judgment result is no, and step 816 is executed.

[0188] In step 816, the target data item is added to the data collection list.

[0189] Here, if the target data item identifier does not exist in the data collection list corresponding to the target client, the target data item identifier and the target data item are added to the data collection list.

[0190] In step 817, the historical data item corresponding to the target data item identifier in the data collection list is replaced.

[0191] Here, if there is a target data item identifier in the data collection list, the historical data item in the data collection list with the same target data item identifier is replaced with the target data item. Replacement means updating, and the target data item corresponding to the existing target data item identifier is updated. This is because, due to operations such as modification, addition, and deletion of data items, the data item with the data item identifier of 1 in the data collection list and the data item with the target data identifier of 1 in the target data item may be different. For example, the data item with the data item identifier of 1 in the data collection list is return order data, and the target data item with the target data item identifier of 1 determined this time is order data, so the data item with the target data item identifier of 1 in the data collection list needs to be updated.

[0192] The above steps 815 to 817 are executed in a loop until each data item in the target data item is traversed, and then steps 818 to 820 are executed.

[0193] In step 818, data collection is performed periodically.

[0194] Here, the data collection timing executor automatically consults the data collection task and executes data collection on a regular basis.

[0195] In step 819, the data collection result is obtained.

[0196] Here, the data collection result corresponds to the above-mentioned target data.

[0197] In step 820, the data is visualized and output.

[0198] Here, the target data is visualized and output through email, instant messaging tools, etc.

[0199] The above steps 818 to 820 are executed cyclically until the data collection task is completed.

[0200] In the embodiment of the present application, a unified data collection method is provided, and the steps that need to be repeated are encapsulated. When a new application is released, if data collection is to be performed, the developer does not need to develop timed tasks, data collection, and visual monitoring tools. It only needs to access the method of the embodiment of the present application, and then do a little configuration to achieve the purpose of data collection. Because the embodiment of the present application encapsulates the intermediate links into a unified framework, the developer does not need to pay attention to the specific implementation details, only needs to perform simple configuration, and there is basically no code cost, which can quickly achieve the purpose of data collection and monitoring, save manpower, material resources, time and other resources, and improve the efficiency of data collection.

[0201] The following is a description of an exemplary structure of the data acquisition device 233 provided in the embodiment of the present application implemented as a software module. In some embodiments, Figure 2 As shown, the software modules stored in the data acquisition device 233 of the memory 230 may include:

[0202] The establishing module 2331 is used to establish a data item acquisition table in response to a data acquisition task, and write the data items to be collected in the data acquisition task into the data item acquisition table.

[0203] The acquisition module 2332 is used to acquire configuration information for the data collection task, wherein the configuration information includes data collection timing information and data storage location.

[0204] The determination module 2333 is used to determine the target client in the active state according to the shard table when the data collection opportunity is reached, and distribute the data items to be collected in the data item collection table to the target client.

[0205] The storage module 2334 is used to receive the target data collected by the target client according to the data items to be collected, and store the target data in the data storage location.

[0206] In some embodiments, the determination module 2333 is also used to determine, for each client identifier in the shard table, an update time in the shard record corresponding to the client identifier; determine the time difference between the current time and the update time, and determine the client corresponding to the client identifier whose time difference is less than a preset time threshold as the target client; and allocate the data items to be collected to the target client according to the shard identifier of the target client.

[0207] In some embodiments, the determination module 2333 is further used to determine the client identifier whose time difference is not less than the preset time threshold as the client identifier to be deleted; delete the shard record corresponding to the client identifier to be deleted from the shard table to obtain an updated shard table.

[0208] In some embodiments, the determination module 2333 is also used to determine the total number of shard records based on the shard identifier of the target client; obtain the data item identifier of each data item in the data item collection table; perform a modulo operation on the data item identifier of each data item and the total number of shard records to obtain the operation result of each data item; and allocate the target data item whose operation result is the same as the shard identifier of the target client to the target client.

[0209] In some embodiments, the determination module 2333 is also used to obtain heartbeat data reported by the client when it is determined that the time to update the shard table has been reached, and the heartbeat data includes a client identifier and a reporting time; when there is a shard record corresponding to the client identifier in the shard table, the reporting time is determined as the update time in the shard record.

[0210] In some embodiments, the determination module 2333 is also used to, if a shard record corresponding to the client identifier does not exist in the shard table, add a shard record corresponding to the client identifier to the shard table; determine the hash value corresponding to the client identifier and obtain the total number of shard records in the shard table; based on the hash value and the total number of shard records, determine the shard identifier corresponding to the shard record, and add the shard identifier to the shard table.

[0211] In some embodiments, the acquisition module 2332 is also used to obtain the historical data item identifier included in the task list of the target client; in the case where there is a historical data item identifier that is identical to the data item identifier of the target data item, the data item corresponding to the historical data item identifier is updated to the target data item, and the target data item is the data item allocated to the target client; in the case where there is no historical data item identifier that is identical to the data item identifier of the target data item, the data item identifier of the target data item and the target data item are added to the task list; and a data collection instruction is sent to the target client to notify the target client to collect the target data according to the task list.

[0212] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the data collection method described above in the embodiment of the present application.

[0213] The present application embodiment provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will be caused to execute the data collection method provided by the present application embodiment, for example, Figure 3 The data collection method is shown.

[0214] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.

[0215] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0216] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0217] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.

[0218] In summary, the embodiments of the present application provide a unified data collection method, which encapsulates the steps that need to be repeated. When data collection is required, developers do not need to develop timed tasks, data collection, and visual monitoring tools. They only need to access the methods of the embodiments of the present application and make a few configurations to achieve the purpose of data monitoring. The purpose of data collection can be quickly achieved, human, material, and time resources can be saved, and the efficiency of data collection can be improved.

[0219] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A data collection method, characterized in that: The method comprises: In response to the data collection task, a data item collection table is established, and the data items to be collected in the data collection task are written into the data item collection table; Acquire configuration information for the data collection task, the configuration information including data collection timing information and data storage location; When the data collection opportunity is reached, the target client in the active state is determined according to the sharding table, and the data items to be collected in the data item collection table are allocated to the target client; Receive the target data collected by the target client according to the data item to be collected, and store the target data in the data storage location.

2. The method according to claim 1, characterized in that The sharding table includes a plurality of client identifiers and their corresponding sharding records; determining the target client in an active state according to the sharding table and allocating the data items to be collected in the data item collection table to the target client includes: For each client identifier in the shard table, determining an update time in the shard record corresponding to the client identifier; Determine a time difference between the current time and the update time, and determine a client corresponding to a client identifier whose time difference is less than a preset time threshold as the target client; The data items to be collected are distributed to the target client according to the slice identifier of the target client.

3. The method according to claim 2, characterized in that The method further comprises: Determine the client identifier whose time difference is not less than the preset time threshold as the client identifier to be deleted; The shard record corresponding to the to-be-deleted client identifier is deleted from the shard table to obtain an updated shard table.

4. The method according to claim 2, characterized in that: The allocating the data items to be collected to the target client according to the shard identifier of the target client includes: Determine the total number of shard records according to the shard identifier of the target client; Obtaining a data item identifier for each data item in the data item collection table; Performing a modulo operation on the data item identifier of each data item and the total number of shard records to obtain an operation result for each data item; The target data item having the same operation result as the slice identifier of the target client is distributed to the target client.

5. The method according to claim 1, characterized in that After obtaining the configuration information for the data collection task, the method further includes: When it is determined that the shard table update time has arrived, obtain the heartbeat data reported by the client, where the heartbeat data includes the client identifier and the reporting time; In the case that a shard record corresponding to the client identifier exists in the shard table, the reporting time is determined as the update time in the shard record.

6. The method according to claim 5, characterized in that The method further comprises: If there is no shard record corresponding to the client identifier in the shard table, add a shard record corresponding to the client identifier in the shard table; Determine the hash value corresponding to the client identifier, and obtain the total number of shard records in the shard table; Based on the hash value and the total number of shard records, determine the shard identifier corresponding to the shard record, and add the shard identifier to the shard table.

7. The method according to claim 1, characterized in that Before receiving the target data collected by the target client according to the data items to be collected, the method further includes: Acquire the historical data item identifier included in the task list of the target client; If there is a historical data item identifier that is identical to the data item identifier of the target data item, updating the data item corresponding to the historical data item identifier to the target data item, the target data item being the data item allocated to the target client; In the case where there is no historical data item identifier identical to the data item identifier of the target data item, adding the data item identifier of the target data item and the target data item to the task list; A data collection instruction is sent to the target client to notify the target client to collect the target data according to the task list.

8. A data acquisition device, characterized in that: The device comprises: An establishing module, used for establishing a data item acquisition table in response to a data acquisition task, and writing the data items to be collected in the data acquisition task into the data item acquisition table; An acquisition module, used to acquire configuration information for the data acquisition task, wherein the configuration information includes data acquisition timing information and data storage location; A determination module, configured to determine, when a data collection opportunity is reached, a target client in an active state according to the sharding table, and allocate the data items to be collected in the data item collection table to the target client; The storage module is used to receive the target data collected by the target client according to the data items to be collected, and store the target data in the data storage location.

9. An electronic device, characterized in that: The electronic device comprises: A memory for storing computer executable instructions; The processor is used to implement the data collection method described in any one of claims 1 to 7 when executing the computer executable instructions stored in the memory.

10. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the data collection method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Task processing method and device, computer equipment and storage medium

    CN119603364A