CN117032726B - Method and system for drawing spectrogram in real time - Google Patents

Method and system for drawing spectrogram in real time Download PDF

Info

Publication number
CN117032726B
CN117032726B CN202311303334.1A CN202311303334A CN117032726B CN 117032726 B CN117032726 B CN 117032726B CN 202311303334 A CN202311303334 A CN 202311303334A CN 117032726 B CN117032726 B CN 117032726B
Authority
CN
China
Prior art keywords
field
string
processed
instruction
spectrum data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311303334.1A
Other languages
Chinese (zh)
Other versions
CN117032726A (en
Inventor
苏玉钊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Haige Shenzhou Communications Technology Co ltd
Original Assignee
Beijing Haige Shenzhou Communications Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Haige Shenzhou Communications Technology Co ltd filed Critical Beijing Haige Shenzhou Communications Technology Co ltd
Priority to CN202311303334.1A priority Critical patent/CN117032726B/en
Publication of CN117032726A publication Critical patent/CN117032726A/en
Application granted granted Critical
Publication of CN117032726B publication Critical patent/CN117032726B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Abstract

The invention discloses a method and a system for drawing a spectrogram in real time, and belongs to the technical field of data analysis. The method of the invention comprises the following steps: receiving JSON string instructions of spectrum data to be processed one by one in real time, disassembling the JSON string instructions one by one, and merging a plurality of fields of the JSON string instructions obtained by disassembling to obtain a merged string; determining a key value pair of the merging character string, and matching the merging character string with a preset rule to obtain a value of each piece of to-be-processed frequency spectrum data contained in the key value pair; and confirming whether the value of each piece of the to-be-processed spectrum data accords with a preset range, and if so, drawing a spectrogram according to the value of each piece of the to-be-processed spectrum data. According to the invention, the character string instructions are received one by one, and the character strings are disassembled one by one to obtain the disassembled data, so that the problems of large amount of received data, large occupied memory and low speed in the prior art are avoided.

Description

Method and system for drawing spectrogram in real time
Technical Field
The present invention relates to the field of data analysis technology, and more particularly, to a method and system for drawing a spectrogram in real time.
Background
Most of the current spectrogram drawing methods are signal data drawing under a single condition, cannot meet complex requirement environments, draw spectrograms only for a certain condition, and if a user needs to draw a plurality of pictures, additionally set parameters and regenerate the spectrograms. This is disadvantageous in that analysis and decision making is fast when analyzing a plurality of signals.
The existing spectrogram drawing technology cannot meet the requirement of rapid analysis, is not comprehensive in data processing and analysis, and cannot rapidly draw different graphs according to various requirements.
Disclosure of Invention
In view of the above problems, the present invention proposes a method for drawing a spectrogram in real time, including:
receiving JSON string instructions of spectrum data to be processed one by one in real time, disassembling the JSON string instructions one by one, and merging a plurality of fields of the JSON string instructions obtained by disassembling to obtain a merged string;
determining a key value pair of the merging character string, and matching the merging character string with a preset rule to obtain a value of each piece of to-be-processed frequency spectrum data contained in the key value pair;
and confirming whether the value of each piece of the to-be-processed spectrum data accords with a preset range, and if so, drawing a spectrogram according to the value of each piece of the to-be-processed spectrum data.
Optionally, the disassembling is performed on the JSON string instruction one by one in real time, and multiple fields of the JSON string instruction obtained by the disassembling are combined to obtain a combined string, which includes:
disassembling the JSON string instructions piece by using a specific regular expression, and replacing irrelevant information in the JSON string instructions with spaces to obtain a plurality of fields of the JSON string instructions; the plurality of fields includes: a first field, a second field, and a third field;
judging the content of the first field in the plurality of fields according to the instruction protocol of the JSON string instruction to determine the large category of the to-be-processed spectrum data corresponding to the JSON string instruction, judging the content of the second field in the plurality of fields after judging the content of the first field in the plurality of fields to determine the specific category of the to-be-processed spectrum data corresponding to the JSON string instruction, and merging the first field, the second field and the third field after judging the content of the second field in the plurality of fields to obtain a merged string;
the first field includes: large-class information of the to-be-processed spectrum data corresponding to the JSON string instruction;
the second field includes: specific category information of the spectrum data to be processed corresponding to the JSON string instruction;
the third field includes: and the corresponding numbers of the to-be-processed spectrum data corresponding to the JSON string instruction.
Optionally, the merging string is parsed based on c++ to obtain a key value pair of the JSON string instruction.
Optionally, the preset rule is a field matching rule;
the field matching rule includes: and (3) formulating various condition control sentences according to the actual analysis requirements of the to-be-processed spectrum data.
Optionally, the matching the merging string with a preset rule to obtain a value of each piece of to-be-processed spectrum data contained in the key value pair includes:
determining a control statement of a preset rule corresponding to the merging character string, and matching the first field, the second field and the third field of the merging character string with the control statement of the preset rule corresponding to the merging character string in sequence to obtain the value of each piece of to-be-processed spectrum data contained in the key value pair.
Optionally, after matching with the control sentences of the preset rules corresponding to the merging character strings respectively in sequence, returning receipt information;
the receipt information is information of a combination of the JSON string instruction and an instruction state;
an instruction state comprising: setting a success state and a failure state;
if the instruction state of the returned receipt information is the setting failure state, the corresponding error code is returned, and the spectrogram drawing of the piece of to-be-processed spectral data is terminated.
Optionally, the value of each piece of spectral data to be processed includes: a signal frequency value, a center frequency value and a bandwidth value of the spectral data to be processed.
Optionally, if the value of the to-be-processed spectrum data does not accord with the preset range, the spectrogram drawing of the to-be-processed spectrum data is terminated.
Optionally, a spectrogram is drawn according to the value of each piece of spectral data to be processed based on a pre-packaged function.
In still another aspect, the present invention further provides a system for drawing a spectrogram in real time, including:
the instruction receiving unit is used for receiving JSON string instructions of the spectrum data to be processed one by one in real time, disassembling the JSON string instructions one by one, and merging a plurality of fields of the JSON string instructions obtained by disassembling to obtain a merged string;
the matching unit is used for determining a key value pair of the merging character string and obtaining a value of each piece of to-be-processed spectrum data contained in the key value pair by matching the merging character string with a preset rule;
and the spectrogram drawing unit is used for confirming whether the value of each piece of to-be-processed spectrum data accords with a preset range, and if so, the spectrogram is drawn according to the value of each piece of to-be-processed spectrum data.
Compared with the prior art, the invention has the beneficial effects that:
the invention provides a method for drawing a spectrogram in real time, which comprises the following steps: receiving JSON string instructions of spectrum data to be processed one by one in real time, disassembling the JSON string instructions one by one, and merging a plurality of fields of the JSON string instructions obtained by disassembling to obtain a merged string; determining a key value pair of the merging character string, and matching the merging character string with a preset rule to obtain a value of each piece of to-be-processed frequency spectrum data contained in the key value pair; and confirming whether the value of each piece of the to-be-processed spectrum data accords with a preset range, and if so, drawing a spectrogram according to the value of each piece of the to-be-processed spectrum data. According to the invention, the character string instructions are received one by one, and the character strings are disassembled one by one to obtain the disassembled data, so that the problems of large amount of received data, large occupied memory and low speed in the prior art are avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly explain the drawings used in the embodiments of the present application, and it is obvious that the drawings described below are only specific embodiments of the present application, and that a person skilled in the art may obtain other embodiments according to the following drawings without inventive effort.
FIG. 1 is a flow chart showing the steps of embodiment 1 of the method of the present invention.
FIG. 2 is a flow chart showing the steps of embodiment 2 of the method of the present invention.
FIG. 3 is a schematic diagram of method embodiment 2 of the present invention.
Fig. 4 is a block diagram of embodiment 3 of the system of the present invention.
Fig. 5 is a block diagram of embodiment 4 of the system of the present invention.
Detailed Description
The exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, however, the present invention may be embodied in many different forms and is not limited to the examples described herein, which are provided to fully and completely disclose the present invention and fully convey the scope of the invention to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the accompanying drawings is not intended to be limiting of the invention. In the drawings, like elements/components are referred to by like reference numerals.
Unless otherwise indicated, terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. In addition, it will be understood that terms defined in commonly used dictionaries should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense.
Example 1:
the invention provides a method s100 for drawing a spectrogram in real time, as shown in fig. 1, comprising the following steps:
step 101, receiving JSON string instructions of spectrum data to be processed one by one in real time, disassembling the JSON string instructions one by one, and merging a plurality of fields of the JSON string instructions obtained by disassembling to obtain a merged string;
102, determining a key value pair of the merging character string, and matching the merging character string with a preset rule to obtain a value of each piece of to-be-processed spectrum data contained in the key value pair;
and step 103, confirming whether the value of each piece of to-be-processed spectrum data accords with a preset range, and if so, drawing a spectrogram according to the value of each piece of to-be-processed spectrum data.
The method for disassembling the JSON string instruction one by one in real time, and combining a plurality of fields of the JSON string instruction obtained by disassembling to obtain a combined string comprises the following steps:
disassembling the JSON string instructions piece by using a specific regular expression, and replacing irrelevant information in the JSON string instructions with spaces to obtain a plurality of fields of the JSON string instructions; the plurality of fields includes: a first field, a second field, and a third field;
judging the content of the first field in the plurality of fields according to the instruction protocol of the JSON string instruction to determine the large category of the to-be-processed spectrum data corresponding to the JSON string instruction, judging the content of the second field in the plurality of fields after judging the content of the first field in the plurality of fields to determine the specific category of the to-be-processed spectrum data corresponding to the JSON string instruction, and merging the first field, the second field and the third field after judging the content of the second field in the plurality of fields to obtain a merged string;
the first field includes: large-class information of the to-be-processed spectrum data corresponding to the JSON string instruction;
the second field includes: specific category information of the spectrum data to be processed corresponding to the JSON string instruction;
the third field includes: and the corresponding numbers of the to-be-processed spectrum data corresponding to the JSON string instruction.
And analyzing the merged character string based on C++ to acquire a key value pair of the JSON character string instruction.
The preset rule is a field matching rule;
the field matching rule includes: and (3) formulating various condition control sentences according to the actual analysis requirements of the to-be-processed spectrum data.
The matching of the merging character string with a preset rule to obtain the value of each piece of to-be-processed spectrum data contained in the key value pair comprises the following steps:
determining a control statement of a preset rule corresponding to the merging character string, and matching the first field, the second field and the third field of the merging character string with the control statement of the preset rule corresponding to the merging character string in sequence to obtain the value of each piece of to-be-processed spectrum data contained in the key value pair.
The control sentences are respectively matched with the control sentences of the preset rules corresponding to the merging character strings in sequence, and return receipt information;
the receipt information is information of a combination of the JSON string instruction and an instruction state;
an instruction state comprising: setting a success state and a failure state;
if the instruction state of the returned receipt information is the setting failure state, the corresponding error code is returned, and the spectrogram drawing of the piece of to-be-processed spectral data is terminated.
Wherein the value of each piece of spectral data to be processed comprises: a signal frequency value, a center frequency value and a bandwidth value of the spectral data to be processed.
If the value of the to-be-processed spectrum data does not accord with the preset range, the spectrogram drawing of the to-be-processed spectrum data is terminated.
And drawing a spectrogram according to the value of each piece of spectrum data to be processed based on the pre-packaged function.
Example 2:
the invention provides a method s200 for drawing a spectrogram in real time, as shown in fig. 2, comprising the following steps:
step 201, receiving JSON string instructions of spectrum data to be processed one by one in real time, disassembling the JSON string instructions one by one, and merging a plurality of fields of the JSON string instructions obtained by disassembling to obtain a merged string;
step 202, determining a key value pair of the merging character string, and matching the merging character string with a preset rule to obtain a value of each piece of to-be-processed spectrum data contained in the key value pair;
and 203, confirming whether the value of each piece of to-be-processed spectrum data accords with a preset range, and if so, drawing a spectrogram according to the value of each piece of to-be-processed spectrum data.
The principle of implementation of steps 201-203 is shown in fig. 3, which specifically includes:
firstly, receiving a plurality of command inputs in a JSON character string format, comparing and matching the obtained character string with a preset field, and analyzing data contained in the JSON key value pair.
The specific analysis process comprises the following steps: and (3) disassembling the JSON instruction by using a specific regular expression, replacing irrelevant information (such as brackets) in the instruction with spaces, acquiring a first field, judging the content of the first field (the major class to which the data belongs) according to an instruction protocol, judging a second field (the specific class to which the data belongs), and finally merging with a third field (the number corresponding to the data), namely the meaning represented by the JSON instruction.
The method is applied to the scene of instruction transmission between equipment and a terminal, and aims to control the terminal by transmitting a concise JSON instruction so as to achieve the purposes of convenience, rapidness and high efficiency in work;
the field matching rule in the method is a project document formulated according to actual needs, and control sentences under all conditions are written in the project document, for example: a transmission control statement (WBA: FREQ 300000) which is to match the WBA field, then to match the FREQ field, and finally to know the wideband frequency setting of 300000 according to the third field 300000; similarly, there are several entries (e.g., NBA: START 500000 is setting the narrowband initiation frequency to 500000). Whether instruction parsing is successful or not, a receipt message is returned to the device, the content of which is the original JSON instruction + state (e.g., WBA: FREQ 300000 SUCC indicates successful setting, WBA: FREQ 300000 RANGEERROR indicates a range exceeding the specified value setting failure).
The resolved data is, for example, 30MHz in signal frequency, 90MHz in center frequency, 200 in bandwidth, etc.
Analyzing whether the data setting of each signal is reasonable according to the signal as a limit includes judging whether the analyzed data is within a specified range, whether the analyzed data type is consistent with the specified range, and the like. If the analyzed data and the data types are inconsistent, the corresponding error code numbers are returned and fed back to the user. After the correct data information is obtained, the system calls the packaged drawing function to quickly draw the drawing.
In order to ensure quick receiving and analyzing of a large amount of data, the method uses streaming read data to sequentially analyze according to the sequence of receiving JSON data, rather than loading the whole JSON into a memory. This reduces memory usage and allows the system to process multiple JSON objects quickly and efficiently.
In the method, in order to improve the robustness and reliability of overall data analysis, rationality judgment is carried out on key data information of each signal after the data analysis, including judging whether the data accords with the data specification agreed by both transmitting and receiving parties, is in a specified data range, and can be effectively read. And whether the detection result meets the specification or not is stored in the analysis result, so that the user can conveniently check and analyze the data. Adding a SUCCESS word after the analysis result if the analyzed data accords with the specified range, and adding ERROR after the analysis result if the analyzed data does not accord with the specified range: outofarange typeface (examples of numerical out-of-range).
In the method, in order to improve the drawing efficiency, the drawing process is modularized, each drawing step is written into a plurality of functions, the functions are packaged, the quick, efficient and automatic drawing can be realized by calling the functions, drawing codes are not required to be written manually, only the data with the correct format is required to be provided, and the drawing process can be automatically completed by the system. This modular design eases the drawing task and provides good code reusability. Each drawing function is responsible for completing specific drawing tasks, such as drawing coordinate axes, adding labels and the like, the drawing steps can be flexibly combined by decomposing the drawing steps into independent functions, each part has a plurality of functions for selection by a user, for example, adding data labels on the coordinate axes, amplifying the right key frame selection range and the like, and all the functions can be selected and used according to the requirements of the user.
The method of the invention has the following advantages:
the invention solves the defects of the prior art that the signal analysis is not visual and rapid enough, and provides a method for analyzing a large amount of signal data;
the invention has the capability of receiving and analyzing a large amount of JSON data at the same time, and can efficiently process large-scale data streams through an optimized algorithm and resource management, thereby realizing rapid data analysis and processing;
the JSON data analysis method and the JSON data analysis device can analyze JSON data and analyze the analyzed data and judge whether the analyzed data accords with a specific standard or standard, and the data normalization analysis function can help a user to effectively verify the accuracy and the completeness of the data;
according to the invention, by adopting the modularized drawing tool, non-visual data such as data and the like can be displayed in a visual way, and the data understanding and decision making efficiency is improved.
Example 3:
the present invention also proposes a system 300 for drawing a spectrogram in real time, as shown in fig. 4, comprising:
the instruction receiving unit 301 is configured to receive JSON string instructions of the spectrum data to be processed in real time, disassemble the JSON string instructions one by one, and combine multiple fields of the JSON string instructions obtained by the disassembly to obtain a combined string;
a matching unit 302, configured to determine a key value pair of the merged string, and obtain a value of each piece of to-be-processed spectrum data included in the key value pair by matching the merged string with a preset rule;
and a spectrogram drawing unit 303, configured to confirm whether the value of each piece of to-be-processed spectrum data accords with the preset range, and if so, draw a spectrogram according to the value of each piece of to-be-processed spectrum data.
The method for disassembling the JSON string instruction one by one in real time, and combining a plurality of fields of the JSON string instruction obtained by disassembling to obtain a combined string comprises the following steps:
disassembling the JSON string instructions piece by using a specific regular expression, and replacing irrelevant information in the JSON string instructions with spaces to obtain a plurality of fields of the JSON string instructions; the plurality of fields includes: a first field, a second field, and a third field;
judging the content of the first field in the plurality of fields according to the instruction protocol of the JSON string instruction to determine the large category of the to-be-processed spectrum data corresponding to the JSON string instruction, judging the content of the second field in the plurality of fields after judging the content of the first field in the plurality of fields to determine the specific category of the to-be-processed spectrum data corresponding to the JSON string instruction, and merging the first field, the second field and the third field after judging the content of the second field in the plurality of fields to obtain a merged string;
the first field includes: large-class information of the to-be-processed spectrum data corresponding to the JSON string instruction;
the second field includes: specific category information of the spectrum data to be processed corresponding to the JSON string instruction;
the third field includes: and the corresponding numbers of the to-be-processed spectrum data corresponding to the JSON string instruction.
And analyzing the merged character string based on C++ to acquire a key value pair of the JSON character string instruction.
The preset rule is a field matching rule;
the field matching rule includes: and (3) formulating various condition control sentences according to the actual analysis requirements of the to-be-processed spectrum data.
The matching of the merging character string with a preset rule to obtain the value of each piece of to-be-processed spectrum data contained in the key value pair comprises the following steps:
determining a control statement of a preset rule corresponding to the merging character string, and matching the first field, the second field and the third field of the merging character string with the control statement of the preset rule corresponding to the merging character string in sequence to obtain the value of each piece of to-be-processed spectrum data contained in the key value pair.
The control sentences are respectively matched with the control sentences of the preset rules corresponding to the merging character strings in sequence, and return receipt information;
the receipt information is information of a combination of the JSON string instruction and an instruction state;
an instruction state comprising: setting a success state and a failure state;
if the instruction state of the returned receipt information is the setting failure state, the corresponding error code is returned, and the spectrogram drawing of the piece of to-be-processed spectral data is terminated.
Wherein the value of each piece of spectral data to be processed comprises: a signal frequency value, a center frequency value and a bandwidth value of the spectral data to be processed.
If the value of the to-be-processed spectrum data does not accord with the preset range, the spectrogram drawing of the to-be-processed spectrum data is terminated.
And drawing a spectrogram according to the value of each piece of spectrum data to be processed based on the pre-packaged function.
Example 4:
the present invention also proposes a system 400 for drawing a spectrogram in real time, as shown in fig. 5, including:
the instruction receiving unit 401 is configured to receive JSON string instructions of the spectrum data to be processed in real time, disassemble the JSON string instructions one by one, and combine multiple fields of the JSON string instructions obtained by the disassembly to obtain a combined string;
a matching unit 402, configured to determine a key value pair of the merged string, and obtain a value of each piece of to-be-processed spectrum data included in the key value pair by matching the merged string with a preset rule;
and a spectrogram drawing unit 403, configured to confirm whether the value of each piece of to-be-processed spectrum data accords with the preset range, and if so, draw a spectrogram according to the value of each piece of to-be-processed spectrum data.
Firstly, receiving a plurality of command inputs in a JSON character string format, comparing and matching the obtained character string with a preset field, and analyzing data contained in the JSON key value pair.
The specific analysis process comprises the following steps: and (3) disassembling the JSON instruction by using a specific regular expression, replacing irrelevant information (such as brackets) in the instruction with spaces, acquiring a first field, judging the content of the first field (the major class to which the data belongs) according to an instruction protocol, judging a second field (the specific class to which the data belongs), and finally merging with a third field (the number corresponding to the data), namely the meaning represented by the JSON instruction.
The system application scene is the instruction transmission between the equipment and the terminal, and aims to control the terminal by transmitting a concise JSON instruction so as to achieve the purposes of convenience, rapidness and high efficiency in work;
the field matching rule in the system is a project document formulated according to actual needs, and control sentences under all conditions are written in the project document, for example: a transmission control statement (WBA: FREQ 300000) which is to match the WBA field, then to match the FREQ field, and finally to know the wideband frequency setting of 300000 according to the third field 300000; similarly, there are several entries (e.g., NBA: START 500000 is setting the narrowband initiation frequency to 500000). Whether instruction parsing is successful or not, a receipt message is returned to the device, the content of which is the original JSON instruction + state (e.g., WBA: FREQ 300000 SUCC indicates successful setting, WBA: FREQ 300000 RANGEERROR indicates a range exceeding the specified value setting failure).
The resolved data is, for example, 30MHz in signal frequency, 90MHz in center frequency, 200 in bandwidth, etc.
Analyzing whether the data setting of each signal is reasonable according to the signal as a limit includes judging whether the analyzed data is within a specified range, whether the analyzed data type is consistent with the specified range, and the like. If the analyzed data and the data types are inconsistent, the corresponding error code numbers are returned and fed back to the user. After the correct data information is obtained, the system calls the packaged drawing function to quickly draw the drawing.
In order to ensure quick receiving and analyzing of a large amount of data, the system uses streaming read data to sequentially analyze according to the sequence of receiving JSON data, rather than loading the whole JSON into a memory. This reduces memory usage and allows the system to process multiple JSON objects quickly and efficiently.
In order to improve the robustness and reliability of overall data analysis, the system of the invention carries out rationality judgment on key data information of each signal after data analysis, including judging whether the data accords with the data specification agreed by both transmitting and receiving parties, is in a specified data range, and can be effectively read. And whether the detection result meets the specification or not is stored in the analysis result, so that the user can conveniently check and analyze the data. Adding a SUCCESS word after the analysis result if the analyzed data accords with the specified range, and adding ERROR after the analysis result if the analyzed data does not accord with the specified range: outofarange typeface (examples of numerical out-of-range).
In order to improve the drawing efficiency, the drawing process is modularized, each drawing step is written into a plurality of functions, the functions are packaged, quick, efficient and automatic drawing can be realized by calling the functions, drawing codes are not required to be written manually, only the data with the correct format is required to be provided, and the drawing process can be automatically completed by the system. This modular design eases the drawing task and provides good code reusability. Each drawing function is responsible for completing specific drawing tasks, such as drawing coordinate axes, adding labels and the like, the drawing steps can be flexibly combined by decomposing the drawing steps into independent functions, each part has a plurality of functions for selection by a user, for example, adding data labels on the coordinate axes, amplifying the right key frame selection range and the like, and all the functions can be selected and used according to the requirements of the user.
According to the invention, the character string instructions are received one by one, and the character strings are disassembled one by one to obtain the disassembled data, so that the problems of large amount of received data, large occupied memory and low speed in the prior art are avoided.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. The scheme in the embodiment of the invention can be realized by adopting various computer languages, such as object-oriented programming language Java, an transliteration script language JavaScript and the like.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (9)

1. A method for real-time rendering of a spectrogram, the method comprising the steps of:
receiving JSON string instructions of spectrum data to be processed one by one in real time, disassembling the JSON string instructions one by one, and merging a plurality of fields of the JSON string instructions obtained by disassembling to obtain a merged string;
determining a key value pair of the merging character string, and matching the merging character string with a preset rule to obtain a value of each piece of to-be-processed frequency spectrum data contained in the key value pair;
confirming whether the value of each piece of to-be-processed spectrum data accords with a preset range, if so, drawing a spectrogram according to the value of each piece of to-be-processed spectrum data;
the step of disassembling the JSON string instruction piece by piece and merging a plurality of fields of the JSON string instruction obtained by the disassembly to obtain a merged string, includes the following steps:
disassembling the JSON string instructions piece by using a specific regular expression, and replacing irrelevant information in the JSON string instructions with spaces to obtain a plurality of fields of the JSON string instructions; the plurality of fields includes: a first field, a second field, and a third field;
judging the content of the first field in the plurality of fields according to the instruction protocol of the JSON string instruction to determine the large category of the to-be-processed spectrum data corresponding to the JSON string instruction, judging the content of the second field in the plurality of fields after judging the content of the first field in the plurality of fields to determine the specific category of the to-be-processed spectrum data corresponding to the JSON string instruction, and merging the first field, the second field and the third field after judging the content of the second field in the plurality of fields to obtain a merged string;
the first field includes: large-class information of the to-be-processed spectrum data corresponding to the JSON string instruction;
the second field includes: specific category information of the spectrum data to be processed corresponding to the JSON string instruction;
the third field includes: and the corresponding numbers of the to-be-processed spectrum data corresponding to the JSON string instruction.
2. The method of claim 1, wherein the merged string is parsed based on c++ to obtain key value pairs for the JSON string instructions.
3. The method of claim 1, wherein the preset rule is a field matching rule;
the field matching rule includes: and (3) formulating various condition control sentences according to the actual analysis requirements of the to-be-processed spectrum data.
4. The method according to claim 1, wherein the matching the merging string with a preset rule to obtain the value of each piece of to-be-processed spectrum data contained in the key value pair includes:
determining a control statement of a preset rule corresponding to the merging character string, and matching the first field, the second field and the third field of the merging character string with the control statement of the preset rule corresponding to the merging character string in sequence to obtain the value of each piece of to-be-processed spectrum data contained in the key value pair.
5. The method of claim 4, wherein after matching the control sentences in the preset rules corresponding to the merged strings in order, return receipt information;
the receipt information is information of a combination of the JSON string instruction and an instruction state;
an instruction state comprising: setting a success state and a failure state;
if the instruction state of the returned receipt information is the setting failure state, the corresponding error code is returned, and the spectrogram drawing of the piece of to-be-processed spectral data is terminated.
6. The method of claim 1, the value of each piece of spectral data to be processed comprising: a signal frequency value, a center frequency value and a bandwidth value of the spectral data to be processed.
7. The method of claim 1, wherein if the value of the spectral data to be processed does not meet the predetermined range, terminating the spectral graph plotting of the piece of spectral data to be processed.
8. The method of claim 1, wherein a spectrogram is drawn from the values of each piece of spectral data to be processed based on a pre-packaged function.
9. A system for real-time mapping of a spectrogram, the system comprising:
the instruction receiving unit is used for receiving JSON string instructions of the spectrum data to be processed one by one in real time, disassembling the JSON string instructions one by one, and merging a plurality of fields of the JSON string instructions obtained by disassembling to obtain a merged string;
the matching unit is used for determining a key value pair of the merging character string and obtaining a value of each piece of to-be-processed spectrum data contained in the key value pair by matching the merging character string with a preset rule;
the spectrogram drawing unit is used for confirming whether the value of each piece of to-be-processed spectrum data accords with a preset range, and if so, the spectrogram is drawn according to the value of each piece of to-be-processed spectrum data;
the step of disassembling the JSON string instruction piece by piece and merging a plurality of fields of the JSON string instruction obtained by the disassembly to obtain a merged string, includes the following steps:
disassembling the JSON string instructions piece by using a specific regular expression, and replacing irrelevant information in the JSON string instructions with spaces to obtain a plurality of fields of the JSON string instructions; the plurality of fields includes: a first field, a second field, and a third field;
judging the content of the first field in the plurality of fields according to the instruction protocol of the JSON string instruction to determine the large category of the to-be-processed spectrum data corresponding to the JSON string instruction, judging the content of the second field in the plurality of fields after judging the content of the first field in the plurality of fields to determine the specific category of the to-be-processed spectrum data corresponding to the JSON string instruction, and merging the first field, the second field and the third field after judging the content of the second field in the plurality of fields to obtain a merged string;
the first field includes: large-class information of the to-be-processed spectrum data corresponding to the JSON string instruction;
the second field includes: specific category information of the spectrum data to be processed corresponding to the JSON string instruction;
the third field includes: and the corresponding numbers of the to-be-processed spectrum data corresponding to the JSON string instruction.
CN202311303334.1A 2023-10-10 2023-10-10 Method and system for drawing spectrogram in real time Active CN117032726B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311303334.1A CN117032726B (en) 2023-10-10 2023-10-10 Method and system for drawing spectrogram in real time

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311303334.1A CN117032726B (en) 2023-10-10 2023-10-10 Method and system for drawing spectrogram in real time

Publications (2)

Publication Number Publication Date
CN117032726A CN117032726A (en) 2023-11-10
CN117032726B true CN117032726B (en) 2023-12-22

Family

ID=88628574

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311303334.1A Active CN117032726B (en) 2023-10-10 2023-10-10 Method and system for drawing spectrogram in real time

Country Status (1)

Country Link
CN (1) CN117032726B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102707222A (en) * 2012-05-15 2012-10-03 中国电子科技集团公司第五十四研究所 Abnormal frequency point identification method based on character string comparison
CN106503070A (en) * 2016-09-30 2017-03-15 西安航天动力试验技术研究所 A kind of engine test data three-dimensional Waterfall plot method for reconstructing
CN109766100A (en) * 2018-12-11 2019-05-17 新华三技术有限公司合肥分公司 Data processing method and device
CN113722408A (en) * 2021-09-15 2021-11-30 王宇 Electromagnetic spectrum visualization processing method and device
CN114221663A (en) * 2021-12-07 2022-03-22 西华大学 Real-time spectrum data compression and recovery method based on character coding
CN115809391A (en) * 2022-12-28 2023-03-17 创远信科(上海)技术股份有限公司 Method, device, processor and computer-readable storage medium for realizing real-time display of multiple spectrum traces and frequency scales based on Web

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100774585B1 (en) * 2006-02-10 2007-11-09 삼성전자주식회사 Mehtod and apparatus for music retrieval using modulation spectrum
US9130778B2 (en) * 2012-01-25 2015-09-08 Bitdefender IPR Management Ltd. Systems and methods for spam detection using frequency spectra of character strings

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102707222A (en) * 2012-05-15 2012-10-03 中国电子科技集团公司第五十四研究所 Abnormal frequency point identification method based on character string comparison
CN106503070A (en) * 2016-09-30 2017-03-15 西安航天动力试验技术研究所 A kind of engine test data three-dimensional Waterfall plot method for reconstructing
CN109766100A (en) * 2018-12-11 2019-05-17 新华三技术有限公司合肥分公司 Data processing method and device
CN113722408A (en) * 2021-09-15 2021-11-30 王宇 Electromagnetic spectrum visualization processing method and device
CN114221663A (en) * 2021-12-07 2022-03-22 西华大学 Real-time spectrum data compression and recovery method based on character coding
CN115809391A (en) * 2022-12-28 2023-03-17 创远信科(上海)技术股份有限公司 Method, device, processor and computer-readable storage medium for realizing real-time display of multiple spectrum traces and frequency scales based on Web

Also Published As

Publication number Publication date
CN117032726A (en) 2023-11-10

Similar Documents

Publication Publication Date Title
CN111159049A (en) Automatic interface testing method and system
CN110427188B (en) Configuration method, device, equipment and storage medium of single-test assertion program
CN113434396A (en) Interface test method, device, equipment, storage medium and program product
CN110941553A (en) Code detection method, device, equipment and readable storage medium
CN111679979A (en) Destructive testing method and device
CN109976725B (en) Flow program development method and device based on lightweight flow engine
CN112181749A (en) Hardware testing method and device, electronic equipment and storage medium
CN117032726B (en) Method and system for drawing spectrogram in real time
CN111221727A (en) Test method, test device, electronic equipment and computer readable medium
CN111427784B (en) Data acquisition method, device, equipment and storage medium
CN116346961B (en) Financial message processing method and device, electronic equipment and storage medium
CN113254350A (en) Flink operation testing method, device, equipment and storage medium
CN109800330B (en) Data processing method and device
CN116431517A (en) Intelligent keyword prompting method and device for automatic test platform
CN111679832B (en) Tool assembly integration method and device based on DevOps platform
CN114416597A (en) Test case record generation method and device
CN111209134B (en) Fault analysis method, device, storage medium and equipment based on log information
CN113806231A (en) Code coverage rate analysis method, device, equipment and medium
CN114244726A (en) Visualization method and device for signaling interaction of 5G NR base station
CN115114136A (en) Test data generation method and device, electronic equipment and program product
CN113645052A (en) Firmware debugging method and related equipment
CN106789260B (en) System and method for high availability drilling of network devices
CN111061636B (en) Automatic software testing method and device, computer equipment and storage medium
CN110716855B (en) Processor instruction set testing method and device
CN112181912B (en) Method, device, equipment and storage medium for determining file format

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant