Disclosure of Invention
The invention aims to solve the technical problems and provides a method for storing frequency sweep basic data for monitoring a radio ultrashort wave frequency band.
In order to achieve the above purpose, the invention adopts the following technical scheme:
the data storage method is based on a radio ultrashort wave frequency band monitoring frequency sweep basic data storage system, and the radio ultrashort wave frequency band monitoring frequency sweep basic data storage system comprises a frequency sweep data import module, a frequency sweep basic data storage module, a frequency sweep basic data configuration module and a frequency sweep basic data reading module; the sweep frequency basic data importing module is used for importing networking sweep frequency data and drive test bin file data into a radio ultrashort wave monitoring sweep frequency basic data storage system, and the data are uploaded to a radio monitoring data platform through a data transmission tool and stored; the frequency sweep basic data storage module comprises a normal frequency sweep basic data storage module and a compressed frequency sweep basic data storage module, wherein the normal frequency sweep monitoring data storage module is used for storing the latest uploaded monitoring data, and the compressed frequency sweep basic data storage module is used for storing long-time unused frequency sweep data; the sweep frequency basic data configuration module is used for realizing the configuration management function of stored sweep frequency data, and comprises normal sweep frequency data management, compressed sweep frequency data management and data compression management; the sweep frequency basic data reading module is used for realizing the rapid reading function of the original monitoring data, and comprises the reading of the original monitoring file and the reading of the basic monitoring data stream;
the data storage method comprises the following steps:
step 1, uploading sweep frequency monitoring data of networking equipment to a radio monitoring data platform in real time or quasi-real time through a sweep frequency data importing module, and writing corresponding task related information into a sweep frequency basic data configuration module;
step 2, the sweep frequency basic data storage module is based on a radio monitoring data platform, and after receiving the uploaded sweep frequency data, the sweep frequency basic data storage module determines the number of backup data and the compression type of the data according to the data of the sweep frequency basic data configuration table to store the data;
step 3, the sweep frequency basic data configuration module stores, compresses and extracts various information of the recorded uploading basic monitoring data;
and 4, after the sweep frequency basic data reading module receives the requirement of external query data, determining the monitoring basic data through a positioning algorithm by querying corresponding table items in the sweep frequency basic data configuration module, and returning to related applications.
Preferably, in the step 1, the networking monitoring platform uploads the data to the radio monitoring data platform through a data acquisition machine, and the data acquisition machine uploads the data to the radio monitoring data platform through relevant tools such as transmission software Flume, FTP and the like.
Preferably, in the step 2, the types of data stored in the sweep frequency basic data storage module include original monitoring sweep frequency basic data and compressed monitoring sweep frequency basic data, the monitoring basic data storage module compresses according to idle time of task data, the monitoring basic data storage module reads last editing time of the task in the task information table in the monitoring configuration module, judges whether the time and the current time exceed one year, if so, the task is compressed, after compression, the monitoring basic data only retains one piece of data, and meanwhile, a compressed mark is marked in a task file processing field.
Preferably, the sweep frequency basic data storage module receives the sweep frequency basic original data and stores the sweep frequency basic original data to the radio data platform, the sweep frequency monitoring basic data is stored in the radio data platform according to the task dimension, and the sweep frequency basic data storage module also updates the data to the task information table stored in the sweep frequency data configuration module.
Preferably, the data updated by the sweep frequency basic data storage module is used for butting task information with the radio data platform, periodically inquiring the task ID of the uploaded data from the radio data platform and storing the corresponding information into a task information storage table; meanwhile, the sweep frequency basic data storage module automatically updates the saved task information table through the uploaded data, the sweep frequency basic data storage module compares the minimum time in each task text frame with the text starting time in the saved task information table, if the minimum time in each task text frame is smaller than the text starting time in the saved task information table, and meanwhile, compares the maximum time in each task text frame with the text ending time in the saved task information table, and if the maximum time in each task text frame is larger than the text ending time in the saved task information table, the sweep frequency basic data storage module updates; the text size of the corresponding task is updated every time the sweep frequency basic data storage module receives one text; and the sweep frequency basic data storage module selects and changes the number of backup parts of the stored original data through the backup parameters in the sweep frequency basic data configuration module.
Preferably, in the step 3, the sweep frequency basic data configuration data stored by the sweep frequency basic data configuration module is stored in a data set form, and the data set includes a corresponding save task information table and a data backup configuration table.
Preferably, in the step 4, the sweep frequency basic data reading module provides a quick and accurate positioning return of the original monitoring sweep frequency file, and supports a quick return of the original monitoring file and a byte return of the socket stream.
Preferably, in the quick original monitoring file return, the sweep frequency basic data reading module returns a corresponding monitoring file according to the time or the time period of data extraction, monitoring equipment and a monitoring task, and query parameters are as follows: < query start time, query end time, task ID >.
Preferably, after the sweep frequency basic data reading module receives the query parameters, specific file reading data is positioned according to the starting time and the task ID, and the steps are as follows:
step 1, a sweep frequency basic data reading module inquires and stores a task information table according to a task ID, wherein inquired fields comprise the starting time of a task text, the ending time of the text, the size of monitoring task data and compression state parameters of the monitoring task; if the compression state parameter of the monitoring task is displayed to be compressed, the data extraction module decompresses the monitoring task and then continues to execute the step 1;
step 2, the sweep frequency basic data reading module compares and acquires the time difference delta T between the duration delta T of the monitoring task and the inquiry starting time and the text starting time, and the calculation method is as follows:
δT=T2-T1,δt=t1-T1;
wherein T2 represents the end time of the text of the monitoring task, T1 represents the start time of the text of the monitoring task, and T1 represents the start time of the query;
if δt is less than 0, the reading module provides the saved monitoring text with the monitoring original task data numbered 1 as a starting text, and if δt is greater than 0, the reading module obtains the starting text according to the following formula:
;
wherein M represents the data size of the whole monitoring task, floor represents the whole taking-down, 255 represents each text size of 255M, and the calculated integer value is the text initial sequence number value of the original data of the taken monitoring task;
step 3, sweep frequency basic data reading module ratioComparing the time difference between the acquisition monitoring task duration delta T and the query end time and the text end timet, the calculation method is as follows:
δT=T2-T1,t=T2-t2;
wherein T2 represents the end time of the text of the monitoring task, T1 represents the start time of the text of the monitoring task, and T2 represents the end time of the query;
if it ist is less than 0, the sweep frequency basic data reading module provides a stored monitoring text with the largest monitoring original task data label as an ending text; if->And t is greater than 0, acquiring an initial text by the sweep frequency basic data reading module according to the following formula:
;
wherein M represents the data size of the whole monitoring task, ceil represents the taking integer, 255 represents that the size of each text is 255M, and the calculated integer value is the text ending sequence number value of the original data of the taken monitoring task;
and step 4, returning data by the sweep frequency basic data reading module in a sequential increasing mode, wherein the returned data comprises the following contents:
< monitor original document text URL1, access username, access password >, < monitor original document text URL2, access username, access password > … >.
Preferably, the sweep frequency basic data reading module supports continuous return of data flow in a Socket form, and the method comprises the following steps:
step 1, positioning and monitoring the file position of original data according to a file positioning algorithm;
step 2, invoking a frame decoding algorithm, carrying out frame decoding on the positioned original monitoring file, comparing the time in the frame with the inquiry starting time, if the time of the two minutes is equal, successfully positioning the data stream, and establishing a socket stream;
and step 3, returning the URL, the user name and the password corresponding to the socket stream by the sweep frequency basic data reading module.
After the technical scheme is adopted, the invention has the following advantages:
the invention utilizes a distributed storage system, a radio integrated platform and a structured database to develop and design a radio ultrashort wave frequency band monitoring sweep frequency basic data storage method, comprehensively realizes long-time effective storage of radio ultrashort wave monitoring sweep frequency basic data and accurate positioning reading of monitoring basic data, thereby forming a data asset foundation of full-province or ground city monitoring data, guiding a monitoring center to better manage and use ultrashort wave monitoring data results. The method solves the problems of effective storage and rapid extraction of mass sweep frequency monitoring data after networking monitoring.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples.
A data storage method for monitoring sweep frequency basic data in a radio ultrashort wave frequency band is based on a system for storing the sweep frequency basic data in the radio ultrashort wave frequency band.
As shown in fig. 1, the radio ultrashort wave frequency band monitoring sweep frequency basic data storage system comprises a sweep frequency data import module, a sweep frequency basic data storage module, a sweep frequency basic data configuration module and a sweep frequency basic data reading module.
The sweep frequency basic data importing module is used for importing networking sweep frequency data and drive test bin file data into a radio ultrashort wave monitoring sweep frequency basic data storage system, and the data are uploaded to a radio monitoring data platform through a data transmission tool and stored;
the frequency sweep basic data storage module comprises a normal frequency sweep basic data storage module and a compressed frequency sweep basic data storage module, wherein the normal frequency sweep monitoring data storage module is used for storing the latest uploaded monitoring data, and the compressed frequency sweep basic data storage module is used for storing long-time unused frequency sweep data;
the sweep frequency basic data configuration module is used for realizing the configuration management function of stored sweep frequency data, and comprises normal sweep frequency data management, compressed sweep frequency data management and data compression management;
the sweep frequency basic data reading module is used for realizing the rapid reading function of the original monitoring data, and comprises the reading of the original monitoring file and the reading of the basic monitoring data stream.
As shown in fig. 2, a method for storing frequency sweep basic data for monitoring a radio ultrashort wave frequency band includes the following steps:
step 1, uploading sweep frequency monitoring data of networking equipment to a radio monitoring data platform in real time or quasi-real time through a sweep frequency data importing module, and writing corresponding task related information into a sweep frequency basic data configuration module;
step 2, the sweep frequency basic data storage module is based on a radio monitoring data platform, and after receiving the uploaded sweep frequency data, the sweep frequency basic data storage module determines the number of backup data and the compression type of the data according to the data of the sweep frequency basic data configuration table to store the data;
step 3, the sweep frequency basic data configuration module stores, compresses and extracts various information of the recorded uploading basic monitoring data;
and 4, after the sweep frequency basic data reading module receives the requirement of external query data, determining the monitoring basic data through a positioning algorithm by querying corresponding table items in the sweep frequency basic data configuration module, and returning to related applications.
In the step 1, the networking monitoring platform uploads the data to the radio monitoring data platform through the data acquisition machine, and the data acquisition machine uploads the data to the radio monitoring data platform through relevant tools such as transmission software Flume and FTP.
In the step 2, the types of data stored in the sweep frequency basic data storage module include original monitoring sweep frequency basic data and compressed monitoring sweep frequency basic data, the monitoring basic data storage module compresses according to idle time of task data, the monitoring basic data storage module reads last editing time of tasks in a task information table in the monitoring configuration module, judges whether the time and the current time exceed one year, if so, the tasks are compressed, after the compression, the monitoring basic data only retain one data, and meanwhile, compressed marks are marked in task file processing fields.
The sweep frequency basic data storage module receives the sweep frequency basic original data and stores the sweep frequency basic original data to the radio data platform, the sweep frequency monitoring basic data is stored in the radio data platform according to the task dimension, and the sweep frequency basic data storage module also updates the data to a task information table stored in the sweep frequency data configuration module.
The fields in the save task information table are shown in table 1:
TABLE 1
Sequence number
|
Field name
|
Chinese description
|
Type(s)
|
1
|
ID
|
Sequence number
|
varchar(255)
|
2
|
TASKID
|
Task ID
|
varchar(64)
|
3
|
MFID
|
Facility ID
|
varchar(64)
|
4
|
EUQID
|
Device ID
|
varchar(64)
|
5
|
TASKTYPE
|
Task type
|
varchar(64)
|
6
|
APPID
|
Application type
|
varchar(64)
|
7
|
USERID
|
User ID
|
varchar(64)
|
8
|
STATUS
|
Task status
|
varchar(64)
|
9
|
FEATURE
|
Service code
|
int
|
10
|
FUNCTIONNAME
|
Function name
|
varchar(64)
|
11
|
STEP
|
Stepping
|
int
|
12
|
STARTFREQ
|
Start frequency
|
int
|
13
|
ENDFREQ
|
End frequency
|
int
|
14
|
CREATETIME
|
Task creation time
|
time
|
15
|
STARTTIME
|
Task start time
|
time
|
16
|
ENDTIME
|
Task end time
|
time
|
17
|
RUNSTARTTIME
|
Data start time
|
time
|
18
|
RUNENDTIME
|
Data end time
|
time
|
19
|
EDITTIME
|
Editing time
|
time
|
20
|
TASKNAME
|
Task name
|
varchar(64)
|
21
|
funparam
|
Functional parameters
|
varchar(64)
|
22
|
fummodule
|
Functional mode
|
varchar(64)
|
23
|
FILESIZE
|
File size
|
int
|
24
|
DEALSTATUS
|
File processing status
|
int
|
25
|
MONITORXMLIN
|
Managing XML input parameters
|
varchar(255)
|
26
|
MONITORXMLOUT
|
Managing XML output parameters
|
varchar(255)
|
27
|
taskfile_state
|
Task file type
|
varchar(10)
|
28
|
signal_extraction
|
Signal extraction
|
int |
The data updated by the sweep frequency basic data storage module is used for butting task information with the radio data platform, periodically inquiring the task ID of the uploaded data from the radio data platform and storing the corresponding information into a task information storage table; meanwhile, the sweep frequency basic data storage module automatically updates the saved task information table through the uploaded data, the sweep frequency basic data storage module compares the minimum time in each task text frame with the text starting time in the saved task information table, if the minimum time in each task text frame is smaller than the text starting time in the saved task information table, and meanwhile, compares the maximum time in each task text frame with the text ending time in the saved task information table, and if the maximum time in each task text frame is larger than the text ending time in the saved task information table, the sweep frequency basic data storage module updates; the text size of the corresponding task is updated every time the sweep frequency basic data storage module receives one text; and the sweep frequency basic data storage module selects and changes the number of backup parts of the stored original data through the backup parameters in the sweep frequency basic data configuration module.
In the step 3, the sweep frequency basic data configuration data stored by the sweep frequency basic data configuration module is stored in a data set form, and the data set comprises a corresponding storage task information table and a data backup configuration table.
The data backup configuration table includes fields as shown in table 2:
TABLE 2
Sequence number
|
Field name
|
Chinese description
|
Type(s)
|
1
|
ID
|
Sequence number
|
varchar(255)
|
2
|
MFID
|
Facility ID
|
varchar(64)
|
3
|
EUQID
|
Device ID
|
varchar(64)
|
4
|
BACKUP
|
Prepared parts
|
int |
In the step 4, the sweep frequency basic data reading module provides quick and accurate positioning return of the original monitoring sweep frequency file, and supports quick original monitoring file return and byte return of socket flow.
In the quick original monitoring file return, the sweep frequency basic data reading module returns the corresponding monitoring file according to the time or the time period of data extraction, monitoring equipment and monitoring tasks, and the query parameters are as follows: < query start time, query end time, task ID >.
After the sweep frequency basic data reading module receives the inquiry parameters, specific file reading data is positioned according to the starting time and the task ID, and the steps are as follows:
step 1, a sweep frequency basic data reading module inquires and stores a task information table according to a task ID, wherein inquired fields comprise the starting time of a task text, the ending time of the text, the size of monitoring task data and compression state parameters of the monitoring task; if the compression state parameter of the monitoring task is displayed to be compressed, the data extraction module decompresses the monitoring task and then continues to execute the step 1;
step 2, the sweep frequency basic data reading module compares and acquires the time difference delta T between the duration delta T of the monitoring task and the inquiry starting time and the text starting time, and the calculation method is as follows:
δT=T2-T1,δt=t1-T1;
wherein T2 represents the end time of the text of the monitoring task, T1 represents the start time of the text of the monitoring task, and T1 represents the start time of the query;
if δt is less than 0, the reading module provides the saved monitoring text with the monitoring original task data numbered 1 as a starting text, and if δt is greater than 0, the reading module obtains the starting text according to the following formula:
;
wherein M represents the data size of the whole monitoring task, floor represents the whole taking-down, 255 represents each text size of 255M, and the calculated integer value is the text initial sequence number value of the original data of the taken monitoring task;
step 3, the sweep frequency basic data reading module compares and acquires the time difference between the duration delta T of the monitoring task and the inquiry ending time and the text ending timet, the calculation method is as follows:
δT=T2-T1,t=T2-t2;
wherein T2 represents the end time of the text of the monitoring task, T1 represents the start time of the text of the monitoring task, and T2 represents the end time of the query;
if it ist is less than 0, the sweep frequency basic data reading module provides a stored monitoring text with the largest monitoring original task data label as an ending text; if->And t is greater than 0, acquiring an initial text by the sweep frequency basic data reading module according to the following formula:
;
wherein M represents the data size of the whole monitoring task, ceil represents the taking integer, 255 represents that the size of each text is 255M, and the calculated integer value is the text ending sequence number value of the original data of the taken monitoring task;
and step 4, returning data by the sweep frequency basic data reading module in a sequential increasing mode, wherein the returned data comprises the following contents:
< monitor original document text URL1, access username, access password >, < monitor original document text URL2, access username, access password > … >.
The sweep frequency basic data reading module supports continuous return of data flow in a Socket form, and the method comprises the following steps:
step 1, positioning and monitoring the file position of original data according to a file positioning algorithm;
step 2, invoking a frame decoding algorithm, carrying out frame decoding on the positioned original monitoring file, comparing the time in the frame with the inquiry starting time, if the time of the two minutes is equal, successfully positioning the data stream, and establishing a socket stream;
and step 3, returning the URL, the user name and the password corresponding to the socket stream by the sweep frequency basic data reading module.
The application method of the radio ultra-short wave frequency band monitoring sweep frequency basic data storage method comprises the following steps:
step 1, a sweep frequency data import module uses a data transmission tool to upload monitoring original data from a data of the block to a sweep frequency basic data storage module in a radio monitoring data platform in sequence from a collector;
step 2, after the sweep frequency basic data storage module receives the data again, inquiring task information related to the integrated management and control platform according to the task ID in the monitoring block file, if the task information does not exist in the sweep frequency basic data configuration module, writing all the information into a task information storage table, and adding the basic data storage module into fields which cannot be updated according to the uploaded file and the content of the file, wherein the fields comprise data start time, data end time, file size, file processing state, task file type and signal extraction fields; if the task information obtained after the inquiry is already in the task storage information table, only updating the data start time, the data end time, the file size, the file processing state, the task file type and the signal extraction field;
step 3, monitoring basic data is stored in a sweep frequency basic data storage module according to natural task blocks, and the sweep frequency basic data storage module is organized by adopting an HDFS file system which is easy to expand and suitable for mass data storage;
step 4, the sweep frequency basic data storage module periodically patrols each task, if the task does not generate any access record in the last year, the task is compressed, and after the data is compressed, the data is stored according to 1 storage block;
the monitoring basic data reading module realizes the function of rapidly providing detection original data for other modules and applications, and the working method is as follows:
step 1, a sweep frequency monitoring basic data reading module receives a data query request from an external application in the form of an interface, and the request information is as follows:
< task ID, query start time, query end time >;
step 2, the sweep frequency monitoring basic data reading module inquires task information corresponding to the task ID from the monitoring basic data configuration module according to the task ID, wherein the task information comprises the following information:
(data start time, data end time, monitor task size, file processing status);
the sweep monitoring basic data reading module judges file processing filling of a task, if the corresponding task is compressed, an instruction is sent out, and the compressed task in the sweep monitoring data storage module is automatically decompressed to a normal task state;
step 3, the sweep frequency monitoring basic data reading module calculates the position of a starting text according to the starting time of the query task, the starting time of the text and the current size of each monitoring block file, and splices the file name by using the task ID and the monitoring task type; the sweep frequency monitoring basic data reading module calculates the position of the ending text according to the ending time of the query task, the ending time of the text and the size of each current monitoring block file, and the total size of the monitoring task is utilized to calculate the last file returned by the splicing part of the task ID and the monitoring task type;
and 4, returning all files between the inquiry start file and the inquiry end file to the inquirer by the sweep monitoring basic data reading module in the following mode:
< task file 1, ULR1, username, password >, < task file 2, ULR, username, password > … < task file m, ULR, username, password >.
The method for storing the radio ultrashort wave frequency band monitoring sweep frequency basic data realizes effective storage of the original data which is met for 5 years after networking through national integrated platform equipment, and also has good system expansibility; meanwhile, when other external application systems or other industries need related data, the system can quickly position related data file blocks as required and provide the related data file blocks in sequence, so that the management and the use of the radio industry to the industrial data assets are greatly improved, and the system is an effective means for improving the work intellectualization, the datamation and the automation of the radio industry.
In addition to the above preferred embodiments, the present invention has other embodiments, and various changes and modifications may be made by those skilled in the art without departing from the spirit of the invention, which is defined in the appended claims.