BUFR data processing method, device and equipment based on template recognition
The BUFR data processing method based on template recognition solves the problems of inconsistent template processing and lack of automatic recognition in BUFR data decoding, achieves correct decoding of BUFR data and timely discovery of new templates, and improves the integrity and efficiency of data processing. .
Patent Information
- Application Number
- CN202411092524.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-09
AI Technical Summary
The lack of a unified template processing design in BUFR data decoding results in frequent decoding errors, and the lack of an automatic identification mechanism prevents new template data from being discovered in time.
Using the BUFR data processing method based on template recognition, by parsing the data identification segment and data description segment, extracting the main table version number and descriptor sequence, using the code table dynamic management and directory tree to achieve template information matching, automatically identify and decode or store new Template data.
It achieves the timely identification and correct decoding of BUFR data, improves the accuracy of element decoding, and ensures the integrity of data processing and the timely discovery of new templates.
Smart Images

Figure CN118626879B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of meteorological information processing, and in particular to a BUFR data processing method, device and equipment based on template recognition. Background Art
[0002] The coding formats of global observation data collected through GTS (Global Telecommunication System) mainly include TAC (Traditional Alphanumeric Codes, character code) and BUFR (Binary Universal Form for the Representation of meteorological data, a binary format for encoding meteorological data). Due to the World Meteorological Organization's table-driven code migration plan, more and more observation data formats have changed from TAC to BUFR. At the same time, many new types of data are also accessed in BUFR format. According to statistics, the number of observation data compiled and reported in BUFR format accounts for more than 85% of all observation data.
[0003] BUFR has strong representation capabilities. Compared with traditional character encoding methods, it has significant advantages in transmission and encoding and decoding. It has the characteristics of self-description, table-driven, extensible, compressible, and platform-independent. It is precisely because of the flexible format and easy extensibility of BUFR data itself, including multiple templates, complex templates, and diverse element editing methods, that it brings certain challenges to the decoding work, including: (1) There are many types of templates. The same type of data can use different templates. Different sites of the same reporting center may use different templates, and different reporting center sites may use the same template; (2) Template variability. The template of the same type of data will continue to change with business development; (3) Inconsistent reporting versions. Different sites use different master table version numbers; (4) The same element has different editing methods. For example, in different templates, the sampling height can be reported using four element descriptors: 0 07 002, 0 07 006, 0 07 007, and 0 07 009, and the quality control information can be reported using two methods: 0 33 002 and 0 31 021.
[0004] It can be seen that the current problems faced by BUFR decoding work are: there is no unified design for the processing of BUFR templates, which easily leads to decoding errors; there is a lack of automatic recognition mechanism for new templates, and many new template data cannot be discovered in time. Template changes can be learned by manually consulting WMO (World Meteorological Organization) briefings, coding manuals or relevant websites of the compilation center, but the decoding program cannot automatically perceive them. Summary of the invention
[0005] The present application provides a BUFR data processing method, device and equipment based on template recognition, which can realize the timely discovery of new template data, establish a corresponding relationship based on the template, effectively solve the problem of decoding misalignment, and significantly improve the decoding accuracy of the elements.
[0006] In a first aspect, an embodiment of the present application provides a BUFR data processing method based on template recognition, and the BUFR data processing method based on template recognition includes:
[0007] Parse the target BUFR data and extract the master table version number in the data identification segment and the descriptor sequence in the data description segment;
[0008] Expand the target BUFR data according to the code table and the extracted main table version number and descriptor sequence to obtain the template information of the target BUFR data;
[0009] The obtained template information is matched with a known template of BUFR data, and based on the matching result, the target BUFR data is decoded or the template information of the target BUFR data is stored in the known template.
[0010] In combination with the first aspect, in one implementation,
[0011] The code table includes three types: WMO code table, local custom code table and custom code table of other reporting centers, and the dynamic management of the code table is realized based on the directory tree;
[0012] The WMO code table, local custom code table and custom code table of other reporting centers are stored in independent directories respectively, and subdirectories named with version numbers are established under the directories of code tables of different categories. For code tables of the same category, code tables with different versions are stored in subdirectories corresponding to the current category code table directory, and code tables with common or non-conflicting versions are stored in a public directory established under the current category code table directory.
[0013] In combination with the first aspect, in one implementation, when a new version of a code table is released, the new version of the code table is stored in a corresponding directory based on the category, version number and content of the new version of the code table, thereby realizing dynamic changes in the content of the directory tree.
[0014] In combination with the first aspect, in one implementation, the target BUFR data is expanded according to the code table and the extracted main table version number and descriptor sequence to obtain the template information of the target BUFR data, specifically including:
[0015] According to the main table version number in the data identification segment of the target BUFR data, query the directory tree to obtain the code table of the corresponding version number;
[0016] According to the acquired code table and the extracted descriptor sequence, the target BUFR data is expanded to obtain the element descriptor and template information of the target BUFR data.
[0017] In combination with the first aspect, in one implementation, matching the obtained template information with a known template of BUFR data, decoding the target BUFR data based on the matching result or storing the template information of the target BUFR data in the known template specifically includes:
[0018] The template information of the obtained target BUFR data is matched with the known template of BUFR data, and based on the matching result:
[0019] If the match is successful, the target BUFR data is decoded;
[0020] If the match fails, the template information of the target BUFR data is stored in the report table, an alarm message is sent to the integrated monitoring system, and the template information of the target BUFR data is stored in the known template.
[0021] In combination with the first aspect, in one implementation, decoding the target BUFR data specifically includes:
[0022] Perform format check and element analysis on the target BUFR data to determine whether it can be decoded normally:
[0023] If not, the reason why the decoding failed is recorded;
[0024] If so, the decoded result set is output, and the data in the decoded result set is processed based on SQL splicing, and the processed data is stored in the database.
[0025] In combination with the first aspect, in one implementation, the target BUFR data is format checked and element parsed, wherein the specific steps of format checking include:
[0026] According to the starting mark and the length of the indicated segment of the target BUFR data, locate to the identification segment;
[0027] Read the first set number of octets of the identification segment, obtain the length of the identification segment, and locate the data description segment according to the identification segment header and the identification segment length;
[0028] Read the first set number of octets of the data description segment, obtain the length of the data description segment, and locate the data segment according to the data description segment header and the data description segment length;
[0029] Read the first set number of octets of the data segment, obtain the data segment length, and compare the obtained data segment length with the actual reported data segment length:
[0030] If they are not equal, it means the format check fails;
[0031] If they are equal, then determine whether the end segment is a set character based on the starting position of the end segment of the target BUFR data. If not, it means that the format check fails. If so, it means that the format check passes.
[0032] In combination with the first aspect, in one implementation,
[0033] The target BUFR data is format checked and parsed for elements, wherein the element parsing of the target BUFR data is performed according to the XML configuration;
[0034] The XML configuration includes the mapping relationship between the element descriptor of BUFR data and the fields in the relational storage structure, the processing method of regular repetition and delayed repetition, and the unit conversion method.
[0035] In a second aspect, an embodiment of the present application provides a BUFR data processing device based on template recognition, and the BUFR data processing device based on template recognition includes:
[0036] A parsing module, which is used to parse the target BUFR data and extract the main table version number in the data identification segment and the descriptor sequence in the data description segment;
[0037] An acquisition module, which is used to expand the target BUFR data according to the code table and the extracted main table version number and descriptor sequence to obtain template information of the target BUFR data;
[0038] A matching module is used to match the obtained template information with a known template of BUFR data, and decode the target BUFR data based on the matching result or store the template information of the target BUFR data into the known template.
[0039] In a third aspect, an embodiment of the present application provides a BUFR data processing device based on template recognition, wherein the BUFR data processing device based on template recognition comprises a processor, a memory, and a BUFR data processing program based on template recognition stored in the memory and executable by the processor, wherein when the BUFR data processing program based on template recognition is executed by the processor, the steps of the BUFR data processing method based on template recognition described above are implemented.
[0040] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:
[0041] By constructing a BUFR data processing framework based on template recognition, the entire decoding process forms a closed loop, so that both known templates and new templates can be effectively identified, ensuring the integrity of data processing. By linking with relevant comprehensive monitoring systems, new template data can be discovered in a timely manner, and the discovery time of new templates has been reduced from several months to seconds. Establishing corresponding relationships based on templates effectively solves the problem of decoding misalignment, and the decoding accuracy of elements is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 This is a flow chart of the BUFR data processing method based on template recognition in this application;
[0043] Figure 2 Schematic diagram for format check;
[0044] Figure 3 This is a functional module diagram of a BUFR data processing device based on template recognition in this application;
[0045] Figure 4 This is a schematic diagram of the hardware structure of the BUFR data processing device based on template recognition in this application. DETAILED DESCRIPTION
[0046] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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.
[0047] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0048] On the first aspect, the embodiment of the present application provides a BUFR data processing method based on template recognition, which introduces template recognition into the BUFR data decoding process, effectively solves the problem of element misalignment in the BUFR decoding process, and at the same time, adds a new template automatic recognition mechanism to ensure that new template data can be discovered and processed in a timely manner, so as to provide more complete and efficient global observation data for forecasting and public services.
[0049] In one embodiment, referring to Figure 1 , Figure 1 FIG. 1 is a flow chart of the BUFR data processing method based on template recognition in this application. Figure 1 As shown, the BUFR data processing method based on template recognition includes:
[0050] S1: Parse the target BUFR data and extract the master table version number in the data identification segment and the descriptor sequence in the data description segment;
[0051] That is, when the target BUFR data (i.e., the BUFR data to be decoded) is to be decoded, the code table information and the known template information of the BUFR data are first loaded into the memory. Before starting the decoding operation of the target BUFR data, the main table version number in the data identification segment of the target BUFR data and the descriptor sequence in the data description segment are parsed and extracted, so as to facilitate the subsequent acquisition of the template information of the target BUFR data based on the code table.
[0052] The construction process of the known template information is as follows: according to the category of BUFR data, statistical analysis is performed on the template information of each category of BUFR data to form the initial known template information.
[0053] Taking the global ocean data as an example, the initial known template information obtained based on various BUFR data is as follows:
[0054] [C.0001.0014.R001]
[0055] 0-1-79,0-1-11,0-1-103,0-1-87,0-1-19,0-1-80,0-5-36,0-1-36,0-1-13,0-1-12,0-4-1,0-4-2,0-4-3,0-4-4,0-4-5,0-5-1,0-6-1,0-7-32,0-7-33,0-2-2,0-11-2,0-11-1,0-7-32,0-7-33,0-12-101,0-12-103,0-7-32,0-7-33,0-22-1,0-22-11,0-22-21,0-2-31,0-2-3 0,0-22-5,0-22-32,0-22-63,0-8-80,0-33-50,0-22-178,0-22-177,0-22-67,0-8-41,0-26-21,0-26-22,0-26-23,0-22-68,0-25-61,0-8-41,0-8-80,0-2-171,0-2-38,0-7-63,0-22-45,0-2-171,0-2-32,1-6-0,0-31-2,0-7-63,0-8-80,0-33-50,0-22-43,0-8-80,0-33-50
[0056] 0-1-11,0-1-12,0-1-13,0-1-19,0-1-103,0-1-87,0-1-36,0-1-115,0-1-80,0-5-36,0-4-1,0-4-2,0-4-3,0-4-4,0-4-5,0-5-1,0-6-1,0-1-79,0-1-23,0-22-63,1-1-0,0-31-0,0-10-4,0-10-51,0-10-61,0-10-63,1-1-0,0-31-0,0-22-1,0-22-11,0-22-21,1-1-0,0-31-0,0-7-32,0-7-33,0-12-101,0-2-39,0-12-102,0-12-103,0-13-3,1-1-0,0-31-0,0-7-32,0-7-33,0-2-2,0-8-21,0-4-25,0-11-1,0-11-2,0-8-21,1-3-2,0-4-25,0-11-43,0-11-41,0-22-67,0-2-171,0-2-38,0-7-63,0-22-45,0-2-33,0-7-63,0-22-64,0-2-31,0-3-10,0-2-40,0-22-5,0-22-32,0-2-171,0-22-67,0-2-38,0-22-67,0-22-68,0-2-171,0-2-33,0-2-32,0-22-56,0-3-11,1-12-0,0-31-2,0-7-62,0-8-80,0-33-50,0-7-65,0-8-80,0-33-50,0-22-43,0-8-80,0-33-50,0-22-64,0-8-80,0-33-50,1-7-0,0-31-0,0-2-32,0-3-10,0-2-31,0-2-40,0-22-56,0-3-11,1-12-0,0-31-2,0-7-62,0-8-80,0-33-50,0-7-65,0-8-80,0-33-50,0-22-31,0-8-80,0-33-50,0-22-4,0-8-80,0-33-50,1-4-0,0-31-0,0-2-32,0-3-12,0-3-11,1-9-0,0-31-2,0-7-62,0-8-80,0-33-50,0-7-65,0-8-80,0-33-50,0-22-188,0-8-80,0-33-50。
[0057] S2: Expand the target BUFR data according to the code table and the extracted main table version number and descriptor sequence to obtain template information of the target BUFR data;
[0058] For BUFR data, BUFR data is a set of data driven by tables, and the code table is the basis for BUFR data encoding and decoding. The contents of the code table of BUFR data include: data classification table, descriptor table, code table, flag table and feature descriptor sequence. The code table is uniformly defined and managed by WMO. At the same time, each reporting center can also meet the needs of local data representation by defining local tables. With the development of meteorological services, the categories and attributes of meteorological observation data are changing, the reporting templates are changing, and the code table of BUFR data is also changing dynamically. The version number is an important attribute of the code table. Data encoded in BUFR has version number information in the data file, so the code table with the same version number must be used to match the correct feature descriptor and template information.
[0059] In this application, the dynamic management of code tables is implemented based on the directory tree, so as to solve the problem of correctly processing different versions of data in the same decoding framework. As for the types of code tables, they include three types: WMO code tables, local custom code tables, and custom code tables of other reporting centers. Therefore, in this application, the WMO code tables, local custom code tables, and custom code tables of other reporting centers are stored in independent directories, and subdirectories named with version numbers are established under the directories of different categories of code tables. For code tables of the same category, code tables with different versions are stored in the subdirectories corresponding to the current category code table directory, and code tables that are common or non-conflicting in various versions are stored in the public directory established under the current category code table directory.
[0060] For example, for the WMO code table, it corresponds to an independent directory, and a public directory and multiple sub-directories named with version numbers are created under the directory. For code tables belonging to the WMO code table category, if there is a difference between the current code table and other versions of code tables, the current code table is stored in the corresponding sub-directory based on the version number of the current code table. If the current code table is the same as other versions of code tables or there is no conflict between the current code table and other versions of code tables, the current code table is stored in the public directory.
[0061] Furthermore, when a new version of the code table is released, the newly released code table is stored in the corresponding directory based on the category, version number and content of the newly released code table, so as to realize the dynamic change of the directory tree content. Therefore, in the process of decoding BUFR data, according to the version information of the data identification segment, the corresponding code table can be navigated to realize normal decoding.
[0062] Further, in one embodiment, the target BUFR data is expanded according to the code table and the extracted main table version number and descriptor sequence to obtain the template information of the target BUFR data, specifically including:
[0063] S201: According to the main table version number in the data identification segment of the target BUFR data, query the directory tree to obtain the code table of the corresponding version number;
[0064] S202: Expand the target BUFR data according to the acquired code table and the extracted descriptor sequence to obtain the element descriptor and template information of the target BUFR data.
[0065] S3: Match the obtained template information with the known template of BUFR data, and decode the target BUFR data based on the matching result or store the template information of the target BUFR data into the known template.
[0066] It should be noted that the template in BUFR data consists of a set of element descriptors, repetition descriptors and operation descriptors, which are used to define the content, format and order of the data elements contained in the data. The template is obtained by expanding the descriptor sequence in the data description segment according to the code table.
[0067] Further, in one embodiment, matching the obtained template information with a known template of BUFR data, decoding the target BUFR data based on the matching result or storing the template information of the target BUFR data in the known template specifically includes:
[0068] The template information of the obtained target BUFR data is matched with the known template of BUFR data, and based on the matching result:
[0069] If the match is successful, the target BUFR data is decoded;
[0070] If the match fails, the template information of the target BUFR data is stored in the report table, an alarm message is sent to the integrated monitoring system, and the template information of the target BUFR data is stored in the known template.
[0071] Specifically, when performing a matching operation, if the template information of the target BUFR data exists in the known template, it indicates that the match is successful (that is, if the template information of the object to be matched is completely consistent with the template information of one of the known templates, it indicates that the match is successful). If the template information of the target BUFR data does not exist in the known template, it indicates that the match fails. The template information of the target BUFR data is a newly added template, then the template information of the target BUFR data is extracted and stored in the report table, and an alarm message is sent to the integrated monitoring system to analyze the template information of the target BUFR data, and then the template information of the target BUFR data is stored in the known template. When the target BUFR data subsequently matches the template information again, the match can be successful.
[0072] Furthermore, when performing template matching, a HashMap method may be used to improve matching efficiency.
[0073] Furthermore, in one embodiment, decoding the target BUFR data specifically includes:
[0074] Perform format check and element analysis on the target BUFR data to determine whether it can be decoded normally:
[0075] If not, the reason why the decoding failed is recorded;
[0076] If so, the decoded result set is output, and the data in the decoded result set is processed based on SQL (Structured Query Language) splicing, and the processed data is stored in the database.
[0077] Specifically, the template information of the target BUFR data is matched with the known template of the BUFR data. When the match is successful, the target BUFR data is format checked and element parsed. If it can be decoded normally, the decoded result set is output and the data storage link is entered. After the decoded result set is subjected to SQL splicing and other storage processing operations, the data is stored in the database; if it cannot be decoded normally, the reason for the decoding failure is recorded.
[0078] It should be noted that since BUFR data is binary coded, it has the characteristics of self-descriptive, table-driven, scalable, and flexible. Before data processing, the format check of BUFR data using the metadata information carried by BUFR itself can effectively ensure the correctness of data decoding. Therefore, in this application, the target BUFR data is format checked and element parsed, among which, see Figure 2 As shown, the specific steps of format checking include:
[0079] S301: Positioning to the identification segment according to the start mark and the indication segment length of the target BUFR data;
[0080] The length of the indicator segment is fixed at 8, and it starts with the four characters "BUFR" encoded by CCITT IA5. The identification segment is located according to the indicator segment header, that is, the start mark of the BUFR data and the indicator segment length;
[0081] S302: Read the first set number of octets of the identification segment, obtain the length of the identification segment, and locate the data description segment according to the identification segment header and the identification segment length;
[0082] Specifically, the length of the identification segment can be obtained by reading the first three octets of the identification segment;
[0083] S303: Read the first set number of octets of the data description segment, obtain the length of the data description segment, and locate the data segment according to the header of the data description segment and the length of the data description segment;
[0084] Specifically, the length of the data description segment can be obtained by reading the first three octets of the data description segment;
[0085] S304: Read the first set number of octets of the data segment to obtain the length of the data segment (specifically, read the first 3 octets of the data segment to obtain the length of the data segment), and compare the obtained length of the data segment with the actual length of the reported data segment:
[0086] If they are not equal, it means the format check fails;
[0087] If they are equal, then determine whether the end segment is a set character based on the starting position of the end segment of the target BUFR data. If not, it means that the format check fails. If so, it means that the format check passes.
[0088] In actual applications, the set characters are 4 characters "7" encoded using CCITT IA5.
[0089] It should be noted that the core of BUFR data decoding is to parse the meteorological elements represented by flexible data encoding templates and map them with fields in a relatively stable relational storage structure. Since the extensible markup language (XML) is simple in describing data and has the characteristics of flexibility and scalability, the XML format is used to match the template and storage structure of BUFR data. That is, in this application, the target BUFR data is format checked and element parsed, wherein the element parsing of the target BUFR data is performed according to the XML configuration; the XML configuration includes the mapping relationship between the element descriptor of the BUFR data and the fields in the relational storage structure, the processing method of regular repetition and delayed repetition, and the unit conversion method. Regular repetition refers to non-delayed repetition.
[0090] For XML configuration, the template of BUFR data can be parsed. XML configuration not only designs the mapping relationship between BUFR element descriptors and storage fields, but also designs the processing of general duplication and delayed duplication, and unit conversion. By abstracting the specific processing logic into configuration, the core problem of BUFR data decoding is solved, and the simplicity and agility of the decoding program are improved.
[0091] General repetition (conventional repetition) refers to repetition with a fixed number of repetitions, for example, 1 XY (Y is not equal to 0), which means that in each data subset, X elements are repeated Y times; delayed repetition refers to repetition with a non-fixed number of repetitions. For example, for sounding observations, the level of each observation is different, so delayed repetition 1 X 0 can be used. The specific number of repetitions is expressed by the delay descriptor repetition factor when the observation data is actually compiled.
[0092] An example of the mapping relationship between the element descriptor of BUFR data and the fields in the relational storage structure is shown in the following example:
[0093] <colunm datatype="double" dec="纬度" name="Latitude" fxy="0-5-1-0" default="999999"> V05001< / colunm>
[0094] <colunm datatype="double" dec="经度" name="Longitude" fxy="0-6-1-0" default="999999"> V06001< / colunm>
[0095] <colunm datatype="double" dec="测站高度" name="Height Of Station" fxy="0-7-1-0" default="999999"> V07001< / colunm>
[0096] <colunm datatype="int" dec="探测设备类型" name="Measuring EquipmentTYPE" fxy="0-2-3-0" default="999999"> V02003< / colunm> ;
[0097] Among them, the station height is compiled with feature descriptor 0 07 001, and the decoded and stored field is V07001. The default value is 999999, indicating that the measurement is missing.
[0098] The following are examples of how to handle regular repetitions and delayed repetitions:
[0099] <group fxy="1-4-0-0" name="Model1" dec="模板1" delay="4">
[0100] <colunm fxy="0-7-7-0" name="Altitude" dec="采样海拔高度" datatype="double" default="999999"> V07007< / colunm>
[0101] <colunm fxy="0-11-1-0" name="Wind Direction" dec="水平风向" datatype="double" default="999999"> V11001< / colunm>
[0102] <colunm fxy="0-11-2-0" name="Wind Speed" dec="水平风速" datatype="double" default="999999"> V11002< / colunm>
[0103] <colunm fxy="0-33-2-0" name="Horizontal Wind Direction Info" dec="水平风向质量信息" datatype="int" default="9"> OQ11001< / colunm>
[0104] <colunm fxy="0-33-2-0" name="Horizontal Wind Speed Info" dec="水平风速质量信息" datatype="int" default="9"> OQ11002< / colunm>
[0105] < / group> ;
[0106] The group element is used to configure general repetition and delayed repetition. Delay represents the number of repeated element descriptors in the template. The corresponding element descriptors and storage fields are configured in the group. For example, the value of 0-33-2 is stored in the OQ11001 and OQ11001 fields in the data table.
[0107] An example of unit conversion is shown below:
[0108] <colunm fxy="0-12-7-0" name="Virtual Temperature" dec="虚温" datatype="double" default="999999" expression="${{0}-273.15}"> V12007< / colunm>
[0109] <colunm fxy="0-2-121-0" name="Frequency" dec="设备频率" datatype="double" default="999999" expression="${{0} / 1000000}"> V02121< / colunm> ;
[0110] Among them, the virtual temperature is compiled using the element descriptor 0-12-7. In the WMO code table, the unit of this element descriptor is Kelvin, and the unit for practical applications is Celsius. Unit conversion is required, and the conversion rule is: Celsius = Kelvin-273.15.
[0111] This application uses the template of BUFR data as the granularity of decoding processing, parses the elements of the BUFR data matched by template according to the XML configuration, and stores it in the database to ensure the correctness of the decoding processing of different template data, and issues an alarm for data that does not pass the template matching, ensuring that new template data can be discovered and processed in a timely manner, thereby ensuring the integrity of data processing.
[0112] In the actual application process, the BUFR data processing method based on template recognition of the present application can be deployed on a meteorological big data cloud platform. The program executing the method can be deployed on a single or multiple server nodes, and by receiving and parsing the file arrival message sent by the communication system, the relevant files are read and processed in the corresponding directory according to the data encoding, and the parsed elements are put into the buffer library, and the analysis library and service library are synchronized through the synchronization technology between databases to provide services to users.
[0113] In a second aspect, an embodiment of the present application also provides a BUFR data processing device based on template recognition.
[0114] In one embodiment, referring to Figure 3 , Figure 3 Schematic diagram of the functional modules of the BUFR data processing device based on template recognition in this application. Figure 3 As shown, the BUFR data processing device based on template recognition includes: a parsing module, an acquisition module, and a matching module.
[0115] The parsing module is used to parse the target BUFR data, extract the main table version number in the data identification segment and the descriptor sequence in the data description segment; the acquisition module is used to expand the target BUFR data according to the code table and the extracted main table version number and descriptor sequence, and obtain the template information of the target BUFR data; the matching module is used to match the obtained template information with the known template of the BUFR data, and decode the target BUFR data based on the matching result or store the template information of the target BUFR data into the known template.
[0116] In a third aspect, an embodiment of the present application provides a BUFR data processing device based on template recognition. The BUFR data processing device based on template recognition may be a device having data processing functions, such as a personal computer (PC), a laptop computer, or a server.
[0117] Reference Figure 4 , Figure 4 The hardware structure diagram of the BUFR data processing device based on template recognition involved in the embodiment of the present application is shown in FIG. In the embodiment of the present application, the BUFR data processing device based on template recognition may include a processor, a memory, a communication interface and a communication bus.
[0118] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0119] The communication interface includes input / output (I / O) interface, physical interface and logical interface, etc., which are used to realize the interconnection of devices inside the BUFR data processing device based on template recognition, and the interface used to realize the interconnection between the BUFR data processing device based on template recognition and other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, an optical fiber interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.
[0120] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0121] The processor may be a general-purpose processor, which may call the BUFR data processing program based on template recognition stored in the memory and execute the BUFR data processing method based on template recognition provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the BUFR data processing program based on template recognition is called may refer to the various embodiments of the BUFR data processing method based on template recognition of the present application, which will not be described in detail here.
[0122] Those skilled in the art will understand that Figure 4 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0123] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0124] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0125] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0126] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0127] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.
[0128] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A BUFR data processing method based on template recognition, characterized in that: The BUFR data processing method based on template recognition includes: Parse the target BUFR data and extract the master table version number in the data identification segment and the descriptor sequence in the data description segment; Expand the target BUFR data according to the code table and the extracted main table version number and descriptor sequence to obtain the template information of the target BUFR data; The obtained template information is matched with a known template of BUFR data, and based on the matching result, the target BUFR data is decoded or the template information of the target BUFR data is stored in the known template.
2. A BUFR data processing method based on template recognition as claimed in claim 1, characterized in that: The code table includes three types: WMO code table, local custom code table and custom code table of other reporting centers, and the dynamic management of the code table is realized based on the directory tree; The WMO code table, local custom code table and custom code table of other reporting centers are stored in independent directories respectively, and subdirectories named with version numbers are established under the directories of code tables of different categories. For code tables of the same category, code tables with different versions are stored in subdirectories corresponding to the current category code table directory, and code tables with common or non-conflicting versions are stored in a public directory established under the current category code table directory.
3. A BUFR data processing method based on template recognition as claimed in claim 2, characterized in that: When a new version of the code table is released, the newly released code table is stored in the corresponding directory based on the category, version number and content of the newly released code table, so as to realize the dynamic change of the directory tree content.
4. A BUFR data processing method based on template recognition as claimed in claim 2, characterized in that: The target BUFR data is expanded according to the code table and the extracted main table version number and descriptor sequence to obtain the template information of the target BUFR data, specifically including: According to the main table version number in the data identification segment of the target BUFR data, query the directory tree to obtain the code table of the corresponding version number; According to the acquired code table and the extracted descriptor sequence, the target BUFR data is expanded to obtain the element descriptor and template information of the target BUFR data.
5. The BUFR data processing method based on template recognition according to claim 1, characterized in that: The obtaining template information is matched with a known template of BUFR data, and based on the matching result, the target BUFR data is decoded or the template information of the target BUFR data is stored in the known template, specifically including: The template information of the obtained target BUFR data is matched with the known template of BUFR data, and based on the matching result: If the match is successful, the target BUFR data is decoded; If the match fails, the template information of the target BUFR data is stored in the report table, an alarm message is sent to the integrated monitoring system, and the template information of the target BUFR data is stored in the known template.
6. A BUFR data processing method based on template recognition as claimed in claim 1, characterized in that: The decoding of the target BUFR data specifically includes: Perform format check and element analysis on the target BUFR data to determine whether it can be decoded normally: If not, the reason why the decoding failed is recorded; If so, the decoded result set is output, and the data in the decoded result set is processed based on SQL splicing, and the processed data is stored in the database.
7. A BUFR data processing method based on template recognition as claimed in claim 6, characterized in that: The target BUFR data is format checked and element parsed, wherein the specific steps of format checking include: According to the starting mark and the length of the indicated segment of the target BUFR data, locate to the identification segment; Read the first set number of octets of the identification segment, obtain the length of the identification segment, and locate the data description segment according to the identification segment header and the identification segment length; Read the first set number of octets of the data description segment, obtain the length of the data description segment, and locate the data segment according to the data description segment header and the data description segment length; Read the first set number of octets of the data segment, obtain the data segment length, and compare the obtained data segment length with the actual reported data segment length: If they are not equal, it means the format check fails; If they are equal, then determine whether the end segment is a set character based on the starting position of the end segment of the target BUFR data. If not, it means that the format check fails. If so, it means that the format check passes.
8. A BUFR data processing method based on template recognition as claimed in claim 6, characterized in that: The target BUFR data is format checked and parsed for elements, wherein the element parsing of the target BUFR data is performed according to the XML configuration; The XML configuration includes the mapping relationship between the element descriptor of BUFR data and the fields in the relational storage structure, the processing method of regular repetition and delayed repetition, and the unit conversion method.
9. A BUFR data processing device based on template recognition, characterized in that: The BUFR data processing device based on template recognition comprises: A parsing module, which is used to parse the target BUFR data and extract the main table version number in the data identification segment and the descriptor sequence in the data description segment; An acquisition module, which is used to expand the target BUFR data according to the code table and the extracted main table version number and descriptor sequence to obtain template information of the target BUFR data; A matching module is used to match the obtained template information with a known template of BUFR data, and decode the target BUFR data based on the matching result or store the template information of the target BUFR data into the known template.
10. A BUFR data processing device based on template recognition, characterized in that: The BUFR data processing device based on template recognition includes a processor, a memory, and a BUFR data processing program based on template recognition stored in the memory and executable by the processor, wherein when the BUFR data processing program based on template recognition is executed by the processor, the steps of the BUFR data processing method based on template recognition as described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Business data processing method, readable storage medium and computer equipment
CN112000728A
Extreme weather monitoring and early warning information processing system for outdoor competition field
CN112015786A
