User-defined data format analysis method and system based on symbol recognition

Through the method based on symbol recognition, the custom data format in game development is automatically parsed, which solves the problem of cumbersome parsing process in the existing technology, and achieves efficient and accurate data analysis.

CN119808755APending Publication Date: 2025-04-11FUJIAN TQ DIGITAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311313981.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-11
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In game development, the parsing process of custom data formats is cumbersome and cannot be parsed using the default conventions, resulting in large workloads and difficult modifications.

Method used

The custom data format parsing method based on symbol recognition is adopted. By obtaining custom configuration field data, decomposing data characters and separating characters, determining the combined separating characters, replacing the combined separating characters content, and realizing automatic parsing.

Benefits of technology

It realizes automatic parsing of different custom configuration data, reducing workload and error probability, and simplifying the data parsing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808755A_ABST
    Figure CN119808755A_ABST
Patent Text Reader

Abstract

The invention relates to a user-defined data format analysis method based on symbol recognition. The method comprises the following steps: acquiring user-defined configuration field data; dividing the custom configuration field data into data characters and separated characters, wherein the separated characters comprise combined separated characters and independent separated characters; splitting the user-defined configuration field data by using separation characters to obtain a plurality of character string arrays; replacing the data characters in each disassembled character string array with null characters; if the character strings in all the character string arrays after replacement are consistent, determining that the current separation character is the unit separator of the custom data, or else, carrying out circular traversal and disassembling by using the separation character until the unit separator of the custom data is determined; after the unit separator of the user-defined configuration field data is determined, the user-defined configuration field data can be split, information in the user-defined configuration field data is obtained, the format of the user-defined data can be analyzed, and the workload and the error probability are effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data format parsing, and in particular to a method and system for parsing a custom data format based on symbol recognition. Background Art

[0002] In game development, planners will use various forms of custom data for convenience when configuring data. When reading the data, the program will parse it into corresponding data according to the format of the custom data. In the tool that detects whether the planner's configuration data is correct, it is necessary to automatically parse the planner's custom data in batches. At this time, it is not possible to parse each custom data agreement rule like in the business code. If each custom data parsing rule is cached, the workload is large and it is troublesome to modify. Summary of the invention

[0003] In order to overcome the problem in the prior art that custom data format parsing is troublesome and cannot be parsed using default agreed rules, the purpose of the present invention is to provide a custom data format parsing method and system based on symbol recognition, which can automatically parse different custom configuration data.

[0004] The present invention is implemented by the following scheme:

[0005] A custom data format parsing method based on symbol recognition, the method steps are as follows:

[0006] Step 1: Get custom configuration field data;

[0007] Step 2: dividing the custom configuration field data into data characters and separator characters, wherein the separator characters include combined separator characters and independent separator characters;

[0008] Step 3: Determine whether there is a combined separator character. If there is a combined separator character, read the content in the combined separator character and cache it, then replace the content in the combined separator character, and disassemble the custom configuration field data with the separator character to obtain several string arrays;

[0009] Step 4: Replace the data characters in each disassembled string array with null characters;

[0010] Step 5: If the strings in all string arrays after replacement are consistent, the current separator character is the unit separator of the custom data, otherwise replace the separator character used for disassembly and repeat steps 3 to 4 until the unit separator of the custom data is determined;

[0011] Step 6: After determining the unit separator of the custom configuration field data, the custom configuration field data can be split to obtain the information in the custom configuration field data.

[0012] Furthermore, in step 3, reading the content within the combined delimiting characters and caching it is further specifically as follows: using a regular expression to read the content within the combined delimiting characters and caching it.

[0013] Furthermore, in step 3, the content in the replacement combination separator character is specifically: the content in the replacement combination separator character is the subscript index of the integer array from left to right.

[0014] Furthermore, the step of decomposing the custom configuration field data by using separator characters is further specifically as follows: decomposing the custom configuration field data by using separator characters in a sequence from left to right.

[0015] Furthermore, step 6 is further specified as follows: after determining the unit separator of the custom configuration field data, replace the combined separator character and the separator character with a space character, and use the string.split() method to split and obtain the data information in the custom configuration field data.

[0016] A custom data format parsing system based on symbol recognition, the system comprising: a data acquisition module, a character classification module, a data disassembly module, a null character replacement module, a unit separator acquisition module and a parsing module;

