Heterogeneous data acquisition methods, systems, equipment, and media based on AFC devices
By sending heterogeneous data acquisition commands to AFC devices, calculating and selecting the shortest acquisition method, and transmitting data in groups, the problem of low data acquisition communication efficiency of AFC devices is solved, achieving efficient and accurate data acquisition and supporting system health management and fault diagnosis.
Patent Information
- Application Number
- CN202410927944.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies have failed to effectively improve the communication efficiency of AFC device data acquisition, resulting in complex and inefficient data acquisition, which affects system health management and fault diagnosis.
By sending heterogeneous data acquisition commands to AFC devices, the target data type and acquisition period are determined, multiple acquisition methods are calculated and the shortest acquisition time is selected, data is transmitted in groups to optimize communication connections, and new storage space is created to process the remaining data, thus achieving efficient data acquisition.
It improves the communication efficiency of AFC device data acquisition, ensures data accuracy and real-time performance, and supports system health management and fault diagnosis.
Smart Images

Figure CN123115012A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission technology, and more specifically to a heterogeneous data acquisition method, system, device, and medium based on AFC devices. Background Technology
[0002] In subway operations, the AFC (Automatic Fare Collection) system plays a crucial role. However, the sheer variety and sheer number of AFC devices significantly increases the complexity of data collection. Not only are the data types diverse, including basic equipment information, operational status, business data, and system logs, but the sheer volume of data is also enormous. This diversity and sheer volume of data place extremely high demands on the AFC system's data collection efforts, requiring the use of efficient data acquisition technologies and methods to ensure data accuracy and real-time performance, thereby supporting key functions such as AFC system health management, fault diagnosis, and condition-based maintenance.
[0003] The existing patent document with publication number CN105556489A provides a data processing method and apparatus. The data processing method includes: when it is necessary to store a target data unit, obtaining the number of first data and the number of second data in the target data unit, wherein the type of the first data is a first type and the type of the second data is a second type; if the number of first data is greater than the number of second data, obtaining the first target position of the second data in the target data unit, and writing the first type of data into the first target position in the target storage unit pre-filled with second type of data. There is also a patent document with publication number CN103500224A, which provides a data writing method and apparatus, and a data reading method and apparatus. The data writing method includes: dividing the data to be written, which contains multiple first data records, into blocks. The data to be written is data obtained by sorting multiple first data records according to their sequence numbers. The number of blocks is less than the number of first data records in the data to be written. For a target data block in the data block, the target data block is compressed. The maximum and minimum sequence numbers of the first data records in the target data block and the compressed data are written as second data records into the data table of the database server, until all the first data records of the data to be written are written into the data table of the database server.
[0004] However, the two patents mentioned above only consider data storage efficiency, and do not consider the communication efficiency of data acquisition for data that needs to be transmitted over a network. Therefore, this invention provides a heterogeneous data acquisition method, system, device, and medium based on an AFC device. Summary of the Invention
[0005] To better address the aforementioned problems, this invention provides a heterogeneous data acquisition method based on AFC devices to improve communication efficiency in data acquisition. The heterogeneous data originates from multiple AFC devices and is implemented through the following steps:
[0006] Step S1: The acquisition unit sends a heterogeneous data acquisition command to the AFC device. The acquisition command includes the target data to be acquired, the type of the target data, and the acquisition period. The target data consists of multiple first data, and each first data corresponds to one acquisition period.
[0007] Step S2: The AFC device receives the acquisition command, obtains the data type of the target data from the acquisition command, locates the target data in the storage unit based on the data type of the target data, and obtains the storage address corresponding to the target data;
[0008] Step S3: Calculate the maximum acquisition period of the first data. When acquiring the first data at the acquisition time point corresponding to the maximum acquisition period, based on the storage address corresponding to the target data, divide the acquisition method of the first data into multiple types, calculate the acquisition time of each acquisition method, and select the acquisition method with the shortest acquisition time as the target acquisition method. Acquire the first data based on the target acquisition method.
[0009] Step S4: Take multiple first data points with the same acquisition period or different acquisition period corresponding to the second acquisition time point other than the first acquisition time point corresponding to the maximum acquisition period as second data. When the number of second data is greater than or equal to a preset value, divide the acquisition method of the second data into multiple types, and repeatedly execute step S3 to obtain the acquisition method of the second data, and acquire the second data based on the acquisition method of the second data.
[0010] As a preferred embodiment of the present invention, step S3 involves various methods for acquiring the target data, including:
[0011] Calculate the number of storage addresses between every two adjacent pieces of the first data in the target data, and use them as the interval. When multiple intervals are equal to a first threshold, the acquisition method of the target data is defined as the first acquisition method.
[0012] When any one of the multiple interval values is less than or equal to the second threshold and greater than the first threshold, the acquisition method of the target data is defined as the second acquisition method;
[0013] If any one of the interval values is greater than the second threshold, the acquisition method of the target data is defined as the third acquisition method.
[0014] As a preferred embodiment of the present invention, step S3, selecting the acquisition method with the shortest acquisition time as the target acquisition method, includes:
[0015] The time required to transmit the target data to the acquisition unit is defined as the first time, the time for the acquisition unit to establish a communication connection with the AFC device is defined as the second time, and the time for the acquisition unit to interrupt the communication connection with the AFC device is defined as the third time. The acquisition time is the sum of the first time, the second time, and the third time.
[0016] Based on the first time, the second time, and the third time, the acquisition time for acquiring the target data using each acquisition method is calculated, and the acquisition method with the shortest acquisition time is selected as the target acquisition method.
[0017] As a preferred embodiment of the present invention, calculating the acquisition time of the target data for each acquisition method includes:
[0018] The acquisition time for acquiring the target data using the j-th acquisition method is calculated using the following expression:
[0019] T j =T2 + T1 × k + T3
[0020] Where j represents the j-th acquisition method, and its value is a positive integer between 1 and 3, T j The j-th acquisition method is used to collect the target data. T1 represents the first time, T2 represents the second time, T3 represents the third time, k represents the number of data collected by the j-th acquisition method, and the value range is greater than or equal to 1 and less than or equal to N. N represents the total number of data read by the j-th acquisition method.
[0021] As a preferred embodiment of the present invention, calculating the maximum acquisition period of the first data includes:
[0022] The acquisition period of all the first data in the target data is obtained from the acquisition command as an acquisition period data group, and the smallest value among the common period multiples of the acquisition periods in the acquisition period data group is calculated and obtained as the maximum acquisition period.
[0023] As a preferred embodiment of the present invention, the first acquisition method, the second acquisition method, and the third acquisition method respectively refer to:
[0024] The first acquisition method refers to transmitting all the target data at once when the intervals are all equal to the third threshold.
[0025] The second acquisition method refers to dividing the target data into multiple first groups based on the minimum interval greater than the third threshold, transmitting data from one first group at a time, and the storage addresses of the data in each first group are contiguous;
[0026] The third acquisition method refers to dividing the target data into multiple second groups based on the maximum interval greater than the third threshold, transmitting data from one second group at a time, and the storage addresses of the data in each second group are consecutive.
[0027] As a preferred embodiment of the present invention, step S3, which involves collecting the first data based on the target acquisition method, further includes:
[0028] The minimum acquisition period is taken as the acquisition period among the multiple first data acquisition periods. Based on the current network transmission rate, the maximum amount of data transmitted within the minimum acquisition period is calculated.
[0029] When the data volume of multiple first data is greater than or equal to the maximum data volume, a new storage space is created on the same disk, and the data volume greater than or equal to the target data is stored as the remaining data in the new storage space in chronological order. When data is collected in the next collection cycle, the remaining data is read from the new storage space.
[0030] When the amount of data in multiple instances of the first data is less than the maximum amount of data, the first data is collected based on the target acquisition method.
[0031] The present invention also provides a heterogeneous data acquisition system based on AFC devices as described above, wherein the heterogeneous data comes from multiple AFC devices, and the system includes the following modules:
[0032] The acquisition unit is used to send a heterogeneous data acquisition command to the AFC device. The acquisition command includes the target data to be acquired, the type of the target data, and the acquisition period. The target data consists of multiple first data, and each first data corresponds to one acquisition period.
[0033] The AFC unit is used to receive the acquisition command, obtain the data type of the target data from the acquisition command, locate the target data in the storage unit based on the data type of the target data, and obtain the storage address corresponding to the target data.
[0034] The calculation unit is used to calculate the maximum acquisition period of the first data. When acquiring the first data at the acquisition time point corresponding to the maximum acquisition period, based on the storage address corresponding to the target data, the acquisition method of the first data is divided into multiple types, the acquisition time of each acquisition method is calculated, and the acquisition method with the shortest acquisition time is selected as the target acquisition method. The first data is acquired based on the target acquisition method.
[0035] The transmission unit is used to take multiple first data points corresponding to the same acquisition time point or different acquisition time points other than the first acquisition time point corresponding to the maximum acquisition period as second data. When the number of second data points is greater than or equal to a preset value, the acquisition method of the second data is divided into multiple types, and the calculation unit is repeatedly executed to obtain the acquisition method of the second data, and the second data is acquired based on the acquisition method of the second data.
[0036] The present invention also provides a computing device, the device comprising:
[0037] Memory and processor;
[0038] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the heterogeneous data acquisition method based on the AFC device described above is implemented.
[0039] The present invention also provides a medium storing computer-executable instructions, which, when executed by a processor, implement the heterogeneous data acquisition method based on an AFC device described above.
[0040] Compared with the prior art, the beneficial effects of the present invention are at least as follows:
[0041] This invention sends heterogeneous data acquisition commands to AFC devices via an acquisition unit. The acquisition commands include the target data to be acquired, the type of target data, and the acquisition period, ensuring that the acquired data meets actual needs. This enables accurate and efficient acquisition of diverse and large amounts of data from AFC devices. The AFC device receives the acquisition commands and obtains the data type of the target data from them. Based on the data type, it locates the target data in the storage unit and obtains the corresponding storage address, allowing the AFC device to complete the data acquisition task efficiently and accurately. The maximum acquisition period for the first data is calculated. When acquiring the first data at the acquisition time point corresponding to the maximum acquisition period, based on the storage address of the target data, the acquisition methods for the first data are divided into multiple categories. The acquisition time for each acquisition method is calculated, and the acquisition method with the shortest acquisition time is selected as the target acquisition method. The first data is then acquired based on the target acquisition method. This process of obtaining the data acquisition method with the shortest acquisition time improves the communication efficiency of data acquisition. Multiple first data points corresponding to the same or different acquisition time points (excluding the first acquisition time point corresponding to the maximum acquisition period) are used as second data. When the number of second data points is greater than or equal to a preset value, the acquisition methods of the second data are divided into multiple categories, and step S3 is repeatedly executed to obtain the acquisition methods of the second data. Second data is then acquired based on these acquisition methods to improve the communication efficiency of data acquisition. Through the coordination of the above steps, regardless of whether the acquisition period of the target data is the same, this invention can acquire the target data in the shortest acquisition time, thereby improving the communication efficiency of data acquisition. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0043] Figure 1 This is a flowchart illustrating the steps of the heterogeneous data acquisition method based on AFC devices in this invention.
[0044] Figure 2 This is a structural diagram of a heterogeneous data acquisition system based on AFC devices. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0046] It is understood that the terms "first," "second," etc., used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are used only to distinguish one element from another. For example, without departing from the scope of this application, a first script may be referred to as a second script, and similarly, a second script may be referred to as a first script.
[0047] In subway operations, the AFC (Automatic Fare Collection) system plays a crucial role. However, the sheer variety and sheer number of AFC devices significantly increase the complexity of data acquisition. Not only are the data types diverse, including basic equipment information, operational status, business data, and system logs, but the sheer volume of data is also enormous. This diversity and sheer volume of data place extremely high demands on the AFC system's data acquisition efforts, requiring efficient data acquisition technologies and methods to ensure data accuracy and real-time performance, thereby supporting key functions such as AFC system health management, fault diagnosis, and condition-based maintenance. However, existing patent documents only consider data storage efficiency, neglecting the communication efficiency required for data transmission over a network.
[0048] To address the aforementioned technical problems, the present invention proposes the following... Figure 1 The heterogeneous data acquisition method based on AFC devices shown here involves heterogeneous data from multiple AFC devices. The acquisition method is implemented by performing the following steps:
[0049] Step S1: The acquisition unit sends a heterogeneous data acquisition command to the AFC device. The acquisition command includes the target data to be acquired, the type of target data, and the acquisition period. The target data consists of multiple first data, and each first data corresponds to one acquisition period.
[0050] Specifically, to accurately and efficiently collect data from a large number and variety of AFC devices, a clear data collection command is first sent to each AFC device. This command must include the target data to be collected, the type of target data, and the collection cycle for that data, ensuring the collected data meets actual needs. The target data to be collected includes multiple first data points, each with a potentially different collection cycle. When dealing with large amounts of data, the collection cycle allows for control over the data collection frequency based on actual needs, avoiding the data communication pressure caused by frequent collections. This ensures both real-time data collection and improved communication efficiency. In an AFC system scenario, AFC devices include different types of ticket vending machines, ticket gates, etc., each with different data types and collection cycles. For example, a ticket vending machine needs to collect transaction data every second, while a ticket gate needs to collect the number of people passing through every two seconds. In this case, the collection unit sends a corresponding heterogeneous data collection command to each type of AFC device, specifying the target data type (e.g., transaction data, number of people passing through) and the corresponding collection cycle (e.g., 1 second, 2 seconds, etc.), thereby achieving accurate and efficient collection of diverse and large amounts of data from AFC devices.
[0051] Step S2: The AFC device receives the acquisition command and obtains the data type of the target data from the acquisition command. Based on the data type of the target data, it finds the location of the target data in the storage unit and obtains the storage address corresponding to the target data.
[0052] Specifically, because AFC devices store a wide variety of data with diverse structures, it's necessary to first parse the data type from the acquisition command to accurately locate the target data and obtain its storage address. In complex AFC systems, various types of devices and data exist. When an acquisition unit sends an acquisition command to an AFC device, the AFC device first needs to parse the target data type (such as transaction records, passenger information, etc.) in the command. Then, the AFC device searches for the corresponding data location in the storage unit based on the data type. For example, if transaction records are stored in area A of the storage unit and passenger information is stored in area B, the device will quickly locate these areas and obtain the corresponding storage address. Finally, the AFC device acquires the target data based on the storage address and returns it to the acquisition unit, enabling the AFC device to efficiently and accurately complete the data acquisition task.
[0053] Step S3: Calculate the maximum acquisition period of the first data. When acquiring the first data at the acquisition time point corresponding to the maximum acquisition period, based on the storage address corresponding to the target data, divide the acquisition method of the first data into multiple types, calculate the acquisition time of each acquisition method, and select the acquisition method with the shortest acquisition time as the target acquisition method. Acquire the first data based on the target acquisition method.
[0054] Specifically, in the internet environment, the demand for data collection is constantly increasing, involving frequent data collection from a large number of AFC devices. Therefore, communication efficiency during data collection needs to be prioritized. Based on the storage characteristics of the target data and the corresponding data collection cycle, the maximum collection cycle for the first data is calculated. The specific calculation method will be described below. When collecting the first data during the maximum collection cycle, all data in the target data will be acquired. For example, if the collection cycle for data 1 is 5 seconds, the collection cycle for data 2 is 8 seconds, and the collection cycle for data 3 is 10 seconds, then the maximum collection cycle is equal to 40 seconds. This means that all data needs to be collected every 40 seconds. At each 5-second interval, only data 1 is collected; at each 8-second interval, only data 2 is collected; and at each 10-second interval, both data 1 and data 3 are collected. In this invention, the data collection time is calculated as the time it takes for the collection unit to establish a communication connection with the AFC device + the time it takes for the data to be transmitted to the collection unit + the time it takes for the collection unit to disconnect from the AFC device. Therefore, the establishment and disconnection times of the communication connection must be considered for each data collection. Based on the storage address corresponding to the target data, it is known that the storage addresses of the first data in the storage unit are not necessarily contiguous. When the storage addresses of the first data are not contiguous, to reduce the time for establishing and disconnecting communication, all the first data can be collected at once and transmitted to the acquisition unit. However, this may transmit a large amount of unnecessary intermediate data, which will increase the data acquisition time. If only the first data is transmitted, when the storage addresses of the first data are not contiguous, multiple first data acquisitions may be required, and multiple communication connections may be established and disconnected, which will also increase the data acquisition time. Therefore, it is necessary to find the data acquisition method with the shortest acquisition time to improve the communication efficiency of data acquisition. By dividing the acquisition method of the first data into multiple types and calculating the acquisition time of each acquisition method, the data acquisition method with the shortest acquisition time is obtained. The division of acquisition methods and the calculation of acquisition time will be described in detail below.
[0055] Step S4: Take multiple first data points corresponding to the same or different collection periods other than the first collection time point corresponding to the maximum collection period as second data. When the number of second data points is greater than or equal to a preset value, divide the collection method of the second data into multiple types, and repeat step S3 to obtain the collection method of the second data, and collect the second data based on the collection method of the second data.
[0056] Specifically, in the above embodiments, when the maximum acquisition period reaches 40 seconds, all data needs to be acquired once. In other acquisition periods outside the maximum acquisition period, such as acquiring data 1 every 5 seconds, data 2 every 8 seconds, and data 1 and data 3 every 10 seconds, some data acquisition periods have the same acquisition period. For example, data 4 has an acquisition period of 8 seconds, and data 5 has an acquisition period of 10 seconds. Therefore, every 8 seconds, data 2 and data 4 need to be acquired, and possibly more. The preset value can be any integer greater than or equal to 2. A value greater than or equal to the preset value indicates that the acquisition method with the shortest acquisition time needs to be calculated. In this case, the acquisition methods also need to be divided into multiple types. Following the principle described above, it is necessary to find the data acquisition method with the shortest acquisition time for the second data and acquire the second data using this method to improve the communication efficiency of data acquisition. When the number of second data is less than the preset value, it means that only one data needs to be acquired in the current acquisition period. In this case, the data acquisition time is fixed and not within the scope of the improvement of this invention. Within each acquisition cycle, the acquisition unit can establish and disconnect communication connections with the AFC device multiple times to acquire the required data using different acquisition methods.
[0057] The above methods also include cases where the collection period for all target data is the same.
[0058] By coordinating the above steps, regardless of whether the target data collection period is the same, the present invention can collect target data in the shortest collection time, thereby improving the communication efficiency of data collection.
[0059] Furthermore, step S3 above categorizes the methods for collecting target data into several types, including:
[0060] Calculate the number of storage addresses between every two adjacent first data in the target data and use them as the interval. When multiple intervals are equal to the first threshold, the acquisition method of the target data is defined as the first acquisition method.
[0061] If any one of the multiple interval values is less than or equal to the second threshold and greater than the first threshold, the target data acquisition method is defined as the second acquisition method.
[0062] If any one of the multiple interval values is greater than the second threshold, the target data acquisition method is defined as the third acquisition method.
[0063] Specifically, the data acquisition method is determined by the storage location of each piece of first data. For example, data 1 is stored at location A0001, data 2 at location A0002, and so on. When the target data to be acquired in the acquisition command is data 2, data 3, data 7, data 8, and data 20, then when the maximum acquisition cycle occurs, data 2, data 3, data 7, data 8, and data 20 need to be acquired. At this time, there are three acquisition methods for this set of data: First acquisition method: First, a communication connection is established, data 2 is acquired and transmitted to data 20, and the communication connection is closed for the first time, and the data acquisition is complete; Second acquisition method: First, a communication connection is established, data 2 and data 3 are acquired and transmitted, the communication connection is closed for the first time, a communication connection is established again, data 7 and data 8 are acquired and transmitted, the communication connection is closed for the second time, a communication connection is established a third time, data 20 is acquired and transmitted, and the communication connection is closed for the third time, and the data acquisition is complete; Third acquisition method: First, a communication connection is established, data 2 and data 8 are acquired and transmitted, the communication connection is closed for the first time, a communication connection is established a second time, data 20 is acquired and transmitted, and the communication connection is closed for the second time, and the data acquisition is complete. The first threshold can be set to any integer greater than or equal to 0. When all intervals are equal to 0, it indicates that the data to be collected is stored contiguously in the storage space. The second threshold can be calculated based on the actual storage situation of the data to separate non-contiguous data in the storage address for collection. When the interval is greater than the second threshold, it indicates that the storage addresses of the data to be collected are far apart. If the data is not properly separated at this time, a large amount of redundant data may be collected, affecting communication efficiency during transmission. Which collection method consumes the least collection time and achieves the highest communication efficiency needs to be calculated in detail using the following method.
[0064] Furthermore, in step S3 above, the acquisition method with the shortest acquisition time is selected as the target acquisition method, including:
[0065] The time required to transmit the target data to the acquisition unit is defined as the first time, the time to establish a communication connection between the acquisition unit and the AFC device is defined as the second time, and the time to interrupt the communication connection between the acquisition unit and the AFC device is defined as the third time. The acquisition time is the sum of the first time, the second time, and the third time.
[0066] Based on the first, second, and third times, the acquisition time for each acquisition method is calculated, and the acquisition method with the shortest acquisition time is selected as the target acquisition method.
[0067] Specifically, communication efficiency is related to the acquisition time. The shorter the acquisition time, the higher the communication efficiency. Therefore, choosing the acquisition method with the shortest acquisition time can achieve the highest communication efficiency.
[0068] Furthermore, the acquisition time for each acquisition method is calculated, including:
[0069] The acquisition time for acquiring target data using the j-th acquisition method is calculated using the following expression:
[0070] T j =T2 + T1 × k + T3
[0071] Where j represents the j-th acquisition method, and its value is a positive integer between 1 and 3, T j The j-th acquisition method represents the acquisition time for the target data. T1 represents the first time, T2 represents the second time, T3 represents the third time, k represents the number of data collected by the j-th acquisition method, and the value range is greater than or equal to 1 and less than or equal to N. N represents the total number of data read by the j-th acquisition method.
[0072] Specifically, in the above embodiments, assuming the data transmission time for each address is 3 milliseconds (the amount of data stored in consecutive addresses in the storage unit is not significantly different, and can be considered as the amount of data in each storage address being equal), the first time = 3 * the number of data items collected; assuming the time for the collection unit to establish a communication connection with the AFC device, i.e., the second time = 8 milliseconds, and the time for the collection unit to disconnect from the AFC device, i.e., the third time = 2 milliseconds, then in the above embodiments, when the target data to be collected in the collection command is data 2, data 3, data 7, and data 8... When collecting data 20, the acquisition time for the first acquisition method is 8*1+3*19+2*1=67 milliseconds (19 refers to the total of 19 data points from data 2 to data 20). The acquisition time for the second acquisition method is 8*3+3*(2+2+1)+2*3=45 milliseconds. The acquisition time for the third acquisition method is 8*2+3*(7+1)+2*2=44 milliseconds. Therefore, although the third acquisition method will collect redundant data 4, data 5, and data 6, its acquisition time is the shortest. In this case, choosing the third acquisition method results in the highest data acquisition efficiency.
[0073] Further, the maximum acquisition period for the first data is calculated, including:
[0074] The acquisition period of all the first data in the target data is obtained from the acquisition command as the acquisition period data group. The smallest value among the common period multiples of the acquisition periods in the acquisition period data group is calculated and obtained as the maximum acquisition period.
[0075] Specifically, calculating the maximum acquisition period for the first data involves selecting the smallest common period multiple among all the acquisition periods of the first data as the maximum acquisition period. In the above embodiment, for example, if the acquisition period for data 1 is 5 seconds, the acquisition period for data 2 is 8 seconds, and the acquisition period for data 3 is 10 seconds, then the smallest common period multiple is 40 seconds. Therefore, the maximum acquisition period is 40 seconds. This means that at every 40-second interval, data 1, data 2, and data 3 are all acquired; at every 5-second interval, only data 1 is acquired; at every 8-second interval, only data 2 is acquired; and at every 10-second interval, both data 1 and data 3 are acquired. By calculating the maximum acquisition period, it is possible to determine at which specific time points the data acquisition volume reaches its peak, thereby identifying the time points that have the greatest impact on data communication efficiency. Based on this analysis, more targeted countermeasures can be developed to ensure smooth and efficient data communication.
[0076] Furthermore, the first acquisition method, the second acquisition method, and the third acquisition method refer to:
[0077] The first acquisition method refers to transmitting all target data at once when the interval is equal to the third threshold.
[0078] The second acquisition method refers to dividing the target data into multiple first groups based on the minimum interval greater than the third threshold, transmitting data from one first group at a time, and the storage addresses of the data in each first group are contiguous.
[0079] The third acquisition method refers to dividing the target data into multiple second groups based on the maximum interval greater than the third threshold, transmitting data from one second group at a time, and the storage addresses of the data in each second group are contiguous.
[0080] Specifically, the interval of the first acquisition method may be 0, indicating that the acquired data are contiguous in the storage address, so the third threshold can be equal to 0; the second acquisition method groups the data with the minimum interval, but the minimum interval cannot be 0. If it is 0, the data will be grouped in the same group and cannot be used as the basis for grouping. For example, when the target data to be collected in the acquisition command is data 2, data 3, data 7, data 8, and data 20, the interval between data 3 and data 7 is 3, and the interval between data 8 and data 20 is 11. Using the second acquisition method, based on the smallest interval greater than 0 (3), data 2 and data 3 can be grouped together, data 7 and data 8 can be grouped together, and data 20 can be grouped together. Using the third acquisition method, based on the largest interval greater than 0 (11), data 2, data 3, data 4, data 5, data 6, data 7, and data 8 can be grouped together, and data 20 can be grouped together. In this case, it seems that the most data is collected (with redundant data 4, 5, and 6), but because the number of acquisitions is less, saving communication connection time, the actual acquisition time may not be much. This can be calculated using the methods described above. By dividing the data acquisition methods into multiple types and calculating the acquisition time for each method, the acquisition method with the shortest acquisition time can be selected to maximize the communication efficiency of data acquisition.
[0081] Furthermore, the step S3 above, which involves collecting the first data based on the target acquisition method, also includes:
[0082] The minimum acquisition period is selected from the multiple first data acquisition periods. Based on the current network transmission rate, the maximum amount of data transmitted within the minimum acquisition period is calculated.
[0083] When the data volume of multiple first data sets is greater than or equal to the maximum data volume, a new storage space is created on the same disk, and the data volume greater than or equal to the target data volume is stored as the remaining data in the new storage space in chronological order. When collecting data in the next collection cycle, the remaining data is read from the new storage space.
[0084] When the amount of data for multiple first data points is less than the maximum amount of data, the first data points are collected based on the target acquisition method.
[0085] Specifically, during the maximum acquisition cycle, since all data from multiple first data sets are acquired, the amount of data acquired is large. The next minimum acquisition cycle then follows, and incomplete transmission may occur. Therefore, the maximum amount of data to be transmitted within the minimum acquisition cycle is calculated. For example, the maximum data transmission capacity within the minimum acquisition cycle is 20MB, while the total amount of multiple first data sets is 30MB. It's possible that some first data sets haven't been transmitted by the time the minimum acquisition cycle arrives. In this case, the untransmitted 10MB of data can be stored in a new, contiguous storage space for easy re-acquisition and transmission. After the maximum acquisition cycle, the minimum acquisition cycle follows. Since the minimum acquisition cycle only acquires a portion of the first data sets, the amount of data acquired is relatively small. The remaining data from the maximum acquisition cycle that wasn't transmitted in the new storage space can then be read and transmitted to complete the transmission. This improves the utilization rate of the communication process, thereby increasing data communication efficiency. When the amount of data from multiple first data sets is less than the maximum data size, the target data can be transmitted within the maximum acquisition cycle, so this situation does not require further analysis.
[0086] The present invention also provides, for example Figure 2 The heterogeneous data acquisition system based on AFC devices shown here receives heterogeneous data from multiple AFC devices. The system includes the following modules:
[0087] The acquisition unit is used to send heterogeneous data acquisition commands to the AFC device. The acquisition command includes the target data to be acquired, the type of target data, and the acquisition cycle. The target data consists of multiple first data, and each first data corresponds to one acquisition cycle.
[0088] The AFC unit is used to receive acquisition commands, obtain the data type of the target data from the acquisition commands, find the location of the target data in the storage unit based on the data type of the target data, and obtain the storage address corresponding to the target data.
[0089] The calculation unit is used to calculate the maximum acquisition period of the first data. When acquiring the first data at the acquisition time point corresponding to the maximum acquisition period, it divides the acquisition method of the first data into multiple types based on the storage address corresponding to the target data, calculates the acquisition time of each acquisition method, selects the acquisition method with the shortest acquisition time as the target acquisition method, and acquires the first data based on the target acquisition method.
[0090] The transmission unit is used to take multiple first data points corresponding to the same or different acquisition time points other than the first acquisition time point corresponding to the maximum acquisition period as second data. When the number of second data points is greater than or equal to a preset value, the acquisition method of the second data is divided into multiple types, and the calculation unit is repeatedly executed to obtain the acquisition method of the second data, and the second data is acquired based on the acquisition method of the second data.
[0091] The present invention also provides a computing device, the device comprising:
[0092] Memory and processor;
[0093] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the heterogeneous data acquisition method based on the AFC device described above is implemented.
[0094] The present invention also provides a computer storage medium storing program instructions, wherein the program instructions, when running, control the device where the computer storage medium is located to execute the above-described heterogeneous data acquisition method based on an AFC device.
[0095] In summary, this invention sends heterogeneous data acquisition commands to the AFC device through the acquisition unit. These commands include the target data to be acquired, the type of target data, and the acquisition period, ensuring that the acquired data meets actual needs. This enables accurate and efficient acquisition of diverse and large volumes of data from the AFC device. The AFC device receives the acquisition command and obtains the data type of the target data from it. Based on the data type, it locates the target data in the storage unit and obtains its corresponding storage address, allowing the AFC device to complete the data acquisition task efficiently and accurately. The maximum acquisition period for the first data is calculated. When acquiring the first data at the acquisition time point corresponding to the maximum acquisition period, the acquisition methods for the first data are divided into multiple categories based on the storage address of the target data. The acquisition time for each method is calculated, and the acquisition method with the shortest acquisition time is selected as the target acquisition method. The first data is then acquired based on this target acquisition method. This process of obtaining the data acquisition method with the shortest acquisition time improves the communication efficiency of data acquisition. Multiple first data points corresponding to the same or different acquisition time points (excluding the first acquisition time point corresponding to the maximum acquisition period) are used as second data. When the number of second data points is greater than or equal to a preset value, the acquisition methods of the second data are divided into multiple categories, and step S3 is repeatedly executed to obtain the acquisition methods of the second data. Second data is then acquired based on these acquisition methods to improve the communication efficiency of data acquisition. Through the coordination of the above steps, regardless of whether the acquisition period of the target data is the same, this invention can acquire the target data in the shortest acquisition time, thereby improving the communication efficiency of data acquisition.
[0096] It should be understood that although the steps in the flowcharts of the various embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the various embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0097] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0098] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 specification.
[0099] The above-described embodiments are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
[0100] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for heterogeneous data acquisition based on AFC devices, wherein the heterogeneous data comes from multiple AFC devices, characterized in that, The method includes the following steps: Step S1: The acquisition unit sends a heterogeneous data acquisition command to the AFC device. The acquisition command includes the target data to be acquired, the type of the target data, and the acquisition period. The target data consists of multiple first data, and each first data corresponds to one acquisition period. Step S2: The AFC device receives the acquisition command, obtains the data type of the target data from the acquisition command, locates the target data in the storage unit based on the data type of the target data, and obtains the storage address corresponding to the target data; Step S3: Calculate the maximum acquisition period of the first data. When acquiring the first data at the acquisition time point corresponding to the maximum acquisition period, based on the storage address corresponding to the target data, divide the acquisition method of the first data into multiple types, calculate the acquisition time of each acquisition method, and select the acquisition method with the shortest acquisition time as the target acquisition method. Acquire the first data based on the target acquisition method. Step S4: Take multiple first data points with the same acquisition period or different acquisition period corresponding to the second acquisition time point other than the first acquisition time point corresponding to the maximum acquisition period as second data. When the number of second data is greater than or equal to a preset value, divide the acquisition method of the second data into multiple types, and repeatedly execute step S3 to obtain the acquisition method of the second data, and acquire the second data based on the acquisition method of the second data.
2. The method according to claim 1, characterized in that, In step S3, the methods for collecting the target data are divided into several categories, including: Calculate the number of storage addresses between every two adjacent pieces of the first data in the target data, and use them as the interval. When multiple intervals are equal to a first threshold, the acquisition method of the target data is defined as the first acquisition method. When any one of the multiple interval values is less than or equal to the second threshold and greater than the first threshold, the acquisition method of the target data is defined as the second acquisition method; If any one of the interval values is greater than the second threshold, the acquisition method of the target data is defined as the third acquisition method.
3. The method according to claim 1, characterized in that, Step S3 involves selecting the acquisition method with the shortest acquisition time as the target acquisition method, including: The time required to transmit the target data to the acquisition unit is defined as the first time, the time for the acquisition unit to establish a communication connection with the AFC device is defined as the second time, and the time for the acquisition unit to interrupt the communication connection with the AFC device is defined as the third time. The acquisition time is the sum of the first time, the second time, and the third time. Based on the first time, the second time, and the third time, the acquisition time for acquiring the target data using each acquisition method is calculated, and the acquisition method with the shortest acquisition time is selected as the target acquisition method.
4. The method according to claim 3, characterized in that, Calculate the acquisition time for each acquisition method to acquire the target data, including: The acquisition time for acquiring the target data using the j-th acquisition method is calculated using the following expression: T j T2+T1×k+T3 Where j represents the j-th acquisition method, and its value is a positive integer between 1 and 3, T j The j-th acquisition method is used to collect the target data. T1 represents the first time, T2 represents the second time, T3 represents the third time, k represents the number of data collected by the j-th acquisition method, and the value range is greater than or equal to 1 and less than or equal to N. N represents the total number of data read by the j-th acquisition method.
5. The method according to claim 1, characterized in that, Calculating the maximum acquisition period of the first data includes: The acquisition period of all the first data in the target data is obtained from the acquisition command as an acquisition period data group, and the smallest value among the common period multiples of the acquisition periods in the acquisition period data group is calculated and obtained as the maximum acquisition period.
6. The method according to claim 2, characterized in that, The first acquisition method, the second acquisition method, and the third acquisition method refer to: The first acquisition method refers to transmitting all the target data at once when the intervals are all equal to the third threshold. The second acquisition method refers to dividing the target data into multiple first groups based on the minimum interval greater than the third threshold, transmitting data from one first group at a time, and the storage addresses of the data in each first group are contiguous; The third acquisition method refers to dividing the target data into multiple second groups based on the maximum interval greater than the third threshold, transmitting data from one second group at a time, and the storage addresses of the data in each second group are consecutive.
7. The method according to claim 1, characterized in that, Step S3, which involves collecting the first data based on the target acquisition method, further includes: The minimum acquisition period is taken as the acquisition period among the multiple first data acquisition periods. Based on the current network transmission rate, the maximum amount of data transmitted within the minimum acquisition period is calculated. When the data volume of multiple first data is greater than or equal to the maximum data volume, a new storage space is created on the same disk, and the data volume greater than or equal to the target data is stored as the remaining data in the new storage space in chronological order. When data is collected in the next collection cycle, the remaining data is read from the new storage space. When the amount of data in multiple instances of the first data is less than the maximum amount of data, the first data is collected based on the target acquisition method.
8. A heterogeneous data acquisition system based on AFC devices, used to implement the method as described in any one of claims 1-7, characterized in that, The system includes the following modules: The acquisition unit is used to send a heterogeneous data acquisition command to the AFC device. The acquisition command includes the target data to be acquired, the type of the target data, and the acquisition period. The target data consists of multiple first data, and each first data corresponds to one acquisition period. The AFC unit is used to receive the acquisition command, obtain the data type of the target data from the acquisition command, locate the target data in the storage unit based on the data type of the target data, and obtain the storage address corresponding to the target data. The calculation unit is used to calculate the maximum acquisition period of the first data. When acquiring the first data at the acquisition time point corresponding to the maximum acquisition period, based on the storage address corresponding to the target data, the acquisition method of the first data is divided into multiple types, the acquisition time of each acquisition method is calculated, and the acquisition method with the shortest acquisition time is selected as the target acquisition method. The first data is acquired based on the target acquisition method. The transmission unit is used to take multiple first data points corresponding to the same acquisition time point or different acquisition time points other than the first acquisition time point corresponding to the maximum acquisition period as second data. When the number of second data points is greater than or equal to a preset value, the acquisition method of the second data is divided into multiple types, and the calculation unit is repeatedly executed to obtain the acquisition method of the second data, and the second data is acquired based on the acquisition method of the second data.
9. A computing device, characterized in that, The device includes: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the heterogeneous data acquisition method based on the AFC device as described in any one of claims 1-7.
10. A medium, characterized in that, The medium stores program instructions, wherein when the program instructions are executed, the device on which the medium is located executes the heterogeneous data acquisition method based on any one of claims 1-7.
Citation Information
Patent Citations
Data writing method and device and data reading method and device
CN103500224A
Data processing method and apparatus
CN105556489A
