CN114697311A - File processing method, device, equipment and storage medium - Google Patents

File processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN114697311A
CN114697311A CN202011633540.5A CN202011633540A CN114697311A CN 114697311 A CN114697311 A CN 114697311A CN 202011633540 A CN202011633540 A CN 202011633540A CN 114697311 A CN114697311 A CN 114697311A
Authority
CN
China
Prior art keywords
data
file
instruction
string array
character string
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.)
Pending
Application number
CN202011633540.5A
Other languages
Chinese (zh)
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.)
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
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 China Mobile Communications Group Co Ltd, China Mobile Communications Ltd Research Institute filed Critical China Mobile Communications Group Co Ltd
Priority to CN202011633540.5A priority Critical patent/CN114697311A/en
Publication of CN114697311A publication Critical patent/CN114697311A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a file processing method, a file processing device, file processing equipment and a storage medium. Wherein the method comprises the following steps: acquiring a file to be processed; the file to be processed is a file formed by multimedia messages or routing data generated by a plurality of communication servers of the edge node; storing the data in the file to be processed into a character string array; reading a preset rule file; extracting data in the character string array by using the preset rule file to form a configuration file with a specific format; the configuration file is used for being identified and used by the second server.

Description

File processing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of wireless communication technologies, and in particular, to a file processing method, apparatus, device, and storage medium.
Background
With the rapid development of mobile communication technology and the requirement of low delay of service, the number of edge nodes is increasing. In practical applications, a plurality of communication servers may be deployed at the edge node, and the routing data or multimedia messages generated by the plurality of communication servers may be stored in one file, the routing data may include server addresses, port numbers and the like, and the multimedia messages may include medical type messages, time administration type messages and the like. When the routing data or the multimedia message in the file is exported to a communication server for use, the data in the file needs to be manually exported and collated into a file which can be identified and directly used by the server, so that the data in the file cannot be automatically extracted and dumped, the time and the labor are consumed, and the efficiency is low.
Disclosure of Invention
In view of this, embodiments of the present invention are intended to provide a file processing method, device, apparatus, and storage medium.
The technical scheme of the embodiment of the invention is realized as follows:
the embodiment of the invention provides a file processing method, which is applied to a first server and comprises the following steps:
acquiring a file to be processed; the file to be processed is a file formed by multimedia messages or routing data generated by a plurality of communication servers of the edge node;
storing the data in the file to be processed into a character string array;
reading a preset rule file;
extracting data in the character string array by using the preset rule file to form a configuration file with a specific format; the configuration file is used for being identified and used by the second server.
Furthermore, according to at least one embodiment of the present invention, the extracting data in the character string array by using a preset rule file includes:
determining at least two attributes of the array of character strings;
aiming at each attribute in the at least two attributes, searching for an instruction corresponding to the corresponding attribute from the preset rule file to obtain at least two instructions; the preset rule file stores the corresponding relation between the attribute and the instruction;
based on the at least two instructions, data in the string array is extracted.
Furthermore, according to at least one embodiment of the present invention, the searching for the instruction corresponding to the corresponding attribute from the preset rule file includes:
judging whether the corresponding attribute meets a first preset condition or not;
when the corresponding attribute is determined to meet a first preset condition, taking a first instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
the first instruction is an instruction for reading data from the character string array according to a preset position.
Further, in accordance with at least one embodiment of the present invention, the method further comprises one of:
reading data from a fixed location of the string array based on the first instruction;
reading data from the character string array in a row increasing mode based on the first instruction;
and reading data from the character string array in a column increment mode based on the first instruction.
Furthermore, according to at least one embodiment of the present invention, the searching for the instruction corresponding to the corresponding attribute from the preset rule file includes:
judging whether the corresponding attribute meets a second preset condition or not;
when the corresponding attribute is determined to meet a second preset condition, taking a second instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
and the second instruction is an instruction capable of modifying the numerical values in the character string array.
Further, in accordance with at least one embodiment of the present invention, the method further comprises one of:
extracting first data corresponding to the corresponding attribute in the character string array based on the second instruction; replacing the first data with second data; the second data is used for forming a configuration file with a specific format;
extracting first data corresponding to the corresponding attribute in the character string array based on the second instruction; combining the first data with preset data to obtain combined data; the combined data is used to form a configuration file of a specific format.
Furthermore, according to at least one embodiment of the present invention, the searching for the instruction corresponding to the attribute from the preset rule file includes:
judging whether the corresponding attribute meets a third preset condition or not;
when the corresponding attribute is determined to meet a third preset condition, taking a third instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
and the third instruction is an instruction for processing the data of at least two cells in the character string array.
Further in accordance with at least one embodiment of the present invention, the method further comprises one of:
merging the first data corresponding to the corresponding attribute in the character string array and the third data corresponding to other attributes based on the third instruction, and extracting merged data; the merged data is used for forming a configuration file with a specific format;
based on the second instruction, calculating first data corresponding to the corresponding attribute in the character string array and fourth data corresponding to other attributes, and extracting the calculated data; the calculated data is used for forming a configuration file with a specific format.
At least one embodiment of the present invention provides a document processing apparatus including:
the acquisition unit is used for acquiring a file to be processed; the file to be processed is a file formed by multimedia messages or routing data generated by a plurality of communication servers of the edge node;
the first processing unit is used for storing the data in the file to be processed into a character string array;
the second processing unit is used for reading a preset rule file; extracting data in the character string array by using the preset rule file to form a configuration file with a specific format; the configuration file is used for being identified and used by the second server.
Furthermore, according to at least one embodiment of the present invention, the second processing unit is specifically configured to:
determining at least two attributes of the array of character strings;
aiming at each attribute in the at least two attributes, searching for an instruction corresponding to the corresponding attribute from the preset rule file to obtain at least two instructions; the preset rule file stores the corresponding relation between the attribute and the instruction;
based on the at least two instructions, data in the string array is extracted.
Furthermore, according to at least one embodiment of the present invention, the second processing unit is specifically configured to: judging whether the corresponding attribute meets a first preset condition or not;
when the corresponding attribute is determined to meet a first preset condition, taking a first instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
the first instruction is an instruction for reading data from the character string array according to a preset position.
Furthermore, according to at least one embodiment of the present invention, the second processing unit is specifically further configured to perform one of the following operations:
reading data from a fixed location of the string array based on the first instruction;
reading data from the character string array in a row increasing mode based on the first instruction;
based on the first instruction, reading data from the character string array in a column increment mode.
Furthermore, according to at least one embodiment of the present invention, the second processing unit is specifically configured to:
judging whether the corresponding attribute meets a second preset condition or not;
when the corresponding attribute is determined to meet a second preset condition, taking a second instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
and the second instruction is an instruction capable of modifying the numerical values in the character string array.
Furthermore, according to at least one embodiment of the present invention, the second processing unit is specifically further configured to perform one of the following operations:
extracting first data corresponding to the corresponding attribute in the character string array based on the second instruction; replacing the first data with second data; the second data is used for forming a configuration file with a specific format;
extracting first data corresponding to the corresponding attribute in the character string array based on the second instruction; combining the first data with preset data to obtain combined data; the combined data is used to form a configuration file of a specific format.
Furthermore, according to at least one embodiment of the present invention, the second processing unit is specifically configured to:
judging whether the corresponding attribute meets a third preset condition or not;
when the corresponding attribute is determined to meet a third preset condition, taking a third instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
and the third instruction is an instruction for processing the data of at least two cells in the character string array.
Furthermore, according to at least one embodiment of the present invention, the second processing unit is specifically further configured to perform one of the following operations:
merging the first data corresponding to the corresponding attribute in the character string array and the third data corresponding to other attributes based on the third instruction, and extracting merged data; the merged data is used for forming a configuration file with a specific format;
based on the second instruction, performing operation on the first data corresponding to the corresponding attribute in the character string array and the fourth data corresponding to other attributes, and extracting the operated data; the calculated data is used for forming a configuration file with a specific format.
At least one embodiment of the present invention provides a communication device including:
the communication interface is used for acquiring a file to be processed; the file to be processed is a file formed by multimedia messages or routing data generated by a plurality of communication servers of the edge node;
the processor is used for storing the data in the file to be processed into a character string array; reading a preset rule file; extracting data in the character string array by using the preset rule file to form a configuration file with a specific format; the configuration file is used for being identified and used by the second server.
At least one embodiment of the invention provides a communication device comprising a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of any of the above methods when running the computer program.
At least one embodiment of the invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the methods described above.
The file processing method, the file processing device, the file processing equipment and the storage medium provided by the embodiment of the invention are used for acquiring a file to be processed; the file to be processed is a file formed by multimedia messages or routing data generated by a plurality of communication servers of the edge node; storing the data in the file to be processed into a character string array; reading a preset rule file; extracting data in the character string array by using the preset rule file to form a configuration file with a specific format; the configuration file is used for being identified and used by the second server. By adopting the technical scheme of the embodiment of the invention, under the scene of message service or the scene of intelligent network data processing, data in the file to be processed, such as multimedia message or routing data, can be structurally stored through the character string array, and the data in the file to be processed is extracted in batch and is transferred to the second server in the configuration file with a specific format by combining the preset rule file, so that the automatic extraction and dump of the data are realized, the time and the labor are saved, and the efficiency is higher.
Drawings
FIG. 1 is a schematic flow chart of a file processing method according to an embodiment of the present invention;
FIG. 2 is a first flowchart illustrating an implementation process of extracting and dumping a file to be processed according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a second implementation flow for extracting and dumping files to be processed according to an embodiment of the present invention;
FIG. 4 is a third schematic flow chart illustrating an implementation process of extracting and dumping a file to be processed according to an embodiment of the present invention;
FIG. 5 is a system framework diagram of an application of a file processing method according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating reading a file to be processed into a four-dimensional string array according to an embodiment of the present invention;
FIG. 7 is a diagram of a code structure executed by a parsing module according to an embodiment of the present invention;
FIG. 8 is a schematic flow chart illustrating an implementation of automatically extracting and dumping data in a file to be processed according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of the structure of a document processing apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a communication device according to an embodiment of the present invention.
Detailed Description
Before the technical solution of the embodiment of the present invention is introduced, a description is given of a related art.
In the related technology, with the development of the 5G technology, the computing power and the time delay requirements of a novel service on a communication network are higher and higher, and the convergence trend of the industrial network is more and more obvious, so that edge nodes are explosively increased, and the 5G edge computing service relates to massive routing configuration information in a communication server of the existing network, wherein, as the 5G media processing communication server is deployed at the edge nodes, configuration files of the 5G media processing communication server relate to a large amount of routing information, including Internet Protocol (IP) addresses, server addresses, port numbers and the like, verification work of the 5G media processing communication server is generally manually completed and recorded in the form of an Excel data table, and server configuration work is manually written into a format of a text configuration file through the Excel data table. With the increase of edge nodes and servers of the existing network and the increase of the data amount of information, the demand for automatic and batch data processing is increasing. A specific typical application scenario is that routing data in a communication server is exported according to a certain rule and is arranged into another specific format, the format can be recognized and directly used by an Augmented Reality (AR) communication server, due to the uncertainty of the rule, the range and features of data to be exported are uncertain, in addition, the output format is also different according to various requirements, and output information cannot be directly used by the communication server. The data in the Excel needs to be arranged into a proprietary INI configuration information format by the communication server data, and the information extraction and dump of the communication server data file are mainly solved by the following methods at present: exporting all data in the data file of the communication server into some other format through a special automatic extraction tool, manually screening useful data, and sorting the useful data into a required format; useful data is selected by utilizing the screening function of the Excel, then the useful data is manually and correspondingly arranged into a required format, the data in the Excel is completely extracted according to required rules through manual operation, and then the useful data is manually arranged into the required format.
In summary, different communication node configuration tables are different, and filled Excel templates have a certain difference, so that rules for extracting and dumping communication server data are uncertain, and specific rules are different for different scenes, so that the existing solutions do not leave the process of manual screening and sorting, and the existing problems mainly include: firstly, the mode of manually screening and sorting data is low in efficiency, the configuration data volume of only one server node in an actual current network can reach tens of thousands (including security verification parameters and routing information), the finally required configuration file also comprises permutation and combination exchange information among the routing nodes, and the manual configuration of one server node requires about a month workload, so that the cost is high and the speed is low. Secondly, for large batch of data, errors are easily caused in manual screening and data sorting, and the normal operation of an actual existing network system is influenced. Thirdly, data can only be exported completely or by using a fixed rule, so that the flexibility is poor; the Excel self-contained screening function is utilized to screen data, although the self-contained screening function is strong, for a large batch of data tables, each table still needs to be screened to be successfully exported, the dump format cannot be determined, and the overall efficiency is not high.
Based on this, in each embodiment of the invention, a file to be processed is obtained; storing the data in the file to be processed into a character string array; reading a preset rule file; extracting data in the character string array by using the preset rule file to form a configuration file with a specific format; the configuration file is used for being identified and used by the second server.
It should be noted that, in the embodiment of the present invention, by combining the character string array and the preset rule file, extracting and dumping data in the file to be processed, the following advantages are provided:
(1) the application scene is wide, and the method can be applied to a message service scene and an intelligent network data processing scene.
(2) Based on the character string array, the data in the file to be processed is structurally stored, and the preset rule file is combined, so that automatic batch extraction and dump of the server data file based on the custom rule file are realized, the configuration file which can be directly identified and read by the second server is generated, and the efficiency of data extraction and dump of the first server is effectively improved. And the processed data can be directly used by the second server. The second server may specifically be a 5G media processing edge node server.
(3) The preset rule file is a tag type rule file, and can realize various instructions for data extraction and dump, namely, the rule file can provide a large number of instructions for data extraction/screening, can be written in a plain text form and identified by software, and has high flexibility.
(4) Aiming at different extraction/dump requirements of a user, only a simple rule file is written, the simple rule file can be identified by a program, automatic communication server data extraction and dump can be realized aiming at the extraction scene, and a configuration file which can be directly read and used by a communication server is generated, namely, the rule file is preset to be one-time labor, and later repeated work does not need manual work at all, so that the efficiency is greatly improved, and errors can be effectively avoided by an automatic processing mode.
The present invention will be described in further detail with reference to the accompanying drawings and examples.
An embodiment of the present invention provides a file processing method, which is applied to a first server, and as shown in fig. 1, the method includes:
step 101: acquiring a file to be processed; the file to be processed is a file formed by multimedia messages or routing data generated by a plurality of communication servers of the edge node;
step 102: storing the data in the file to be processed into a character string array;
step 103: reading a preset rule file; extracting data in the character string array by using the preset rule file to form a configuration file with a specific format; the configuration file is used for being identified and used by the second server.
Here, in step 101, the file to be processed may refer to a file loaded in the first server by the user or a file formed by routing data; the file may specifically be a file storing multimedia messages or routing data generated by a plurality of communication servers of the edge node in the form of Excel or the like; wherein the first server may be a media processing communication server and the second server may be an AR server; the routing data may include an IP address, a server address, a port number, etc., and the multimedia message may be a news type message or a medical type message.
Here, in step 102, the string array may refer to an array capable of storing a string, for example, a two-dimensional array, a four-dimensional array, or the like. In actual application, the data stored in the string array may be composed of attributes and values of the attributes, where the attributes may include: server IP address, port number, etc., the value of the attribute may include: 172.155.20.15, 2007, etc. Therefore, the data in the file to be processed can be stored into the data with the fixed format according to the format defined by the character string array, and subsequently, the data in the character string array can be conveniently and quickly extracted by utilizing the preset rule file.
Here, in step 103, during actual application, after the data in the file to be processed is stored in the character string array, if the data is read and dumped to the second server according to the data format stored in the character string array, the data cannot be recognized by the second server because the read data does not meet the requirements of the server, such as the format, and the like, and thus the data cannot be directly used by the second server.
The following describes in detail how to extract and dump data in a file to be processed.
In actual application, the user can load the file to be processed on the communication server. The file to be processed can store a large amount of routing data through at least one Excel table, so that each cell in the Excel can be read, and the data in each cell can be stored in the corresponding cell of the character string array.
Based on this, in an embodiment, the storing the data in the file to be processed into the character string array includes:
reading data from the file to be processed in a cell mode;
and storing the read data in the corresponding cells of the character string array.
Here, the character string array may store an array of character strings, and may specifically be a two-dimensional array, a four-dimensional array, or the like
For example, taking the character string array as a four-dimensional array as an example, when a plurality of files to be processed are loaded in the communication server, for each file to be processed, each cell of each data table of each file to be processed is traversed by reading the file class, and the cell is filled into a corresponding cell of the four-dimensional array.
Here, the four-dimensional array may include:
the first dimension, may refer to the workbook index (workbook index). Wherein each number corresponds to a communication database file, and the number is started from 0.
The second dimension, which may be referred to as a data table index (SheetIndex). Each number corresponds to one table in the XLS file, and the number starts from 0, and there may be 1 or multiple data tables in the XLS file.
The third and fourth dimensions may refer to cell Row and Column indices (Column & Row). Each number corresponds to the row number/column number of a cell in a table, and the number is started from 0.
Here, the boundary of the four-dimensional array may be configured in advance, and is set by default to process 10 pending files at most once, assuming that XLS files are used for representation, each XLS file allows at most 20 sub data tables, each sub data table must not exceed 6000 rows/100 columns, and configuration may be modified according to needs and system memory conditions.
The four-dimensional array can store files to be processed in all communication servers loaded by a user, and directly stores the files in a memory in a structured form of array variables, so that the files can be conveniently and subsequently analyzed at high speed to be dumped into another server. The Exceldata [0] [0] [0] [0] represents the value of the data in the cell in the 1 st row and the 1 st column in the first Excel table of the first file to be processed, and the like.
In practical application, considering that the data format stored in the character string array cannot be directly used by the second server, a plurality of instructions can be stored in a preset rule file, and the data can be extracted by using the instructions corresponding to the attributes of the character string array, so that the extracted data meets the requirements of the second server.
Based on this, in an embodiment, the extracting data in the character string array by using the preset rule file includes:
determining at least two attributes of the array of character strings;
aiming at each attribute in the at least two attributes, searching for an instruction corresponding to the corresponding attribute from the preset rule file to obtain at least two instructions; the preset rule file stores the corresponding relation between the attribute and the instruction;
based on the at least two instructions, data in the string array is extracted.
Table 1 shows a corresponding relationship between the attribute of the string array and the instruction in the preset rule file, and as shown in table 1, if the attribute of the string array includes attribute 1 and attribute 2, instruction 1 and instruction 2 are found from the preset rule file, and the data in the string array is extracted by using instruction 1 and instruction 2 to form a configuration file with a specific format. Assuming that the attributes of the character string array comprise attribute 1, attribute 2 and attribute 3, finding instruction 1, instruction 2 and instruction 3 from a preset rule file, and extracting data in the character string array by using the instruction 1, the instruction 2 and the instruction 3 to form a configuration file with a specific format.
Properties of character string arrays Presetting instructions in rule file
Attribute 1 Instruction 1
Attribute 2 Instruction 2
Attribute 3 Instruction 3
TABLE 1
In practical application, it is considered that the value of the attribute stored in the string array may be a fixed value or a value that changes according to a certain rule, and thus, an instruction for reading data according to the value of the attribute may be stored in the preset rule file.
Based on this, in an embodiment, the searching for the instruction corresponding to the corresponding attribute from the preset rule file includes:
judging whether the corresponding attribute meets a first preset condition or not;
when the corresponding attribute is determined to meet a first preset condition, taking a first instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
the first instruction is an instruction for reading data from the character string array according to a preset position.
Here, that the corresponding attribute satisfies the first preset condition may mean that a value corresponding to the corresponding attribute is a fixed value, or that the value of the corresponding attribute is a value that changes regularly.
In practical application, if the value corresponding to the attribute of the character string array is a fixed value, the corresponding data can be extracted by using an instruction for reading data from the fixed position of the character string array; if the values corresponding to the attributes of the string array are changed, the corresponding data may be extracted using an instruction for reading data from the string array in row increments or column increments.
Based on this, in an embodiment, the method further comprises one of:
reading data from a fixed location of the string array based on the first instruction;
reading data from the character string array in a row increasing mode based on the first instruction;
based on the first instruction, reading data from the character string array in a column increment mode.
Table 2 is a corresponding relationship between the attribute of the string array and the first instruction, and as shown in table 2, if the attribute of the string array is a fixed value, instruction 1 is found from the preset rule file, and data in the string array is extracted by using instruction 1; if the attribute of the character string array is a value which changes according to columns, finding an instruction 2 from a preset rule file, and extracting data in the character string array by using an instruction 1; and if the attribute of the character string array is a value which changes according to rows, finding an instruction 3 from a preset rule file, and extracting data in the character string array by using the instruction 3.
Properties of character string arrays A first instruction
The attribute value being a fixed value Instruction 1(xls)
The attribute value being a value varying by column Instruction 2(Autocolumn)
The attribute value being a value varying by rows Instruction 3(autorow)
TABLE 2
Taking instruction 1 as an example, a process of reading data from a fixed position of the string array based on the first instruction is described, specifically as follows:
here, the attribute or attribute name of the character string array may be read in the following manner:
attribute (or attribute name) ═ xls | column | row | sheet index | workbook index |
Assuming column is 1, row is 1, sheetIndex is 1, and workbokendex is 1, the read attribute is: if the attribute value corresponding to the device port is a fixed value, instruction 1 is found from a preset rule file, and may be represented by xls, where instruction 1 is an instruction to read data from a fixed position of the string array.
Here, the data in the string array may be read based on the instruction 1 in the following manner:
XLS | column number | Row number | worksheet number | XLS File number (Default from 1)
Assuming that the column number is 2, the row number is 1, the work table number is 1, and the XLS file number is 1, it indicates that the data corresponding to the device port attribute is extracted from 2 columns and 1 rows of the 1 st work table of the first file to be processed XLS.
Taking instruction 2 as an example, a process of reading data from the string array in a column increment manner based on the first instruction is described, which specifically includes:
here, the attribute or attribute name of the character string array may be read in the following manner:
attribute name ═
autocolumn|start_column|start_row|step|sheetIndex|workbookIndex|stepWait
Assuming that start _ column is 2, start _ row is 2, step is 3, sheetIndex is 2, workbook index is 0, and stepWait is 0, the read attribute is: the device port number is autocolumn |2|2|3|2|0|0, and if the device port number is incrementally changed in a column, the instruction 2 is found from the preset rule file and can be represented by autocolumn. The instruction 2 is an instruction for reading data from the string array in a column increment manner, and specifically may refer to taking a value from a certain column in the string array, and automatically skipping n rows by a step length each time to take a next value until all items are output, for example, assuming that a second column of the string array is a value increased by the step length 1, a position and a step length corresponding to a first item may be specified, thereby implementing automatic data reading; assuming that the second columns of the character string array are all the same value, the corresponding position and step length of the first item can also be specified, thereby realizing automatic data reading.
Here, the data in the string array may be read based on the instruction 2 in the following manner:
autocolumn | initial value column number | initial value row number | step size | worksheet number | XLS File number | step size waiting
The value of the parameter of step size wait (stepWait) is 0 or 1, if the value of step size wait is 0, the parameter needs to be read in each step size, and if the value of compensation wait is 1, the parameter is changed once every other step size.
Assuming that the starting value column number is 2, the starting value row number is 2, the step size is 3, the worksheet number is 2, the XLS file number is 1, and the step size wait is 0, it indicates that the initial data is taken from the 2 nd column 2 row of the 2 nd worksheet in the (first Excel file) and put into the initial field, and the data is taken from the 2 nd column 2+3 row of the 2 nd worksheet and put into the next field. Assuming that the step size wait value (StepWait) is 0, there is no need to change the value one step apart, and then data is always extracted according to the step size.
Taking instruction 3 as an example, a process of reading data from the string array in a row-wise increasing manner based on the first instruction is described, specifically as follows:
here, the attribute or attribute name of the character string array may be read in the following manner:
attribute name is auto | start _ column | start _ row | step | sheetIndex | workbook Index
Assuming that start _ column is 2, start _ row is 2, step is 3, sheetIndex is 2, and workbook index is 0, the read attribute is: and if the station is changed in increments according to the line, finding the instruction 3 from the preset rule file. The instruction 3 is an instruction for reading data from the string array in a row increment manner, and specifically may refer to taking a value from a certain row in the string array, and automatically skipping n columns with a step size each time to take a next value until all items are output.
Here, the process of reading the data in the string array based on the instruction 3 is similar to the process of reading the data in the string array based on the instruction 2, and is not described again here.
In an example, as shown in fig. 2, a process of extracting and dumping a file to be processed is described, which includes:
step 201: acquiring a file to be processed;
here, in practical application, in a message service scenario, the file to be processed may be a file of multimedia messages generated by a plurality of communication servers of the edge node, which is stored in the form of Excel or the like. For example, the Excel file stores files of multimedia messages generated by the communication server 1, the communication server 2 and the communication server 3, the multimedia message generated by the communication server 1 can be a medical message, the multimedia message generated by the communication server 2 can be a time administration message, and the multimedia message generated by the communication server 3 can be a news message.
Here, in the intelligent network data processing scenario, the to-be-processed file may be a file that stores routing data generated by a plurality of communication servers of the edge node in the form of Excel or the like. For example, an Excel file stores routing data generated by the communication server 1, the communication server 2, and the communication server 3, and the routing data includes: IP address, port number, subnet mask, etc.
Step 202: storing the data in the file to be processed into a character string array;
step 203: determining at least two attributes of the array of character strings; judging whether the corresponding attribute meets a first preset condition or not aiming at each attribute in the at least two attributes; when determining that the corresponding attribute meets the first preset condition, executing step 204;
step 204: taking a first instruction in the preset rule file as an instruction corresponding to the corresponding attribute; and extracting data in the character string array based on the first instruction.
The first instruction is an instruction for reading data from the character string array according to a preset position.
Here, assuming that the to-be-processed file stores routing data generated by the communication server 1, the communication server 2, and the communication server, when it is required to perform batch extraction on the routing data in the to-be-processed file and to forward the routing data to the communication server 2 in a configuration file in a specific format, the routing data in the to-be-processed file may be subjected to batch extraction based on the preset rule file to obtain the configuration file corresponding to the communication server 2. For example, there are 10 rows of IP addresses of the communication server 2 stored in the file to be processed, and since the IP address of the communication server 2 is not changed, the IP address of the corresponding communication server 2 may be extracted from a preset fixed position in the file to be processed based on the first instruction in the preset rule file, and then the configuration file of the communication server 2 may be formed together with the extracted other data.
The method combines the character string array and the preset rule file to extract and dump the file to be processed, and has the following advantages:
(1) the application scene is wide, and the method can be applied to a message service scene and an intelligent network data processing scene.
(2) Based on the character string array, the data in the file to be processed is structurally stored, and the instruction of reading the data according to the preset position in the preset rule file is combined, so that automatic batch extraction and dump of the server data file based on the user-defined rule file are realized, and a configuration file which can be directly identified and read by a second server is generated.
In actual application, it is considered that the value of the attribute stored in the string array can be directly identified and used by the server after being modified, and thus, an instruction for modifying the extracted data can be stored in the preset rule file.
Based on this, in an embodiment, the searching for the instruction corresponding to the corresponding attribute from the preset rule file includes:
judging whether the corresponding attribute meets a second preset condition or not;
when the corresponding attribute is determined to meet a second preset condition, taking a second instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
and the second instruction is an instruction capable of modifying the numerical values in the character string array.
Here, that the corresponding attribute satisfies the second preset condition may mean that a value corresponding to the corresponding attribute needs to be modified.
In actual application, the value corresponding to the attribute of the string array may be replaced by another numerical value, or another numerical value may be added to combine into a new numerical value, so that the corresponding data may be extracted by using the instruction for modifying the extracted data.
Based on this, in an embodiment, the method further comprises one of:
extracting first data corresponding to the corresponding attribute in the character string array based on the second instruction; replacing the first data with second data; the second data is used for forming a configuration file with a specific format;
extracting first data corresponding to the corresponding attribute in the character string array based on the second instruction; combining the first data with preset data to obtain combined data; the combined data is used to form a configuration file of a specific format.
Table 3 shows a corresponding relationship between the attribute of the string array and the second instruction, and as shown in table 3, if the value of the attribute of the string array needs to be added with other numerical values, the instruction 10 is found from the preset rule file, and the data in the string array is extracted by using the instruction 10; if the value of the attribute of the character string array needs to be set as a preset fixed value, finding an instruction 5 from a preset rule file, and extracting data in the character string array by using the instruction 5; and if the value of the attribute of the character string array needs to be replaced by other numerical values, finding the instruction 12 from the preset rule file, and extracting the data in the character string array by using the instruction 12.
Properties of character string arrays Second instruction
Adding other values to attribute values Instruction 10(append)
The attribute values are circularly valued according to a fixed list Instruction 4(list)
Setting the attribute value to a preset fixed value Instruction 5(value)
Replacement of attribute values with other values Instruction 12(read _ acord)
TABLE 3
Taking instruction 4 as an example, a process of reading data from the string array based on the second instruction is described, specifically as follows:
here, the attribute or attribute name of the character string array may be read in the following manner:
attribute name list item _1 item _2 … item _ n
Assuming that item _1 is 0xffff000a and item _2 is 0xffff000b, the read attributes are: the value list |0xffff000a |0xffff000b, assuming the value is displayed as a circular list, instruction 4 is found from the preset rule file. The instruction 4 is an instruction that circularly takes values according to a fixed list, and specifically, since the value of the attribute does not come from a database table corresponding to the string array or does not completely come from a database table corresponding to the string array, and the value of the attribute is changed, a list may be specified, where a first attribute value read is stored in a first item _1 of the list, a second attribute value read is stored in a second item _2 of the list, … and so on. The number of parameters stored in the list is not limited, and the parameters may be irregular or regular parameters.
For example, the attribute parameters that are cycled through with a period of 2 include 20 attribute values, the first attribute value is 0xffff000a, the second attribute value is 0xffff000b, and the third attribute value is 0xffff000a, and the cycle is repeated until the last attribute is read.
Here, instruction 10 may be represented by an apend, meaning that a string is added after the value is taken.
Taking instruction 5 as an example, a process of reading data from the string array based on the second instruction is described, specifically as follows:
here, the attribute or attribute name of the character string array may be read in the following manner:
value attribute name
Assuming that value is 0x50000, the read attribute is: if the ID attribute needs to be set to a fixed value, the instruction 5 is found from the preset rule file. The instruction 5 is an instruction for setting the value of the attribute to a fixed value, specifically, the fixed value is not from a database table corresponding to the string array, and may be a preset default value, for example, the value of the ID attribute is always 0x 50000.
Here, the process of reading the data in the string array based on the instruction 12 is similar to the process of reading the data in the string array based on the instruction 5, and is not described herein again. Where the instruction 12 may be represented by read _ acord, indicating that the read value corresponds to another value.
In an example, as shown in fig. 3, a process of extracting and dumping a file to be processed is described, which includes:
step 301: acquiring a file to be processed;
here, in practical application, in a message service scenario, the file to be processed may be a file of multimedia messages generated by a plurality of communication servers of the edge node, which is stored in the form of Excel or the like. For example, the Excel file stores files of multimedia messages generated by the communication server 1, the communication server 2 and the communication server 3, the multimedia message generated by the communication server 1 can be a medical message, the multimedia message generated by the communication server 2 can be a time administration message, and the multimedia message generated by the communication server 3 can be a news message.
Here, in the intelligent network data processing scenario, the to-be-processed file may be a file storing routing data generated by a plurality of communication servers of the edge node in the form of Excel or the like. For example, an Excel file stores routing data generated by the communication server 1, the communication server 2, and the communication server 3, and the routing data includes: IP address, port number, subnet mask, etc.
Step 302: storing the data in the file to be processed into a character string array;
step 303: determining at least two attributes of the array of character strings; judging whether the corresponding attribute meets a second preset condition or not aiming at each attribute in the at least two attributes; when determining that the corresponding attribute satisfies a second preset condition, executing step 304;
step 304: taking a second instruction in the preset rule file as an instruction corresponding to the corresponding attribute; and extracting data in the character string array based on the second instruction.
And the second instruction is an instruction capable of modifying the numerical values in the character string array.
Here, assuming that the to-be-processed file stores routing data generated by the communication server 1, the communication server 2, and the communication server, when it is required to perform batch extraction on the routing data in the to-be-processed file and to forward the routing data to the communication server 2 in a configuration file in a specific format, the routing data in the to-be-processed file may be subjected to batch extraction based on the preset rule file to obtain the configuration file corresponding to the communication server 2. For example, there are 10 rows in the to-be-processed file storing the IP address of the communication server 2, and since the deployment location of the communication server 2 is changed from location 1 to location 2, the IP address of the communication server 2 is changed, so that the IP address extracted from the to-be-processed file to the corresponding communication server 2 may be replaced with the IP address corresponding to location 2 based on the second instruction in the preset rule file, and then the configuration file of the communication server 2 may be formed together with the extracted other data.
The method combines the character string array and the preset rule file to extract and dump the file to be processed, and has the following advantages:
(1) the application scene is wide, and the method can be applied to a message service scene and an intelligent network data processing scene.
(2) Based on the character string array, the data in the file to be processed is structurally stored, and the data is modified by combining the instruction in the preset rule file, so that automatic batch extraction and dumping of the server data file based on the user-defined rule file are realized, and a configuration file which can be directly identified and read by a second server is generated.
In practical application, considering that the value of the attribute stored in a certain cell in the string array needs to be combined with the value of the attribute stored in another cell, and then the combined value and the calculated value can be directly identified and used by the server, so that the preset rule file can store instructions for combining and calculating the block structure of the extracted data.
Based on this, in an embodiment, the searching for the instruction corresponding to the attribute from the preset rule file includes:
judging whether the corresponding attribute meets a third preset condition or not; when the corresponding attribute is determined to meet a third preset condition, taking a third instruction in the preset rule file as an instruction corresponding to the corresponding attribute; and the third instruction is an instruction for processing the data of at least two cells in the character string array.
Here, that the corresponding attribute satisfies the third preset condition may mean that the value corresponding to the corresponding attribute needs to be combined or operated with values of other attributes.
In practical application, if an attribute value corresponding to a certain cell of the character string array needs to be combined with attribute values corresponding to other cells, the data in the character string array can be read by using an instruction for reading data according to a block structure; if the attribute value corresponding to a certain cell of the character string array needs to be operated with the attribute values corresponding to other cells, the data in the character string array can be read by using the instruction for operating the extracted data.
Based on this, in an embodiment, the method further comprises one of:
merging the first data corresponding to the corresponding attribute in the character string array and the third data corresponding to other attributes based on the third instruction, and extracting merged data; the merged data is used for forming a configuration file with a specific format;
based on the second instruction, calculating first data corresponding to the corresponding attribute in the character string array and fourth data corresponding to other attributes, and extracting the calculated data; and the calculated data is used for forming a configuration file with a specific format.
Table 4 is a corresponding relationship between the attribute of the string array and the third instruction, and as shown in table 4, if the value of the attribute of the string array needs to be merged with the values of other attributes, instruction 6, instruction 7, and instruction 8 are found from the preset rule file, and data in the string array is extracted by using instruction 6, instruction 7, or instruction 8; and if the value of the attribute of the character string array needs to be operated with the values of other attributes, finding an instruction 9 from a preset rule file, and extracting data in the character string array by using the instruction 9.
Figure BDA0002880641120000181
TABLE 4
Here, the instruction 6 may be represented by read _ block, and may indicate that data in the string array is read according to a block structure, where the block structure may be a block structure obtained by merging multiple cells in the string array. Instructions 7, 8 may be denoted read _ IP/read _ port, respectively, representing instructions to merge the read IP and port addresses. Instruction 9 may be represented by a command, which represents an instruction to perform a calculation/command.
In an example, as shown in fig. 4, a process of extracting and dumping a file to be processed is described, which includes:
step 401: acquiring a file to be processed;
here, in practical application, in a message service scenario, the file to be processed may be a file of multimedia messages generated by a plurality of communication servers of the edge node, which is stored in the form of Excel or the like. For example, the Excel file stores files of multimedia messages generated by the communication server 1, the communication server 2 and the communication server 3, the multimedia message generated by the communication server 1 may be a medical message, the multimedia message generated by the communication server 2 may be a temporal message, and the multimedia message generated by the communication server 3 may be a news message.
Here, in the intelligent network data processing scenario, the to-be-processed file may be a file storing routing data generated by a plurality of communication servers of the edge node in the form of Excel or the like. For example, an Excel file stores routing data generated by the communication server 1, the communication server 2, and the communication server 3, and the routing data includes: IP address, port number, subnet mask, etc.
Step 402: storing the data in the file to be processed into a character string array;
step 403: determining at least two attributes of the array of character strings; judging whether the corresponding attribute meets a third preset condition or not aiming at each attribute in the at least two attributes; when it is determined that the corresponding attribute satisfies the second preset condition, executing step 404;
step 404: taking a third instruction in the preset rule file as an instruction corresponding to the corresponding attribute; and extracting data in the character string array based on the third instruction.
And the third instruction is an instruction for processing the data of at least two cells in the character string array.
Here, assuming that the to-be-processed file stores routing data generated by the communication server 1, the communication server 2, and the communication server, when it is required to perform batch extraction on the routing data in the to-be-processed file and to forward the routing data to the communication server 2 in a configuration file in a specific format, the routing data in the to-be-processed file may be subjected to batch extraction based on the preset rule file to obtain the configuration file corresponding to the communication server 2. For example, the to-be-processed file stores an IP address, a port number, and a subnet mask of the communication server 2, and since the cells corresponding to the IP address, the port number, and the subnet mask can be merged, the content of the merged cell can be extracted from the to-be-processed file based on the third instruction in the preset rule file, that is, three data, i.e., the IP address, the port number, and the subnet mask, can be extracted at one time, and then the three data and the extracted other data form the configuration file of the communication server 2 together.
The method combines the character string array and the preset rule file to extract and dump the file to be processed, and has the following advantages:
(1) the application scene is wide, and the method can be applied to a message service scene and an intelligent network data processing scene.
(2) Based on the character string array, the data in the file to be processed is structurally stored, and the instructions for merging and operating the data in the preset rule file are combined, so that automatic batch extraction and dump of the server data file based on the user-defined rule file are realized, and a configuration file which can be directly identified and read by a second server is generated.
In practical application, only part of attribute values in all the attribute values stored in the character string array can be directly identified and used by a server, so that an instruction for intercepting and extracting data in the character string array can be stored in the preset rule file.
Based on this, in an embodiment, the searching for the instruction corresponding to the attribute from the preset rule file includes:
judging whether the corresponding attribute meets a fourth preset condition or not;
when the corresponding attribute is determined to meet a fourth preset condition, taking a fourth instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
and the fourth instruction is an instruction for intercepting and reading the data in the character string array.
Here, the corresponding attribute satisfying the fourth preset condition may mean that the corresponding attribute contains a specific character, for example, an end character, a skip character, and the like.
Table 5 shows a corresponding relationship between the attribute of the string array and the fourth instruction, and as shown in table 5, if the attribute of the string array includes a jump character, the instruction 10 is found from the preset rule file, and the instruction 10 is jumped to another position in the string array for reading; and if the attribute of the character string array comprises an ending character, finding the instruction 11 from the preset rule file, and ending data reading by using the instruction 11. Instruction 10 may be represented by read _ jumpif, indicating that this value was read and the jump was taken; instruction 11 may be represented by read _ extension indicating a read-then-force end.
Properties of character string arrays Third instruction
Attributes containing jump characters Instruction 10(read _ jumpif)
Attributes containing an end character Instruction 11(read _ terminate)
TABLE 5
Fig. 5 is a schematic diagram of a system framework applied to a file processing method according to an embodiment of the present invention, where the system includes:
a first server 51 including a reading module and a parsing module; the reading module is responsible for reading a plurality of files to be processed and storing the files into a four-dimensional character string array, and specifically, the files to be processed can be read into the four-dimensional character string array in a loop nesting manner, as shown in fig. 6. And the analysis module is used for reading the preset rule file, loading and extracting data in the four-dimensional character string array by using a corresponding instruction, and outputting the configuration file with a specific format to the second server. The structure of the code executed by the parsing module is shown in fig. 7.
And a second server 52, configured to receive the configuration file with the specific format sent by the first server.
In an example, as shown in fig. 8, a process of automatically extracting and dumping data in a file to be processed is described in conjunction with the system architecture diagram shown in fig. 5, where the process includes:
step 801: and reading Excel data in the file to be processed into a four-dimensional character string array in batch.
Here, first, a user loads Excel data in a file to be processed of a first server that needs to extract data, and if extraction rules are consistent, multiple batch processing can be performed. Then, all Excel data in the file to be processed of the first server are structurally read into a memory, namely, the Excel data are stored into a four-dimensional character string array, and four dimensions of the four-dimensional character string array are respectively a Workbook Workbook- > data table Sheet- > cell Row value and a Column value Column & Row.
Here, taking the file to be processed as the database file in the media processing communication server as an example, the reading module in the first server stores the file to be processed in the character string array, which is specifically shown in table 6.
Figure BDA0002880641120000211
TABLE 6
Step 802: and extracting and dumping data in the four-dimensional character string array according to a preset rule file.
And reading a preset rule file, sorting the data of each Cell (Cell) in the four-dimensional character string array according to the preset rule file, and outputting the data as a configuration file which can be directly read and used by a second server.
Here, the preset rule file defines how to extract and dump, that is, specifies how to read the attribute information from the plurality of communication server data files and generate a text in a specified format, and the content of the preset rule file may include:
initializing a mark: the initialization flag defines the beginning/end of the rule file and defines initialization setting parameters, and the initialization flag is identified by "#". Example (c): # rf _ start (rule File Start) # rf _ end (rule File end); example (c): # init | param1| param2| param3| param4| … (determining initialization settings and parameters)
The attributes are as follows: the cell data in each Excel table has a name, such as income data in a financial statement, the attribute is income, and the value is the content of the cell. The name of an attribute, and the source from which this attribute was obtained, may be defined in the rule file.
Note that: the line with the semicolon as the beginning is directly skipped by rule analysis, and the content of the line is regarded as the annotation.
Instructions for: the instructions solve the problem of how to take the value of this attribute from the communication server data file. The format of the instruction is as follows: attribute name ═ instruction name | instruction parameter 1|2|3 …
Here, the preset rule file used by the parsing module in the first server is specifically as follows:
#rf_start
#init|none
equipment: read _ block (device port: autocolumn |2|1|0| 1, IP address: autocolumn |2|2|0| 1, local port number: autocolumn |2|3|0| 1, gateway: autocolumn |2|4|0| 1, subnet mask: autocolumn |2|5|0|0|1)
#rf_end
And (3) outputting:
equipment: (device port 1-a, IP address 172.155.20.15, local port 2007, gateway 172.155.20.1, subnet mask 255.255.255.0)
Equipment: (device port 1-a, IP address 172.155.20.15, local port 2007, gateway 172.155.20.1, subnet mask 255.255.255.0)
Equipment: (device port 1-B, IP address 172.155.21.15, local port 2007, gateway 172.155.20.1, subnet mask 255.255.255.0)
Equipment: (device port 1-B, IP address 172.155.21.15, local port 2007, gateway 172.155.20.1, subnet mask 255.255.255.0)
The following is the specific actually output configuration file and the corresponding extraction annotation interception:
[CONN2_GLOBAL]
main_cycle=500
(ii) a Fixed value 500
;main_cycle=500
connection_num=80
(ii) a This is a calculated value, the calculation rule: sum (number of server connections) and is therefore specified as a constant (connection _ num)
;connection_num=con_num
net_task_num=1
(ii) a This is a calculated value and is therefore specified as a constant (task _ num)
;net_task_num=task_num
EDGE_ID=0x01
(ii) a This is a fixed value of 0x01
local_NODE_ID=0x8504001
(ii) a This value is derived from the central device number hexadecimal cell in the 0 table, read using instruction 1, the xls instruction
;xls|9|28|2|0
local_NODE_ID_type=0x07
(ii) a This value is derived from the type number cell in the 0 table, read using instruction 1, the xls instruction
(ii) a Source address ASNODE A series
source_addr=0x4001
;xls|12|28|2|0
(ii) a ASNODE security protocol check source address from security parameter table
(ii) a Derived from the security parameters table, this can be read directly with instruction 1, the xls instruction
local_dataVer_A=0xe12ad264
;xls|15|28|2|0
local_dataVer_B=0x325d0266
;xls|16|28|2|0
local_sinit_A=0x5adce268
;xls|17|28|2|0
local_sinit_B=0x5debb26a
;xls|18|28|2|0
local_sid_A=0xc53a626c
;xls|19|28|2|0
local_sid_B=0x980d526e
;xls|20|28|2|0
local_sys_chk_A=0xae390b5a
local_sys_chk_B=0xc103589c
(ii) a Fixed value 0, in the rule file, the attribute name can be directly taken plus the fixed value
local_crc32_poly_value_A=0
local_crc32_poly_value_B=0
local_LFSR_poly_value_A=0
local_LFSR_poly_value_B=0
(ii) a Fixed value, in the rule file direct attribute name + take fixed value
SFM_U2L_Q_Size_per_connection=200
SFM_L2U_Q_Size_per_connection=200
CFM_U2L_Q_Size_per_connection=500
CFM_L2U_Q_Size_per_connection=500
(ii) a From the structure, the file is that a node is divided into 4 sub-links
(ii) a The number of the output sub-links of each node can be defined, and a line can be inserted into a configuration file when outputting
;1\2\4(#con_output|1|1|1|2|4|2|1|2|2|2|4|...)
[CON_0]
EDGE_ID=0x00
(ii) a EDGE _ ID is a fixed value of 0x00
NODE_ID=0x73E4101
(ii) a The autocolumn function can realize automatic reading
;autocolumn|9|4|1|2|0
NODE_IdType=0x06
(ii) a Fixed value, defined as 0x06, which is constant
CONN_comm_cycle=0
(ii) a Fixed value
(ii) a Destination address A-red
dest_addr=0x4101
;autocolumn|17|4|1|2|0|0
enable_CRSCD_pack=0
(ii) a Default value of 0, if there is a change, instruction 4, i.e. list command, can be used to extract deltaTime 5 from the preset rule file
lifeTime=5
torlerate_cycle=6
num_data_ver=1
(ii) a All take fixed values and are unchanged
remote_dataVer_A=0x2923b004
;autocolumn|20|4|1|2|0|0
remote_dataVer_B=0xe16cd006
;autocolumn|21|4|1|2|0|0
remote_sinit_A=0x52904008
;autocolumn|22|4|1|2|0|0
remote_sinit_B=0xf1bbe00a
;autocolumn|23|4|1|2|0|0
remote_sid_A=0xb3a6d00c
;autocolumn|24|4|1|2|0|0
remote_sid_B=0x870c300e
;autocolumn|25|4|1|2|0|0
com_type=0
(ii) a Are all default values
check_idle_cycle=40
maintain_cycle=50
packet_send_delay=5
enable_UDP_chn_CONN=1
UDP_chn_apply_CONN_ID=4001
con_L2U_Q_size=2
UDP_channel_num=1
(ii) a Default value
local_ip_0=172.155.20.120
(ii) a And (3) corresponding extraction rules: xls |4|4|6|1
local_port_0=5001
(ii) a And (3) corresponding extraction rules: xls |5|4|6|1
remote_ip_0=172.155.20.15
(ii) a Because of the sequence confusion, the output is firstly output according to A-red-B-red A-blue B-blue 1-A,2-A,1-B,2-B and put into a StationengSettings, and then the output can be output according to the requirement
(ii) a And (3) corresponding extraction rules: autocolumn |4|4|2|2|1
(ii) a Since remote _ ip corresponds to each CON, the stepWait attribute is set to 1
remote_port_0=2007
;autocolumn|5|4|2|2|1|1
(ii) a The following are default values, and are constant and fixed values
sock_send_buf_size=60000
sock_recv_buf_size=60000
UDP_recv_MQ_size=5
UDP_send_MQ_size=5
com_channel_num=1
com_port_0=1
Baud_rate=38400
scom_send_MQ_size=5
scom_recv_MQ_size=5
scom_recv_buf_size=2048
[CON_1]
EDGE_ID=0x00
NODE_ID=0x73E4101
NODE_IdType=0x06
CONN_comm_cycle=0
(ii) a Destination address B red
dest_addr=0x4101
enable_CRSCD_pack=0
deltaTime=5
lifeTime=5
torlerate_cycle=6
num_data_ver=1
remote_dataVer_A=0x2923b004
remote_dataVer_B=0xe16cd006
remote_sinit_A=0x52904008
remote_sinit_B=0xf1bbe00a
remote_sid_A=0xb3a6d00c
remote_sid_B=0x870c300e
com_type=0
check_idle_cycle=40
maintain_cycle=50
packet_send_delay=5
enable_UDP_chn_CONN=1
UDP_chn_apply_CONN_ID=4001
con_L2U_Q_size=2
UDP_channel_num=1
local_ip_0=172.155.20.120
local_port_0=5001
remote_ip_0=172.155.20.16
remote_port_0=2007
sock_send_buf_size=60000
sock_recv_buf_size=60000
UDP_recv_MQ_size=5
UDP_send_MQ_size=5
com_channel_num=1
com_port_0=1
Baud_rate=38400
scom_send_MQ_size=5
scom_recv_MQ_size=5
scom_recv_buf_size=2048
By adopting the technical scheme provided by the embodiment of the invention, the data in the file to be processed is structurally stored through the character string array, and the data in the file to be processed is extracted in batch and is transferred to the second server in the configuration file with a specific format by combining the preset rule file, so that the automatic extraction and transfer of the data are realized, the time and the labor are saved, and the efficiency is higher.
In order to implement the file processing method according to the embodiment of the present invention, a file processing apparatus is further provided according to the embodiment of the present invention, and fig. 9 is a schematic structural diagram of the file processing apparatus according to the embodiment of the present invention; as shown in fig. 9, the apparatus includes:
an acquiring unit 91 configured to acquire a file to be processed; the file to be processed is a file formed by multimedia messages or routing data generated by a plurality of communication servers of the edge node;
the first processing unit 92 is used for storing data in the file to be processed into a character string array;
a second processing unit 93, configured to read a preset rule file; extracting data in the character string array by using the preset rule file to form a configuration file with a specific format; the configuration file is used for being identified and used by the second server.
In an embodiment, the second processing unit 93 is specifically configured to:
determining at least two attributes of the array of character strings;
aiming at each attribute in the at least two attributes, searching for an instruction corresponding to the corresponding attribute from the preset rule file to obtain at least two instructions; the preset rule file stores the corresponding relation between the attribute and the instruction;
based on the at least two instructions, data in the string array is extracted.
In an embodiment, the second processing unit 93 is specifically configured to: judging whether the corresponding attribute meets a first preset condition or not;
when the corresponding attribute is determined to meet a first preset condition, taking a first instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
the first instruction is an instruction for reading data from the character string array according to a preset position.
In an embodiment, the second processing unit is further specifically configured to perform one of the following operations:
reading data from a fixed position of the string array based on the first instruction;
reading data from the character string array in a row increasing mode based on the first instruction;
based on the first instruction, reading data from the character string array in a column increment mode.
Furthermore, according to at least one embodiment of the present invention, the second processing unit 93 is specifically configured to:
judging whether the corresponding attribute meets a second preset condition or not;
when the corresponding attribute is determined to meet a second preset condition, taking a second instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
and the second instruction is an instruction capable of modifying the numerical values in the character string array.
In an embodiment, the second processing unit 93 is further specifically configured to perform one of the following operations:
extracting first data corresponding to the corresponding attribute in the character string array based on the second instruction; replacing the first data with second data; the second data is used for forming a configuration file with a specific format;
extracting first data corresponding to the corresponding attribute in the character string array based on the second instruction; combining the first data with preset data to obtain combined data; the combined data is used to form a configuration file of a specific format.
In an embodiment, the second processing unit 93 is specifically configured to:
judging whether the corresponding attribute meets a third preset condition or not;
when the corresponding attribute is determined to meet a third preset condition, taking a third instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
and the third instruction is an instruction for processing the data of at least two cells in the character string array.
In an embodiment, the second processing unit 93 is further specifically configured to perform one of the following operations:
merging the first data corresponding to the corresponding attribute in the character string array and the third data corresponding to other attributes based on the third instruction, and extracting merged data; the merged data is used for forming a configuration file with a specific format;
based on the second instruction, calculating first data corresponding to the corresponding attribute in the character string array and fourth data corresponding to other attributes, and extracting the calculated data; the calculated data is used for forming a configuration file with a specific format.
In practical application, the obtaining unit 91 may be implemented by a communication interface in the file processing apparatus; the first processing unit 92 and the second processing unit 93 may be implemented by processors in a document processing apparatus.
It should be noted that: in the document processing apparatus provided in the foregoing embodiment, when performing document processing, only the division of each program module is illustrated, and in practical applications, the processing allocation may be completed by different program modules according to needs, that is, the internal structure of the apparatus may be divided into different program modules to complete all or part of the processing described above. In addition, the file processing apparatus and the file processing method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
An embodiment of the present invention further provides a communication device, as shown in fig. 10, including:
a communication interface 101 capable of performing information interaction with other devices;
and the processor 102 is connected with the communication interface 101 and is used for executing the method provided by one or more technical schemes of the intelligent device side when running a computer program. And the computer program is stored on the second memory 103.
It should be noted that: the specific processing procedures of the processor 102 and the communication interface 101 are detailed in the method embodiment, and are not described herein again.
Of course, in practice, the various components of the communication device 100 are coupled together by a bus system 104. It is understood that the bus system 104 is used to enable communications among the components. The bus system 104 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 104 in fig. 10.
The memory 103 in the embodiments of the present application is used to store various types of data to support the operation of the communication device 100. Examples of such data include: any computer program for operating on the communication device 100.
The method disclosed in the embodiments of the present application can be applied to the processor 102, or implemented by the processor 102. The processor 102 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be implemented by integrated logic circuits of hardware or instructions in the form of software in the processor 102. The first Processor 102 may be a general-purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc. The processor 102 may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 103, and the processor 102 reads the information in the memory 103 and performs the steps of the foregoing method in combination with the hardware thereof.
In an exemplary embodiment, the communication devices 100, 100 may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, Micro Controllers (MCUs), microprocessors (microprocessors), or other electronic components for performing the foregoing methods.
It is understood that the memory (the first memory 103) of the embodiments of the present application may be a volatile memory or a non-volatile memory, and may include both volatile and non-volatile memories. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memories described in the embodiments of the present application are intended to comprise, without being limited to, these and any other suitable types of memory.
In an exemplary embodiment, the present invention further provides a storage medium, specifically a computer-readable storage medium, for example, a first memory 103 storing a computer program, where the computer program is executable by the first processor 102 of the communication device 100 to perform the steps of the aforementioned control server side method. The computer readable storage medium may be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM.
It should be noted that: "first," "second," and the like are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
In addition, the technical solutions described in the embodiments of the present invention may be arbitrarily combined without conflict.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (12)

1. A file processing method applied to a first server, the method comprising:
acquiring a file to be processed; the file to be processed is a file formed by multimedia messages or routing data generated by a plurality of communication servers of the edge node;
storing the data in the file to be processed into a character string array;
reading a preset rule file;
extracting data in the character string array by using the preset rule file to form a configuration file with a specific format; the configuration file is used for being identified and used by the second server.
2. The method according to claim 1, wherein the extracting data in the character string array by using the preset rule file comprises:
determining at least two attributes of the array of character strings;
aiming at each attribute in the at least two attributes, searching for an instruction corresponding to the corresponding attribute from the preset rule file to obtain at least two instructions; the preset rule file stores the corresponding relation between the attribute and the instruction;
based on the at least two instructions, data in the string array is extracted.
3. The method according to claim 2, wherein the searching for the instruction corresponding to the corresponding attribute from the preset rule file comprises:
judging whether the corresponding attribute meets a first preset condition or not;
when the corresponding attribute is determined to meet a first preset condition, taking a first instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
the first instruction is an instruction for reading data from the character string array according to a preset position.
4. The method of claim 3, further comprising one of:
reading data from a fixed location of the string array based on the first instruction;
reading data from the character string array in a row increasing mode based on the first instruction;
based on the first instruction, reading data from the character string array in a column increment mode.
5. The method according to claim 2, wherein the searching for the instruction corresponding to the corresponding attribute from the preset rule file comprises:
judging whether the corresponding attribute meets a second preset condition or not;
when the corresponding attribute is determined to meet a second preset condition, taking a second instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
and the second instruction is an instruction capable of modifying the numerical values in the character string array.
6. The method of claim 5, further comprising one of:
extracting first data corresponding to the corresponding attribute in the character string array based on the second instruction; replacing the first data with second data; the second data is used for forming a configuration file with a specific format;
extracting first data corresponding to the corresponding attribute in the character string array based on the second instruction; combining the first data with preset data to obtain combined data; the combined data is used to form a configuration file of a specific format.
7. The method according to claim 2, wherein the searching for the instruction corresponding to the attribute from the preset rule file comprises:
judging whether the corresponding attribute meets a third preset condition or not;
when the corresponding attribute is determined to meet a third preset condition, taking a third instruction in the preset rule file as an instruction corresponding to the corresponding attribute;
and the third instruction is an instruction for processing the data of at least two cells in the character string array.
8. The method of claim 7, further comprising one of:
merging the first data corresponding to the corresponding attribute in the character string array and the third data corresponding to other attributes based on the third instruction, and extracting merged data; the merged data is used for forming a configuration file with a specific format;
based on the second instruction, calculating first data corresponding to the corresponding attribute in the character string array and fourth data corresponding to other attributes, and extracting the calculated data; the calculated data is used for forming a configuration file with a specific format.
9. A document processing apparatus, characterized by comprising:
the acquisition unit is used for acquiring a file to be processed; the file to be processed is a file formed by multimedia messages or routing data generated by a plurality of communication servers of the edge node;
the first processing unit is used for storing the data in the file to be processed into a character string array;
the second processing unit is used for reading a preset rule file; extracting data in the character string array by using the preset rule file to form a configuration file with a specific format; the configuration file is used for being identified and used by the second server.
10. An electronic device, comprising:
the communication interface is used for acquiring a file to be processed; the file to be processed is a file formed by multimedia messages or routing data generated by a plurality of communication servers of the edge node;
the processor is used for storing the data in the file to be processed into a character string array; reading a preset rule file; extracting data in the character string array by using the preset rule file to form a configuration file with a specific format; the configuration file is used for being identified and used by the second server.
11. A communication device comprising a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is adapted to perform the steps of the method of any one of claims 1 to 8 when running the computer program.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8.
CN202011633540.5A 2020-12-31 2020-12-31 File processing method, device, equipment and storage medium Pending CN114697311A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011633540.5A CN114697311A (en) 2020-12-31 2020-12-31 File processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011633540.5A CN114697311A (en) 2020-12-31 2020-12-31 File processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114697311A true CN114697311A (en) 2022-07-01

Family

ID=82134559

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011633540.5A Pending CN114697311A (en) 2020-12-31 2020-12-31 File processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114697311A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020095459A1 (en) * 2000-12-22 2002-07-18 Laux Thorsten O. Method and apparatus for providing a client by a server with an instruction data set in a predetermined format in response to a content data request message by a client
US20060168003A1 (en) * 2002-09-23 2006-07-27 Jena-Marie Vau Method for archiving multimedia messages
US20130054584A1 (en) * 2011-08-22 2013-02-28 Nokia Corporation Method and apparatus for providing search with contextual processing
KR101737578B1 (en) * 2015-11-27 2017-05-18 한국비앤에스시스템 주식회사 Method and device for automatically tuning for sql sentences generated automatically
CN110427773A (en) * 2019-06-28 2019-11-08 平安科技(深圳)有限公司 Information processing method, device, storage medium and terminal device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020095459A1 (en) * 2000-12-22 2002-07-18 Laux Thorsten O. Method and apparatus for providing a client by a server with an instruction data set in a predetermined format in response to a content data request message by a client
US20060168003A1 (en) * 2002-09-23 2006-07-27 Jena-Marie Vau Method for archiving multimedia messages
US20130054584A1 (en) * 2011-08-22 2013-02-28 Nokia Corporation Method and apparatus for providing search with contextual processing
KR101737578B1 (en) * 2015-11-27 2017-05-18 한국비앤에스시스템 주식회사 Method and device for automatically tuning for sql sentences generated automatically
CN110427773A (en) * 2019-06-28 2019-11-08 平安科技(深圳)有限公司 Information processing method, device, storage medium and terminal device

Similar Documents

Publication Publication Date Title
CN108491367B (en) Report document generation method and device, computer equipment and storage medium
CN111914520A (en) Document collaborative editing method and device, computer device and storage medium
CN111683066B (en) Heterogeneous system integration method, heterogeneous system integration device, computer equipment and storage medium
CN110647471B (en) Interface test case generation method, electronic device and storage medium
CN110928802A (en) Test method, device, equipment and storage medium based on automatic generation of case
CN111241182A (en) Data processing method and apparatus, storage medium, and electronic apparatus
CN111818175B (en) Enterprise service bus configuration file generation method, device, equipment and storage medium
CN111191079A (en) Document content acquisition method, device, equipment and storage medium
CN110109712A (en) Service Component loading method, device, computer equipment and storage medium
CN111177243B (en) Data export method and device, storage medium and electronic device
CN110958292A (en) File uploading method, electronic device, computer equipment and storage medium
CN110647564A (en) Hive table establishing method, electronic device and computer readable storage medium
EP3974960A1 (en) Method and system for automated testing of web service apis
CN111522583A (en) Method and device for generating configuration file, computer equipment and storage medium
CN112650529B (en) System and method for configurable generation of mobile terminal APP codes
CN112395339B (en) Intersystem data admission verification method, device, computer equipment and storage medium
CN108053459B (en) Signature file synthesis method, application server and computer readable storage medium
CN111259012B (en) Data homogenizing method, device, computer equipment and storage medium
CN111367916B (en) Data storage method and device
WO2019080419A1 (en) Method for building standard knowledge base, electronic device, and storage medium
CN114697311A (en) File processing method, device, equipment and storage medium
CN104765722A (en) Parameter configuration method and device
CN115967604A (en) Message transmission method and device, electronic equipment and computer readable storage medium
CN109491699B (en) Resource checking method, device, equipment and storage medium of application program
CN113392131A (en) Data processing method and device and computer equipment

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