[0017] The data acquisition module is used to obtain custom configuration field data;

[0018] The character classification module is used to divide the custom configuration field data into data characters and separator characters, wherein the separator characters include combined separator characters and independent separator characters;

[0019] The data disassembly module is used to determine whether there is a combined separator character. If there is a combined separator character, the content in the combined separator character is read and cached, and then the content in the combined separator character is replaced. The custom configuration field data is disassembled with the separator character to obtain several string arrays;

[0020] The null character replacement module is used to replace the data characters in each disassembled string array with null characters;

[0021] The unit separator acquisition module is used to determine if the strings in all string arrays after replacement are consistent, then the current separator character is the unit separator of the custom data; otherwise, the separator character used for disassembly is replaced and the data disassembly module and the empty character replacement module are repeatedly executed until the unit separator of the custom data is determined;

[0022] After the parsing module is used to determine the unit separator of the custom configuration field data, the custom configuration field data can be split to obtain the information in the custom configuration field data.

[0023] Furthermore, in the data disassembly module, reading the content within the combined delimiting characters and caching them is further specifically as follows: using a regular expression to read the content within the combined delimiting characters and caching them.

[0024] Furthermore, in the data disassembly module, the content in the replacement combination separator character is specifically: the content in the replacement combination separator character is the subscript index of the integer array from left to right.

[0025] Furthermore, in the data decomposition module, decomposing the custom configuration field data using separator characters is further specifically: decomposing the custom configuration field data using separator characters in a left-to-right order.

[0026] Furthermore, the parsing module is further specifically as follows: after determining the unit separator of the custom configuration field data, replace the combined separator character and the separator character with a space character, and use the string.split() method to split and obtain the data information in the custom configuration field data.

[0027] The beneficial effects of the present invention are:

[0028] The present invention provides a custom data format parsing method and system based on symbol recognition, which can automatically parse different custom configuration data by detecting whether each data is symmetrical and obtaining whether the unit separation symbols are consistent, thereby reducing the workload and error probability. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is a flow chart of the method of the present invention;

[0030] Figure 2 It is a structural block diagram of the system of the present invention. DETAILED DESCRIPTION

[0031] The present invention will be further described below in conjunction with the accompanying drawings.

[0032] See also Figure 1 , a custom data format parsing method based on symbol recognition, the method steps are as follows:

[0033] Step 1: Get custom configuration field data;

[0034] Step 2: Divide the custom configuration field data into data characters and separator characters, wherein the separator characters include combined separator characters and independent separator characters;

[0035] Step 3: Determine whether there is a combined separator character. If there is a combined separator character, read the content in the combined separator character and cache it, then replace the content in the combined separator character, and disassemble the custom configuration field data with the separator character to obtain several string arrays;

[0036] Step 4: Replace the data characters in each disassembled string array with null characters;

[0037] Step 5: If the strings in all string arrays after replacement are consistent, the delimiter character at this time is the unit delimiter of the custom data, otherwise replace the delimiter character used for disassembly and repeat steps 3 to 4 until the unit delimiter of the custom data is determined;

[0038] Step 6: After determining the unit separator of the custom configuration field data, the custom configuration field data can be split to obtain the information in the custom configuration field data.

[0039] The present invention will be further described below in conjunction with a specific embodiment:

[0040] A method for parsing a custom data format based on symbol recognition, the method comprising the following steps:

[0041] Step 1: Divide the custom configuration field data into data characters and separator characters, such as the custom configuration field data "1-(102-11)|2-(105-3)|3-(104-9)";

[0042] Step 2: In the custom configuration field data, Arabic numerals or Chinese and English characters are data characters (to be used in business logic), and the separator characters are divided into independent separator characters such as "|" and "~" as independent separator characters (dividing data characters into array units) and combined separator characters such as "()";

[0043] Step 3: If there is a combined separator character, in order to determine that the configured data is the unit separator of the array data, the configured data characters must be extracted, leaving only the separator characters in the custom configuration field data, and then the separator characters are split;

[0044] If all the delimiters are split by a certain delimiter and each string in the character array is the same, then the delimiter is the array delimiter of the configuration data. Use regular expressions to extract the contents of all combined delimiters for caching. The purpose of using regular expressions is to extract the configuration data in the combined delimiters, as follows:

