Data acquisition request response method and device based on total data, equipment and medium
By cached and putting the data collected by the communication collector into disk, the data interface is integrated to achieve full data acquisition, solving the time delay problem caused by the time difference between historical data and real-time data, and realizing timely reading and efficient acquisition of data.
Patent Information
- Application Number
- CN202411926558.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-11
AI Technical Summary
In the prior art, there is a time difference between historical data and real-time data, resulting in a time delay in functional operations, a time delay in timing databases in high concurrent operations, and a time delay in obtaining historical data from a timing database.
By sending all data at each time collected by the communication collector to the preset data cache area for cache, and performing data drop-out operations on data that meets the drop-out conditions, saving the data to the preset target disk. Then, by integrating the interface between the data cache area and the target disk, the full amount of data is obtained to ensure that the data can be read in time.
It realizes timely reading of data at all times collected by the communication collector, avoids time delay, improves the efficiency and reliability of data acquisition, and is suitable for high concurrent operations and real-time data processing.
Smart Images

Figure CN119807251A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data storage, and in particular to a data acquisition request response method, device, equipment and medium based on full data. Background Art
[0002] Under current technical conditions, there is a certain time difference between historical data and real-time data. When it comes to functions related to historical data, this time difference will cause time delays, because these functions need to call historical data to operate, and historical data can only be read in time after being written to the disk. For example, for statistical functions, it is necessary to wait for historical data to be written to the disk before it can be read and used. In the prior art, time series databases are usually used to store data to obtain data from time series databases; however, time series databases have limitations when processing high-concurrency operations on data; at the same time, time series databases are generally used as historical databases to store data within historical time. When obtaining historical data from time series databases, there is also a time delay problem, which causes the historical data to not be read in time. Summary of the invention
[0003] In view of this, the purpose of this application is to provide a data acquisition request response method, device, equipment and medium based on full data, which can enable the data collected by the communication collector at each moment to be read in time. The specific scheme is as follows:
[0004] In a first aspect, the present application provides a data acquisition request response method based on full data, comprising:
[0005] Send the data collected by the communication collector at each moment to the preset data buffer area for caching;
[0006] Determine the target cache data in the current preset data cache area that meets the preset disk-writing condition, and perform a data-writing operation on the target cache data to save the target cache data to the preset target disk;
[0007] When receiving a data acquisition request sent by a request initiator, acquiring target data corresponding to the data acquisition request from the preset data cache area and / or the preset target disk through a pre-configured full data acquisition interface, and returning the target data to the request initiator;
[0008] Among them, the full data acquisition interface is an interface obtained by integrating the first data interface and the second data interface, the first data interface is an interface connected to the preset data cache area for obtaining the current cached data in the preset data cache area, and the second data interface is an interface connected to the preset target disk for obtaining the data that has been written to the disk in the preset target disk.
[0009] Optionally, the data acquisition request response method based on full data further includes:
[0010] When receiving a current moment data acquisition request sent by a request initiator, the current moment data corresponding to the current moment data acquisition request is acquired from a preset data buffer area through a pre-configured real-time data interface, and the current moment data is returned to the request initiator;
[0011] The real-time data interface is an interface connected to the preset data buffer area and used to obtain the current time data in the preset data buffer area.
[0012] Optionally, the step of sending the data collected by the communication collector at each moment to a preset data buffer area for buffering includes:
[0013] The data collected by the communication collector at each moment is acquired in real time, and the data collection moment and data information corresponding to the data are saved in a preset data buffer area; wherein the data information includes data value and data quality.
[0014] Optionally, the step of saving the data collection time and data information corresponding to the data in a preset data buffer area includes:
[0015] If the data collected by the communication collector at any time is a single data, the data collection time and data information corresponding to the single data are saved in a preset data buffer area;
[0016] If the communication collector collects multiple data at any time, the data collection time corresponding to the multiple data, each data value and the target data quality determined based on the multiple data are saved in the preset data cache area.
[0017] Optionally, the step of saving the data collection time and data information corresponding to the data in a preset data buffer area includes:
[0018] If the data collected by the communication collector at any time is a single data, the data collection time and data information corresponding to the single data are saved in a preset data buffer area;
[0019] If the communication collector collects multiple data at any time, the data collection time corresponding to the multiple data, each data value and the target data quality determined based on the multiple data are saved in the preset data cache area.
[0020] Optionally, the process of performing the data write operation on the target cache data further includes:
[0021] Determine whether the data write operation is successful. If successful, delete the corresponding data written to the disk from the current cache data stored in the preset data cache area. If unsuccessful, issue an alarm message and determine the abnormality processing time based on the preset cache data volume upper limit threshold; the preset cache data volume upper limit threshold is the maximum amount of data that can be stored in the preset data cache area;
[0022] The abnormal problem is processed within the abnormal processing time, and the data storage operation is re-executed after the abnormal problem is processed.
[0023] Optionally, the process of performing the data write operation on the target cache data further includes:
[0024] Determine whether the data write operation is successful. If successful, delete the corresponding data written to the disk from the current cache data stored in the preset data cache area. If unsuccessful, issue an alarm message and determine the abnormality processing time based on the preset cache data volume upper limit threshold; the preset cache data volume upper limit threshold is the maximum amount of data that can be stored in the preset data cache area;
[0025] The abnormal problem is processed within the abnormal processing time, and the data storage operation is re-executed after the abnormal problem is processed.
[0026] In a second aspect, the present application provides a data acquisition request response device based on full data, comprising:
[0027] The data cache module is used to send the data collected by the communication collector at each moment to a preset data cache area for caching;
[0028] A data storage module is used to determine the target cache data that meets the preset storage condition in the current preset data cache area, and perform a data storage operation on the target cache data to save the target cache data to the preset target disk;
[0029] The data sending module, when receiving a data acquisition request sent by a request initiator, acquires target data corresponding to the data acquisition request from the preset data cache area and / or the preset target disk through a pre-configured full data acquisition interface, and returns the target data to the request initiator;
[0030] Among them, the full data acquisition interface is an interface obtained by integrating the first data interface and the second data interface, the first data interface is an interface connected to the preset data cache area for obtaining the current cached data in the preset data cache area, and the second data interface is an interface connected to the preset target disk for obtaining the data that has been written to the disk in the preset target disk.
[0031] In a third aspect, the present application provides an electronic device, including:
[0032] Memory, used to store computer programs;
[0033] A processor is used to execute the computer program to implement the aforementioned data acquisition request response method based on full data.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned data acquisition request response method based on full data.
[0035] In the present application, the data collected by the communication collector at each moment are sent to a preset data cache area for caching; the target cache data in the current preset data cache area that meets the preset disk-falling conditions is determined, and a data-falling operation is performed on the target cache data to save the target cache data to the preset target disk; when a data acquisition request sent by a request initiator is received, the target data corresponding to the data acquisition request is acquired from the preset data cache area and / or the preset target disk through a pre-configured full data acquisition interface, and the target data is returned to the request initiator; wherein the full data acquisition interface is an interface obtained by integrating a first data interface and a second data interface, the first data interface being an interface connected to the preset data cache area for acquiring the current cached data in the preset data cache area, and the second data interface being an interface connected to the preset target disk for acquiring the already-fallen-disk data in the preset target disk. As can be seen from the above, the present application first sends the data at each moment collected by the communication collector to the preset data cache area for caching, and performs a data disk placement operation on the target cache data in the current preset data cache area that meets the preset disk placement conditions, so as to save the target cache data to the preset target disk; then, the current cache data in the current preset data cache area is obtained through the first data interface, and the disk-placed data in the preset target disk is obtained through the second data interface, and the first data interface and the second data interface are integrated to obtain a full data acquisition interface, so as to obtain the data at each moment corresponding to the data acquisition request from the preset data cache area and / or the preset target disk based on the full data acquisition interface, that is, the data at each moment collected by the communication collector can be read in time without time delay. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0037] Figure 1 A data acquisition request response flow chart based on full data disclosed in this application;
[0038] Figure 2 This is a schematic diagram of a data storage operation disclosed in this application;
[0039] Figure 3 A specific data acquisition request response diagram based on full data disclosed in this application;
[0040] Figure 4This is a schematic diagram of the structure of a data acquisition request response device based on full data disclosed in this application;
[0041] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0043] Under current technical conditions, there will be a certain time difference between historical data and real-time data. When it comes to functions related to historical data, this time difference will cause time delays, because these functions need to call historical data to operate, and historical data can only be read in time after being written to the disk. For example, for statistical functions, it is necessary to wait for historical data to be written to the disk before it can be read and used. In the prior art, time series databases are usually used to store data to obtain data from time series databases; but time series databases have limitations when processing high-concurrency operations on data; at the same time, time series databases are generally used as historical databases to store data within historical time. When obtaining historical data from time series databases, there is also a time delay problem, which causes the historical data to not be read in time. To this end, the present application provides a data acquisition request response method based on full data, which enables the data collected by the communication collector at each moment to be read in time without time delay.
[0044] See also Figure 1 As shown, the embodiment of the present application discloses a data acquisition request response method based on full data, including:
[0045] Step S11: Send the data collected by the communication collector at each moment to a preset data buffer area for buffering.
[0046] In this embodiment, the data collected by the communication collector at each moment is acquired in real time, and the data collection moment and data information corresponding to the data are saved in a preset data cache; wherein the data information includes data value and data quality. If the data collected by the communication collector at any moment is a single data, the data collection moment and data information corresponding to the single data are saved in a preset data cache; if the data collected by the communication collector at any moment is multiple data, the data collection moment corresponding to the multiple data, each data value, and the target data quality determined based on the multiple data are saved in the preset data cache.
[0047] It should be noted that, during the data collection process, as time goes by and data is updated, the same data may have multiple versions at different times. The above-mentioned preset data cache includes multiple storage units for storing different versions of different data, and each data can be saved in each storage unit in the form of a queue; wherein, the above-mentioned preset data cache can also be replaced with an in-memory database, such as Redis (Remote Dictionary Server, an open source non-relational database), or shared memory, which has a certain improvement in performance; due to the different number of data collected at different times, if the data collected by the communication collector at any time is a single data, the data collection time, data value and data quality corresponding to the single data can be saved in the preset data cache, and the data type of the saved data at this time is a data point; if the data collected by the communication collector at any time is multiple data, the data collection time, each data value and the target data quality determined based on the multiple data can be saved in the preset data cache, and the data type of the saved data at this time is a data group.
[0048] For example, taking a single data cache as an example:
[0049] "unit_1": {
[0050] "data_type": "single_point",
[0051] "cache_queue": [
[0052] {
[0053] "datetime": "2024-08-20T10:00:00Z",
[0054] "val": 100,
[0055] "q": "good"
[0056] },
[0057] {
[0058] "datetime": "2024-08-20T09:00:00Z",
[0059] "val": 95,
[0060] "q": "good"
[0061] } ]
[0063] },
[0064] Among them, unit_1 represents the name of the storage unit; data_type represents the storage unit type; single_point represents the data point; cache_queue represents the cache queue of the storage unit, which is a list used to store multiple versions of data; datetime represents the timestamp of each version of the data, that is, the data collection time, such as 2024-08-20T10:00:00Z, which means 10:0:00 on August 20, 2024; val represents the data value; q represents the data quality of a single data, where different values of q have different meanings, for example, q=0 x00, indicating that the communication is normal and the data is collected and written normally; q=0x01, indicating that the communication is interrupted, and the data value is the value of the previous moment or the initialization state value; q=0x02, indicating that the write cache command is abnormal, and there is a problem with the write operation; q=0x04, indicating that the device is abnormal, and there may be a problem with writing data; q=0x08, indicating that the data is invalid, and the cache area cannot be connected when reading real-time data or cached data; q=0x10, indicating that the data is invalid, there is no such data point definition, and this value does not exist; q=0x20, indicating that the data is written without communication collection, and the data is written in other ways; where 0x represents a hexadecimal value. In this embodiment, good can be used to represent the case where the q value is zero, and bad can be used to represent the case where the q value is non-zero.
[0065] Take multiple data caches as an example:
[0066] "unit_2": {
[0067] "data_type": "data_group",
[0068] "cache_queue": [
[0069] {
[0070] "datetime": "2024-08-20T10:00:00Z",
[0071] "values": {
[0072] "val1": 120,
[0073] "val2": 85,
[0074] "val3": 76
[0075] },
[0076] "q": "good"
[0077] },
[0078] {
[0079] "datetime": "2024-08-20T09:00:00Z",
[0080] "values": {
[0081] "val1": 118,
[0082] "val2": 82,
[0083] "val3": 74
[0084] },
[0085] "q": "bad"
[0086] } ]
[0088] }
[0089] Among them, unit_2 represents the name of the storage unit; data_type represents the storage unit type; data_group represents the data group; values represents multiple data values of the group of data, including val1, val2, and val3; q represents the quality of the data group composed of multiple data, that is, the target data quality.
[0090] It should be noted that the data of each version in this embodiment can be stored using the JSON (JavaScript Object Notation, a lightweight data exchange format) structure, or other structures, such as MongoDB (a document-based database), where data is stored in the form of documents. The specific structure used only affects the reading and writing methods, and does not affect the function of the entire system.
[0091] Step S12: determining the target cache data in the current preset data cache area that meets the preset disk write condition, and performing a data write operation on the target cache data to save the target cache data to the preset target disk.
[0092] In this embodiment, first, for the current preset data cache area, it is determined whether the preset disk operation trigger condition is currently met; if the preset disk operation trigger condition is currently met, the order of data collection time in the preset data cache area from early to late is used as the data filtering order, and according to the data filtering order, a preset amount of cache data is selected from the current preset data cache area as the target cache data.
[0093] It should be noted that, in this embodiment, whenever the amount of unwritten data in the current preset data cache area reaches the preset data amount, the preset disk write operation trigger condition is met, and the disk write operation begins to be executed. The preset data amount of cache data is selected from the current preset data cache area in the order of data collection time from early to late as the target cache data.
[0094] After the target cache data is determined, the data write operation is performed on the above target cache data to save the target cache data to the preset target disk; in this process, it involves writing data from the cache area to the disk, such as the operation of the hard disk, and factors such as data integrity and writing speed need to be considered; on the other hand, storage device failures may occur in this process, such as system freezes, system restarts, disk damage, or database anomalies, program logic errors, etc., resulting in the failure of the data write operation. At this time, the abnormal problem needs to be further processed to avoid data loss.
[0095] Specifically, Figure 2 Taking the data disk-placing operation shown as an example, after reading the target cache data from the current preset data cache area, first determine whether this data disk-placing operation is successful. If the disk-placing is successful, that is, the database management system correctly writes the data to the corresponding location on the disk, then delete the corresponding disk-placing data from the current cache data saved in the preset data cache area. If the disk-placing fails, an alarm message is issued, such as sending an email to the system administrator, displaying an error message on the system console, or triggering other alarm mechanisms, so that relevant personnel can quickly know that there is a problem with the disk-placing, and determine the exception handling time based on the preset cache data volume upper limit threshold; wherein the preset cache data volume upper limit threshold is the maximum amount of data that can be saved in the preset data cache area; then handle the exception problem within the exception handling time, and re-execute the data disk-placing operation after the exception problem is handled.
[0096] Among them, the above-mentioned determination of the exception processing time based on the preset cache data volume upper limit threshold may include: first determining the ratio of the preset cache data volume upper limit threshold to the amount of data sent to the preset data cache area for caching per unit time; and then determining the exception processing time based on the difference between the ratio and the actual disk write cycle; the above-mentioned actual disk write cycle is the time required to write the cached data of a preset amount in the preset data cache area to the disk at one time.
[0097] It should be noted that the preset data cache area is limited by a preset cache data volume upper limit threshold. When the cache data volume in the preset data cache area exceeds the preset cache data volume upper limit threshold, the cache data with the earliest time in the preset data cache area will be cleared. Therefore, if the abnormal problem is handled within the abnormal processing time, such as solving the database abnormal problem, switching the stored database, etc., so that the cache data is successfully stored on the disk, the data loss problem can be avoided. If the abnormal problem is not solved after the abnormal processing time, data loss will occur. Furthermore, the abnormal processing time can be controlled by modifying the preset cache data volume upper limit threshold and / or the amount of data sent to the preset data cache area for caching per unit time.
[0098] In this embodiment, the database for storing data can be any database that has the function of storing data from memory to disk; the performance of data storage depends on the database and table design, and MySQL (an open source relational database management system), SQLite (a lightweight database), SQLServer ( , a relational database management system), etc.; at the same time, the stored database can be switched during runtime without affecting the system or losing data.
[0099] Step S13: When a data acquisition request is received from the request initiator, the target data corresponding to the data acquisition request is acquired from the preset data cache area and / or the preset target disk through a pre-configured full data acquisition interface, and the target data is returned to the request initiator; wherein the full data acquisition interface is an interface obtained by integrating the first data interface and the second data interface, the first data interface is an interface connected to the preset data cache area for acquiring the current cached data in the preset data cache area, and the second data interface is an interface connected to the preset target disk for acquiring the data already written to the preset target disk.
[0100] In this embodiment, Figure 3Taking the data acquisition request response diagram based on full data as an example, the response to the data acquisition request sent by the request initiator is implemented based on the real-time data interface, the first data interface, the second data interface, and the full data acquisition interface. Among them, the real-time data interface is an interface connected to the preset data cache area for obtaining the current time data in the preset data cache area. When the current time data acquisition request sent by the request initiator is received, the current time data corresponding to the current time data acquisition request is obtained from the preset data cache area through the pre-configured real-time data interface, and the current time data is returned to the request initiator; the first data interface is an interface connected to the preset data cache area for obtaining the current cached data in the preset data cache area, also known as the cache data interface; the real-time data interface is a special branch of the cache data interface; the second data interface provides a corresponding query interface according to the database where the data is stored on the disk, and shields the differences in the database so that the user is unaware of the database differences, also known as the historical data interface; since the data structures returned by the first data interface and the second data interface are consistent, the full data acquisition interface obtained after the integration of the first data interface and the second data interface can be used to obtain data at all times based on the full data acquisition interface, that is, as long as the data is collected through the communication collector, it can be read in time without delay.
[0101] It should be noted that the speed of obtaining the current moment data based on the real-time data interface is slightly faster than the speed of obtaining the current moment data based on the full data acquisition interface. Real-time data that does not need to be written to the disk is allowed. The number of cached versions of such real-time data is 1. Therefore, the current moment data can be obtained based on the real-time data interface, and the data of all moments can be obtained based on the full data acquisition interface. By combining the cached data interface and the historical data interface, an interface is provided to obtain the data of all moments collected by the communication collector. This interface can cope with high concurrency operations on data.
[0102] As can be seen from the above, in this embodiment, the data collected by the communication collector at each moment are first sent to the preset data cache area for caching, and the data disk operation is performed on the target cache data in the current preset data cache area that meets the preset disk-falling conditions, so as to save the target cache data to the preset target disk; then the current cache data in the current preset data cache area is obtained through the first data interface, and the disk-falling data in the preset target disk is obtained through the second data interface, and the first data interface and the second data interface are integrated to obtain a full data acquisition interface, so as to obtain the data at each moment corresponding to the data acquisition request from the preset data cache area and / or the preset target disk based on the full data acquisition interface, that is, the data at each moment collected by the communication collector can be read in time without time delay; further, the method mentioned in this embodiment facilitates many applications that use historical data, so that these applications can display data in time, without waiting for the data to be completely flushed to the disk, avoiding the delay caused by the data flushing time, such as when data analysis and trend prediction are implemented based on statistical tools such as reports, it is more timely, which is helpful for decision-making and improves generation efficiency.
[0103] See also Figure 4 As shown, the embodiment of the present application also discloses a data acquisition request response device based on full data, including:
[0104] The data cache module 11 is used to send the data collected by the communication collector at each moment to a preset data cache area for caching;
[0105] The data storage module 12 is used to determine the target cache data in the current preset data cache area that meets the preset storage condition, and perform a data storage operation on the target cache data to save the target cache data to the preset target disk;
[0106] The data sending module 13, when receiving a data acquisition request sent by a request initiator, acquires target data corresponding to the data acquisition request from the preset data cache area and / or the preset target disk through a pre-configured full data acquisition interface, and returns the target data to the request initiator;
[0107] Among them, the full data acquisition interface is an interface obtained by integrating the first data interface and the second data interface, the first data interface is an interface connected to the preset data cache area for obtaining the current cached data in the preset data cache area, and the second data interface is an interface connected to the preset target disk for obtaining the data that has been written to the disk in the preset target disk.
[0108] As can be seen from the above, the present application is applied to a SCADA (Supervisory Control and Data Acquisition) system. First, the data collected by the communication collector at each moment are sent to a preset data cache area for caching, and a data disk placement operation is performed on the target cache data in the current preset data cache area that meets the preset disk placement conditions, so as to save the target cache data to the preset target disk; then, the current cache data in the current preset data cache area is obtained through the first data interface, and the disk-placed data in the preset target disk is obtained through the second data interface, and the first data interface and the second data interface are integrated to obtain a full data acquisition interface, so as to obtain the data at each moment corresponding to the data acquisition request from the preset data cache area and / or the preset target disk based on the full data acquisition interface, that is, the data at each moment collected by the communication collector can be read in time without time delay.
[0109] In some specific implementations, the data acquisition request response device based on the full amount of data further includes:
[0110] A data acquisition module, configured to, upon receiving a current moment data acquisition request sent by a request initiator, acquire the current moment data corresponding to the current moment data acquisition request from a preset data buffer area through a pre-configured real-time data interface, and return the current moment data to the request initiator;
[0111] The real-time data interface is an interface connected to the preset data buffer area and used to obtain the current time data in the preset data buffer area.
[0112] In some specific implementations, the data cache module 11 includes:
[0113] The data storage submodule is used to obtain the data collected by the communication collector at each moment in real time, and save the data collection moment and data information corresponding to the data into a preset data buffer area; wherein the data information includes data value and data quality.
[0114] In some specific implementations, the data storage submodule includes:
[0115] A first data storage unit, for storing the data collection time and data information corresponding to the single data in a preset data buffer area if the data collected by the communication collector at any time is a single data;
[0116] The second data storage unit is used to save the data collection time, each data value and the target data quality determined based on the multiple data corresponding to the multiple data into the preset data cache area if the data collected by the communication collector at any time is multiple data.
[0117] In some specific implementations, the data storage module 12 includes:
[0118] A condition judgment unit, used to determine whether a preset disk placement operation trigger condition is currently met;
[0119] A data determination unit is used to, if the preset disk write operation trigger condition is currently met, use the order of data collection time in the preset data cache area from early to late as the data screening order, and select a preset amount of cache data from the current preset data cache area as the target cache data according to the data screening order.
[0120] In some specific implementations, the data storage module 12 includes:
[0121] The disk placement judgment submodule is used to judge whether the data placement operation is successful. If successful, the corresponding data that has been placed on disk is deleted from the current cache data stored in the preset data cache area. If unsuccessful, an alarm message is issued and an exception processing time is determined based on a preset cache data volume upper limit threshold; the preset cache data volume upper limit threshold is the maximum amount of data that can be stored in the preset data cache area;
[0122] The exception handling unit is used to handle the exception problem within the exception handling time, and re-execute the data storage operation after the exception problem is handled.
[0123] In some specific implementations, the disk placement judgment submodule includes:
[0124] A ratio determination unit, used to determine the ratio of a preset cache data amount upper limit threshold to the amount of data sent to the preset data cache area for caching within a unit time;
[0125] The time determination unit is used to determine the exception processing time based on the difference between the ratio and the actual disk write cycle; the actual disk write cycle is the time required to write the cached data of the preset data volume in the preset data cache area to the disk at one time.
[0126] Furthermore, the present application also discloses an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0127] Figure 5 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the data acquisition request response method based on full data disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0128] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0129] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0130] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the data acquisition request response method based on full data executed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0131] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed data acquisition request response method based on full data is implemented. For the specific steps of the method, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, and no further description will be given here.
[0132] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0133] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0134] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0135] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0136] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data acquisition request response method based on full data, characterized in that: include: Send the data collected by the communication collector at each moment to the preset data buffer area for caching; Determine the target cache data in the current preset data cache area that meets the preset disk-writing condition, and perform a data-writing operation on the target cache data to save the target cache data to the preset target disk; When receiving a data acquisition request sent by a request initiator, acquiring target data corresponding to the data acquisition request from the preset data cache area and / or the preset target disk through a pre-configured full data acquisition interface, and returning the target data to the request initiator; Among them, the full data acquisition interface is an interface obtained by integrating the first data interface and the second data interface, the first data interface is an interface connected to the preset data cache area for obtaining the current cached data in the preset data cache area, and the second data interface is an interface connected to the preset target disk for obtaining the data that has been written to the disk in the preset target disk.
2. The data acquisition request response method based on full data according to claim 1 is characterized in that: Also includes: When receiving a current moment data acquisition request sent by a request initiator, the current moment data corresponding to the current moment data acquisition request is acquired from a preset data buffer area through a pre-configured real-time data interface, and the current moment data is returned to the request initiator; The real-time data interface is an interface connected to the preset data buffer area and used to obtain the current time data in the preset data buffer area.
3. The data acquisition request response method based on full data according to claim 1 is characterized in that: The data collected by the communication collector at each moment is sent to a preset data buffer area for buffering, including: The data collected by the communication collector at each moment is acquired in real time, and the data collection moment and data information corresponding to the data are saved in a preset data buffer area; wherein the data information includes data value and data quality.
4. The data acquisition request response method based on full data according to claim 3 is characterized in that: The step of storing the data collection time and data information corresponding to the data in a preset data buffer area includes: If the data collected by the communication collector at any time is a single data, the data collection time and data information corresponding to the single data are saved in a preset data buffer area; If the communication collector collects multiple data at any time, the data collection time corresponding to the multiple data, each data value and the target data quality determined based on the multiple data are saved in the preset data cache area.
5. The data acquisition request response method based on full data according to claim 1 is characterized in that: The determining of the target cache data in the current preset data cache area that meets the preset disk-writing condition includes: Determine whether the preset disk placement operation trigger conditions are currently met; If the preset disk write operation trigger condition is currently met, the order of data collection time in the preset data cache area from early to late is used as the data screening order, and the cache data of a preset data amount is selected from the current preset data cache area as the target cache data according to the data screening order.
6. The method for responding to a data acquisition request based on full data according to any one of claims 1 to 5, characterized in that: The process of performing the data write operation on the target cache data also includes: Determine whether the data write operation is successful. If successful, delete the corresponding data written to the disk from the current cache data stored in the preset data cache area. If unsuccessful, issue an alarm message and determine the abnormality processing time based on the preset cache data volume upper limit threshold; the preset cache data volume upper limit threshold is the maximum amount of data that can be stored in the preset data cache area; The abnormal problem is processed within the abnormal processing time, and the data storage operation is re-executed after the abnormal problem is processed.
7. The data acquisition request response method based on full data according to claim 6 is characterized in that: The determining of the exception handling time based on a preset cache data amount upper limit threshold comprises: Determine the ratio of a preset cache data volume upper limit threshold to the amount of data sent to the preset data cache area for caching per unit time; The exception handling time is determined based on the difference between the ratio and the actual disk write cycle; the actual disk write cycle is the time required to write a preset amount of cached data in the preset data cache area to disk at one time.
8. A data acquisition request response device based on full data, characterized in that: include: The data cache module is used to send the data collected by the communication collector at each moment to a preset data cache area for caching; A data storage module is used to determine the target cache data that meets the preset storage condition in the current preset data cache area, and perform a data storage operation on the target cache data to save the target cache data to the preset target disk; The data sending module, when receiving a data acquisition request sent by a request initiator, acquires target data corresponding to the data acquisition request from the preset data cache area and / or the preset target disk through a pre-configured full data acquisition interface, and returns the target data to the request initiator; Among them, the full data acquisition interface is an interface obtained by integrating the first data interface and the second data interface, the first data interface is an interface connected to the preset data cache area for obtaining the current cached data in the preset data cache area, and the second data interface is an interface connected to the preset target disk for obtaining the data that has been written to the disk in the preset target disk.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the data acquisition request response method based on full data as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the data acquisition request response method based on full data as described in any one of claims 1 to 7.