[0045] var regex1= / \((.+?)\) / g;

[0046] var regex2= / \[(.+?)\] / g;

[0047] var regex3= / \{(.+?)\} / g;

[0048] And replace the contents of the combined separator characters with integer indexes in ascending order from left to right, as follows:

[0049] 1-(1)|2-(2)|3-(3);

[0050] The custom configuration field data is split from left to right using separator characters. For example, in the example custom configuration data in step 1, the first separator character from the left is -. Use the string separator API to decompose the custom configuration field data (such as string.split(data,'-')) to obtain a string array. The decomposition result (string array) is as follows:

[0051] 1(1)|2(2)|3(3);

[0052] Step 4: Replace the numeric characters in each string array extracted from the custom configuration field data in step 3 with empty characters, so that each string in the extracted string array contains only separator characters, as shown below:

[0053] ()|()|();

[0054] Step 5. In step 4, when the numeric characters and the indexed integer numeric characters in the string array are replaced with empty characters, each string in the string array has only separator characters. If the characters of each string are the same at this time, the current separator character is the unit separator of the custom configuration field data. For example, when the first separator character "-" is used to split, the three strings are inconsistent (that is, the numeric characters of the string array "1-(1)|2-(2)|3-(3)" are replaced with empty characters and split with the first separator character "-". The three strings are inconsistent after the split here, and not all strings in the numeric value are "()|"), as follows:

[0055] -()|-()|-(), then “-” is not a unit separator.

[0056] When the separator character loops to the separator character "|" for decomposition, the numeric characters are replaced with empty characters after the string is split, as follows:

[0057] -()-()-();

[0058] Each string in the value is "-()", and if the three strings are the same, then "|" is the unit separator of the custom configuration field data;

[0059] Step 6. Use the unit separator "|" determined in step 5 to split the custom configuration field data to obtain a string array, split the combination characters and separation characters of each string in the string array, that is, replace the combination characters and separation characters with space characters, and use string.split(data,") to split to obtain each configuration data. The custom configuration data can be used in the business or tool;

[0060] See also Figure 2 , a custom data format parsing system based on symbol recognition, the system comprising: a data acquisition module, a character classification module, a data disassembly module, a null character replacement module, a unit separator acquisition module and a parsing module;

[0061] The data acquisition module is used to obtain custom configuration field data;

[0062] The character classification module is used to divide the custom configuration field data into data characters and separator characters, wherein the separator characters include combined separator characters and independent separator characters;

[0063] The data disassembly module is used to determine whether there is a combined separator character. If there is a combined separator character, the content in the combined separator character is read and cached, and then the content in the combined separator character is replaced. The custom configuration field data is disassembled with the separator character to obtain several string arrays;

[0064] The null character replacement module is used to replace the data characters in each disassembled string array with null characters;

[0065] The unit separator acquisition module is used to determine if the strings in all string arrays after replacement are consistent, then the current separator character is the unit separator of the custom data; otherwise, the separator character used for disassembly is replaced and the data disassembly module and the empty character replacement module are repeatedly executed until the unit separator of the custom data is determined;

[0066] After the parsing module is used to determine the unit separator of the custom configuration field data, the custom configuration field data can be split to obtain the information in the custom configuration field data.

[0067] In the embodiment of the present invention, in the data disassembling module, reading the content within the combined delimiting characters and caching them is further specifically: using a regular expression to read the content within the combined delimiting characters and caching them.

[0068] In one embodiment of the present invention, in the data disassembly module, the content in the replacement combination separator character is specifically: the content in the replacement combination separator character is the subscript index of the integer array from left to right.

[0069] In one embodiment of the present invention, in the data decomposition module, decomposing the custom configuration field data using separator characters is further specifically: decomposing the custom configuration field data using separator characters in order from left to right.

[0070] In one embodiment of the present invention, the parsing module is further specifically as follows: after determining the unit separator of the custom configuration field data, replace the combined separator character and the separator character with a space character, and use the string.split() method to split and obtain the data information in the custom configuration field data.

[0071] Custom type configuration data has many types and various complex formats. Its parsing can only be done manually according to the design, or the parsing methods of all custom configuration data types are cached and the corresponding methods are called for parsing. In this way, if a new custom data type is added, a cache parsing method needs to be added, and the parsing method also needs to be maintained during modification, which is labor-intensive and prone to errors. Based on custom configuration data symbols, this method automatically parses different custom configuration data by judging whether each data is symmetrical and whether the symbol format of each data unit is consistent, which can reduce the workload and error probability.

[0072] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.

Claims

1. A custom data format parsing method based on symbol recognition, characterized in that: The method steps are as follows: Step 1: Get custom configuration field data; Step 2: Divide the custom configuration field data into data characters and separator characters, wherein the separator characters include combined separator characters and independent separator characters; Step 3: Determine whether there is a combined separator character. If there is a combined separator character, read the content in the combined separator character and cache it, then replace the content in the combined separator character, and disassemble the custom configuration field data with the separator character to obtain several string arrays; Step 4: Replace the data characters in each disassembled string array with null characters; Step 5: If the string contents in all string arrays after replacement are consistent, the current separator character is the unit separator of the custom data; otherwise, replace the separator character used for disassembly and repeat steps 3 to 4 until the unit separator of the custom data is determined; Step 6: After determining the unit separator of the custom configuration field data, the custom configuration field data can be split to obtain the information in the custom configuration field data.

2. The method for parsing a custom data format based on symbol recognition according to claim 1, characterized in that: In step 3, reading the content within the combined delimiting characters and caching it is further specifically as follows: using a regular expression to read the content within the combined delimiting characters and caching it.

3. The method for analyzing a custom data format based on symbol recognition according to claim 1, characterized in that: In step 3, the content in the replacement combination separator character is specifically: the content in the replacement combination separator character is the subscript index of the integer array from left to right.

4. The method for parsing a custom data format based on symbol recognition according to claim 1, characterized in that: In step 3, the step of decomposing the custom configuration field data using separator characters is further specifically as follows: decomposing the custom configuration field data using separator characters in a left-to-right order.

5. The method for parsing a custom data format based on symbol recognition according to claim 1, characterized in that: Step 6 is further specifically as follows: after determining the unit separator of the custom configuration field data, replace the combined separator character and the separator character with a space character, and use the string.split() method to split and obtain the data information in the custom configuration field data.

6. A custom data format parsing system based on symbol recognition, characterized in that: The system comprises: a data acquisition module, a character classification module, a data disassembly module, a null character replacement module, a unit separator acquisition module and a parsing module; The data acquisition module is used to obtain custom configuration field data; The character classification module is used to divide the custom configuration field data into data characters and separator characters, wherein the separator characters include combined separator characters and independent separator characters; The data disassembly module is used to determine whether there is a combined separator character. If there is a combined separator character, the content in the combined separator character is read and cached, and then the content in the combined separator character is replaced. The custom configuration field data is disassembled with the separator character to obtain several string arrays; The null character replacement module is used to replace the data characters in each disassembled string array with null characters; The unit separator acquisition module is used to determine if the strings in all string arrays after replacement are consistent, then the current separator character is the unit separator of the custom data; otherwise, the separator character used for disassembly is replaced and the data disassembly module and the empty character replacement module are repeatedly executed until the unit separator of the custom data is determined; After the parsing module is used to determine the unit separator of the custom configuration field data, the custom configuration field data can be split to obtain the information in the custom configuration field data.

7. The symbol recognition-based custom data format parsing system according to claim 6, characterized in that: In the data disassembly module, reading the content within the combined delimiting characters and caching them is further specifically as follows: using a regular expression to read the content within the combined delimiting characters and caching them.

8. The symbol recognition-based custom data format parsing system according to claim 6, characterized in that: In the data disassembly module, the content in the replacement combination separator character is specifically: the content in the replacement combination separator character is the subscript index of the integer array from left to right.

9. The symbol recognition-based custom data format parsing system according to claim 6, characterized in that: In the data decomposition module, decomposing the custom configuration field data using separator characters is further specifically: decomposing the custom configuration field data using separator characters in a sequence from left to right.

10. The symbol recognition-based custom data format parsing system according to claim 6, characterized in that: The parsing module is further specifically as follows: after determining the unit separator of the custom configuration field data, replace the combined separator character and the separator character with a space character, and use the string.split() method to split and obtain the data information in the custom configuration field data.