Data serialization method, computer equipment and computer storage medium

Through hierarchical structure analysis and recursive splicing methods, large-scale data and complex structure data are directly processed, solving the problem of low processing efficiency in the existing technology, and achieving efficient and complete data processing.

CN119829559APending Publication Date: 2025-04-15KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411897006.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

When processing large-scale data and complex structure data, the prior art needs to split the data into small units for processing, resulting in low processing efficiency and difficulty in dealing with large-scale data processing.

Method used

The hierarchical structure analysis and recursive splicing methods are adopted to obtain configuration data of parameter names, parameter values ​​and logical symbols through the configuration interface, analyze the hierarchical structure of parameter names, and generate key-value pair strings in the hierarchical structure to achieve efficient processing of large-scale data and complex structure data.

Benefits of technology

No need to split data, preserve data integrity, reduce data processing time, and significantly improve the processing efficiency of large-scale data and complex structure data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829559A_ABST
    Figure CN119829559A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data serialization method, computer equipment and a computer storage medium. The computer equipment obtains parameter name configuration data, parameter value configuration data and logic symbol configuration data based on the configuration operation, carries out hierarchical structure analysis on the parameter name configuration data to determine a hierarchical structure among a plurality of parameter names, obtains parameter values corresponding to the parameter names according to the parameter value configuration data, and sends the parameter values to the computer equipment; according to the parameter name configuration data, the parameter values corresponding to the parameter names and the logic symbol configuration data, key value pair character strings of all hierarchies in the hierarchical structure are generated. Therefore, even when large-scale data and complex structure data are processed, the data structure can be directly analyzed, and the structured data expected by the user can be recursively generated according to the analyzed hierarchical structure, so that the data does not need to be split, the integrity of the data can be reserved, the time consumption of data processing can be reduced, and the user experience is improved. And the processing efficiency of large-scale data and complex structure data is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing, and specifically to a data serialization method, a computer device, and a computer storage medium. Background Art

[0002] When the business system is running, it needs to process multiple data through business codes. The so-called multiple data are data with multiple parameter names. The business system needs to process the multiple data into a data structure in a preset format based on the business code so that the business system can feed back the processed data structure to other business parties for identification and processing.

[0003] However, when processing large-scale data and complex structured data, current business systems need to first split the large-scale data and complex structured data into a large number of small unit data and single structured data, and then process each small unit data and single structured data one by one into data in a preset format. This processing method takes a long time and has low processing efficiency, making it difficult to cope with the processing of large-scale data and complex structured data. Summary of the invention

[0004] The embodiments of the present application provide a data serialization method, a computer device, and a computer storage medium, which combine hierarchical structure parsing and recursive splicing to efficiently process large-scale data and complex hierarchical structures of complex structured data.

[0005] A first aspect of an embodiment of the present application provides a data serialization method, the method comprising:

[0006] Displaying a configuration interface, and displaying respective configuration areas of parameter names, parameter values ​​and logical symbols on the configuration interface;

[0007] receiving configuration operations input by the user in each of the configuration areas, and acquiring parameter name configuration data, parameter value configuration data, and logic symbol configuration data based on the configuration operations;

[0008] Performing hierarchical structure analysis on the parameter name configuration data to determine the hierarchical structure between the multiple parameter names;

[0009] Obtaining parameter values ​​corresponding to each parameter name according to the parameter value configuration data;

[0010] A key-value pair string of each level in the hierarchical structure is generated according to the parameter name configuration data, the parameter values ​​corresponding to each parameter name and the logical symbol configuration data; wherein each key-value pair string includes a key-value pair consisting of a parameter name and its parameter value and a logical symbol.

[0011] A second aspect of an embodiment of the present application provides a computer device, the computer device comprising:

[0012] A display unit, used to display a configuration interface, and to display respective configuration areas of parameter names, parameter values ​​and logical symbols on the configuration interface;

[0013] A configuration unit, configured to receive configuration operations input by a user in each of the configuration areas, and acquire parameter name configuration data, parameter value configuration data, and logic symbol configuration data based on the configuration operations;

[0014] A parsing unit, used for performing hierarchical structure parsing on the parameter name configuration data to determine the hierarchical structure between the plurality of parameter names;

[0015] An acquiring unit, used for acquiring a parameter value corresponding to each parameter name according to the parameter value configuration data;

[0016] A generation unit is used to generate a key-value pair string for each level in the hierarchical structure according to the parameter name configuration data, the parameter values ​​corresponding to each parameter name and the logical symbol configuration data; wherein each key-value pair string includes a key-value pair consisting of a parameter name and its parameter value and a logical symbol.

[0017] A third aspect of an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the method of the first aspect when executing the computer program.

[0018] A fourth aspect of an embodiment of the present application provides a computer storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes the method of the first aspect.

[0019] A fifth aspect of the embodiments of the present application provides a computer program product. When the computer program product is run on a computer device, the computer device executes the method of the first aspect.

[0020] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0021] The computer device obtains parameter name configuration data, parameter value configuration data and logic symbol configuration data based on the configuration operation, performs hierarchical structure analysis on the parameter name configuration data to determine the hierarchical structure between multiple parameter names, obtains the parameter value corresponding to each parameter name according to the parameter value configuration data, generates key-value pair strings of each level in the hierarchical structure according to the parameter name configuration data, the parameter value corresponding to each parameter name and the logic symbol configuration data, and each key-value pair string includes a key-value pair consisting of a parameter name and its parameter value and a logic symbol. Therefore, even when processing large-scale data and complex structure data, the data structure can be directly parsed and the structured data expected by the user can be recursively generated according to the parsed hierarchical structure, so that there is no need to split the data, the integrity of the data can be retained, and the time consumption of data processing can be reduced, which greatly improves the processing efficiency of large-scale data and complex structure data. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 This is a schematic diagram of the network framework in the embodiment of the present application;

[0023] Figure 2 This is a flow chart of a data serialization method in an embodiment of the present application;

[0024] Figure 3 This is another flow chart of the data serialization method in the embodiment of the present application;

[0025] Figure 4 A schematic diagram of an exemplary interface style of the configuration interface in the embodiment of the present application;

[0026] Figure 5 This is a schematic diagram of the structure of a computer device in an embodiment of the present application;

[0027] Figure 6 This is another structural diagram of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The embodiments of the present application provide a data serialization method, a computer device, and a computer storage medium, which combine hierarchical structure parsing and recursive splicing to efficiently process large-scale data and complex hierarchical structures of complex structured data.

[0029] See also Figure 1 In the embodiment of the present application, the network framework includes:

[0030] The service server 100 and the terminal cluster; the terminal cluster may include: terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n and other terminal devices.

[0031] The business server 100 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud database, cloud service, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and big data and artificial intelligence platform. The terminal device (including terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n) may be a smart phone, tablet computer, laptop computer, desktop computer, PDA, mobile internet device (MID), wearable device (such as smart watch, smart bracelet, etc.), smart computer, smart car and other smart terminals.

[0032] Among them, the business server 100 can establish a communication connection with each terminal device in the terminal cluster, and a communication connection can also be established between each terminal device in the terminal cluster. In other words, the business server 100 can establish a communication connection with each terminal device in the terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n. For example, a communication connection can be established between the terminal device 200a and the business server 100. A communication connection can be established between the terminal device 200a and the terminal device 200b, and a communication connection can also be established between the terminal device 200a and the terminal device 200c. Among them, the above-mentioned communication connection does not limit the connection method, and can be directly or indirectly connected through a wired communication method, or can be directly or indirectly connected through a wireless communication method, etc., which can be determined according to the actual application scenario, and this application is not limited here.

[0033] It should be understood that Figure 1 Each terminal device in the terminal cluster shown can be installed with an application client. When the application client runs in each terminal device, it can interact with the business server 100 respectively, so that the business server 100 can receive business data from each terminal device (such as financial management data uploaded by the user through the terminal device). Among them, the application client can be an application client with the function of displaying text, images, audio and video, such as a financial management application, an enterprise affairs management application, a browser application, a social application, an instant messaging application, a live broadcast application, a game application, a short video application, a video application, a music application, a shopping application, a novel application, a payment application, etc., which can be determined according to the actual application scenario requirements and is not limited here. Among them, the application client can be an independent client or an embedded sub-client integrated in a client (such as a financial management client, an enterprise affairs management client, etc.), which can be determined according to the actual application scenario and is not limited here.

[0034] The following will be combined Figure 1 The data serialization method in the embodiment of the present application is described in the network framework:

[0035] See also Figure 2 In the embodiment of the present application, one embodiment of the data serialization method includes:

[0036] 201. Acquire parameter name configuration data, parameter value configuration data, and logic symbol configuration data based on a configuration operation;

[0037] The method of this embodiment can be applied to a computer device, which can be Figure 1 The business server 100 or each terminal device in the network framework shown. The computer device can display a configuration interface for configuring various parameter names and parameter values, and the configuration interface displays respective configuration areas of parameter names, parameter values, and logical symbols, so that the user can perform configuration operations of parameter names, parameter values, and logical symbols in the above-mentioned various configuration areas. The computer device receives the configuration operations input by the user in the above-mentioned various configuration areas, and obtains parameter name configuration data, parameter value configuration data, and logical symbol configuration data based on the configuration operations.

[0038] One of the purposes of this embodiment is to parse parameter name configuration data and parameter value configuration data containing multiple parameter names and parameter values ​​into a data structure that can be read by other business parties (such as other business systems), and the data structure represents the parameter name and parameter value in the form of a string. The above configuration data input by the user through the configuration interface also represents the user's format requirements for the data structure, so the string generated based on the above multiple configuration data has the data format expected by the user and can meet the user's format requirements for the data structure.

[0039] Among them, parameter name configuration data is the user's configuration of parameter names, such as the parameter names of multiple parameters defined by the user; parameter value configuration data is the user's configuration of parameter values, such as the user-defined method for determining parameter values, or directly defining the specific values ​​of parameter values; logical symbol configuration data is the user's configuration of logical symbols, such as the user-defined logical symbols used in each position in the string to be generated.

[0040] Logical symbols are used to represent the syntax of the string to be generated. For example, the logical symbols may include colons, commas, semicolons, curly brackets, square brackets, and other symbols that can represent logical relationships. Users can configure logical symbols so that the generated string can express accurate logic and accurately express the logical relationship between parameter names in the string.

[0041] 202. Perform hierarchical structure analysis on the parameter name configuration data to determine the hierarchical structure between the multiple parameter names;

[0042] The parameter name configuration data includes multiple parameter names, and there is a hierarchical relationship between the multiple parameter names. Therefore, the parameter name configuration data can be parsed in a hierarchical structure to determine the hierarchical structure between the multiple parameter names represented by the parameter name configuration data.

[0043] 203. Obtain parameter values ​​corresponding to each parameter name according to the parameter value configuration data;

[0044] The parameter value configuration data indicates the method for determining the parameter value of each parameter name. Therefore, the parameter value corresponding to each parameter name can be determined according to the parameter value configuration data.

[0045] 204. Generate a key-value pair string of each level in the hierarchical structure according to the parameter name configuration data, the parameter value corresponding to each parameter name, and the logic symbol configuration data;

[0046] After determining the hierarchical structure between multiple parameter names based on the parameter name configuration data, and determining the parameter value of each parameter name based on the parameter value configuration data, the key-value pair strings of each level in the hierarchical structure can be generated according to the parameter name configuration data, the parameter values ​​corresponding to each parameter name, and the logical symbol configuration data.

[0047] The generated key-value pair string may be sent to a third-party system or a business party, so that the third-party system or the business party can read the key-value pair string to obtain various parameter names and parameter values ​​thereof.

[0048] The key-value string of each level includes a key-value pair consisting of a parameter name and its parameter value, and a logical symbol. The role of the logical symbol in the key-value string is to express the logical relationship between the parameter name and the parameter value, as well as the syntax of the key-value string. Semicolons, commas, quotation marks, colons and other symbols can be defined as logical symbols in the key-value string. Semicolons and commas can be used to indicate the end of the string, single and double quotation marks are used to define parameter names or parameter values, and colons are used as key-value separators to connect parameter names and parameter values.

[0049] In this embodiment, the computer device displays a configuration interface, obtains parameter name configuration data, parameter value configuration data, and logic symbol configuration data based on the configuration operation of the user in the configuration interface, performs hierarchical structure analysis on the parameter name configuration data to determine the hierarchical structure between multiple parameter names, obtains parameter values ​​corresponding to each parameter name according to the parameter value configuration data, generates key-value pair strings of each level in the hierarchical structure according to the parameter name configuration data, the parameter values ​​corresponding to each parameter name, and the logic symbol configuration data, and each key-value pair string includes a key-value pair consisting of a parameter name and its parameter value, and a logic symbol. Therefore, even when processing large-scale data and complex structure data, the data structure can be directly parsed and the structured data expected by the user can be recursively generated according to the parsed hierarchical structure, so that there is no need to split the data, the integrity of the data can be retained, and the time consumption of data processing can be reduced, which greatly improves the processing efficiency of large-scale data and complex structure data.

[0050] On the other hand, users can directly configure parameter names, parameter values ​​and logical symbols on the interface to configure the format requirements for the data structure, so that the computer equipment can generate structured data in the data format that meets the user's expectations based on the data format requirements configured by the user. Users do not need to configure business codes or master programming skills, which greatly reduces the technical threshold and difficulty of data structure configuration, making it convenient for users to quickly configure data structures and improve data processing efficiency.

[0051] The following will be Figure 2 Based on the embodiment shown, the embodiment of the present application is further described in detail. Figure 3 Another embodiment of the data serialization method in the embodiment of the present application includes:

[0052] 301. Acquire parameter name configuration data, parameter value configuration data, and logic symbol configuration data based on a configuration operation;

[0053] The computer device may display a configuration interface so that the user can configure parameter names, parameter values, and logical symbols on the interface. For example, Figure 4 An exemplary interface layout of a configuration interface is shown. As shown in the figure, the interface includes a configuration area for parameter names, a configuration area for parameter values, and a configuration area for logical symbols. The user can input configuration operations in each configuration area respectively. The configuration operation can be that the user directly enters text in the corresponding cell in the table, such as entering the text corresponding to the parameter name in the cell corresponding to the parameter name, such as entering the "name" parameter name; or entering symbols corresponding to various logical symbols in the cell corresponding to the logical symbol, such as entering a left curly bracket "{" in the cell corresponding to the start symbol.

[0054] The configuration operation can also be to trigger the selection control corresponding to the cell as shown in the figure to call out the drop-down box and select the required option in the drop-down box. For example, when configuring the parameter value, you can click the selection control of the corresponding cell to call out the drop-down box, and select the configuration method of the parameter value in the drop-down box. For example, when configuring the parameter value corresponding to the parameter name "age", the user selects the option "[number] age" in the drop-down box. When determining the parameter value corresponding to the parameter name "age", the parameter value corresponding to the parameter name can be determined according to the configuration method corresponding to the option.

[0055] 302. Perform hierarchical structure analysis on the parameter name configuration data to determine a hierarchical structure between multiple parameter names;

[0056] The computer device may parse the multiple parameter names configured by the user to determine the hierarchical structure between the multiple parameter names. Figure 4 As shown, the user has configured multiple parameter names such as "name", "age", "isStudent", "hobbies", "contactInfo", "email", and "phoneNumbers". Among them, "name", "age", "isStudent", "hobbies", and "contactInfo" are parameter names at the same level, and contactInfo represents contact information, which includes various contact information such as email, phone number, etc. Therefore, the two parameter names "email" and "phoneNumbers" are at the next level of the parameter name "contactInfo".

[0057] Similarly, the parameter name "phoneNumbers" can also include various types of phone numbers, so this parameter name can also determine the parameter name of the next level, such as private mobile phone, home phone, office phone, and other parameter names related to phone types.

[0058] The hierarchical structure between multiple parameter names can be freely defined by the user according to the actual business situation, and the computer device can determine the corresponding hierarchical structure based on the hierarchical structure between the multiple parameter names configured by the user. This highly customizable configuration method of the hierarchical structure enables users to accurately shape the serialization format of data according to specific business needs.

[0059] 303. Obtain parameter values ​​corresponding to each parameter name according to the parameter value configuration data;

[0060] The parameter value configuration data may indicate the method of determining the parameter values ​​corresponding to each parameter name. In some optional implementations, the user may directly enter a specific value in the configuration area corresponding to the parameter value of a certain parameter name, and the computer device obtains the user input value and uses the user input value as the parameter value of the parameter name. For example, if the user enters the value "26" in the configuration area corresponding to the parameter value of the parameter name "age", it means that the user needs to set the parameter value of the parameter name "age" to a fixed value of 26, and the computer device uses the user input value 26 as the parameter value of the parameter name "age". Of course, the user may also change the parameter value of the parameter name "age" later.

[0061] Another way may be that the user can configure a field identifier in the configuration area corresponding to the parameter value of a certain parameter name, so that the computer device can determine the field value mapped by the field identifier in the preset data source, and use the field value mapped by the field identifier as the parameter value of the corresponding parameter name. Figure 4 As shown, the user selects the option "[number] age" for the parameter value of the parameter name "age". Then, when determining the parameter value of the parameter name, the field value mapped to the "age" field can be determined in the preset data source, and the field value can be used as the parameter value of the parameter name "age".

[0062] Among them, the preset data source can be a business document in a business system. The business document records multiple fields and their field values, such as the "age" field. When the user configures the field corresponding to the parameter value of the parameter name "age" as "[number] age" on the configuration interface, the field matching the option can be determined in the business document, that is, the "age" field recorded in the business document, and the field value of the "age" field is determined as the parameter value of the parameter name "age".

[0063] In addition, the preset data source may also be a database, or other data sources storing a variety of fields and their field values.

[0064] Therefore, determining the parameter value through the above-mentioned field mapping method is equivalent to configuring the parameter value as a variable. The specific value of the parameter value can change with the change of the field value mapped in the preset data source. For example, in the above example, if the field value of the "age" field recorded in the business document changes, the parameter value of the parameter name "age" in the configuration interface will also be updated synchronously, thereby realizing dynamic update of the parameter value.

[0065] Another way to configure parameter values ​​is that the user can configure an operation formula in the configuration area corresponding to the parameter value of a certain parameter name, and the operation formula includes multiple field identifiers. The computer device can then determine the field value mapped to each field identifier in the operation formula in the preset data source, and substitute the field value mapped to each field identifier into the operation formula for calculation, and the calculation result is used as the parameter value of the corresponding parameter name.

[0066] For example, if the parameter name is "Total Price" and the user configures the corresponding parameter value calculation formula as "Unit Price × Quantity", then the data is retrieved from the preset data source according to the "Unit Price" field and the "Quantity" field in this formula, that is, the field value mapped by the "Unit Price" field and the field value mapped by the "Quantity" field in the data source are retrieved, and the obtained values ​​are substituted into the calculation formula for calculation, and the calculation result is used as the parameter value of the parameter name.

[0067] Similarly, the field values ​​mapped by each field identifier in the calculation formula can be updated as the corresponding field values ​​in the preset data source are updated, and the parameter values ​​calculated by the calculation formula will also be updated synchronously, and dynamic update of parameter values ​​can also be achieved.

[0068] Therefore, this embodiment supports multiple parameter value configuration types, including fixed values, variables, and calculation formulas, and can cope with complex data calculation and dynamic data processing requirements. At the same time, for multiple data consisting of multiple parameter names, the number of data and all parameter values ​​can be automatically obtained to achieve efficient processing of big data; for large-scale data and complex structure data, multiple data consisting of multiple parameter names can be parsed in turn and processed separately, which can reduce the difficulty and complexity of data processing and help achieve efficient processing of large-scale data and complex structure data.

[0069] 304. Generate a key-value pair string of each level in the hierarchical structure according to the parameter name configuration data, the parameter value corresponding to each parameter name, and the logic symbol configuration data;

[0070] When generating the key-value pair string of each level, an optional implementation method is that, for each level in the hierarchical structure, the parameter name of the level in the parameter name configuration data, the parameter value of the parameter name of the level, and the logic symbol of the level in the logic symbol configuration data can be spliced ​​into the key-value pair string of the level. In addition, after obtaining the key-value pair strings of multiple levels, the key-value pair strings of the multiple levels in the hierarchical structure can be spliced ​​to obtain the key-value pair string of the hierarchical structure.

[0071] Therefore, by generating key-value pair strings of corresponding hierarchical structures based on the configuration data of each hierarchical structure, and splicing the key-value pair strings of multiple hierarchical structures, this recursive splicing method can realize orderly processing of large-scale data and complex structure data. It only needs to parse the hierarchical structure and recursively splice the key-value pair strings of multiple hierarchical structures. There is no need to perform pre-processing operations such as data splitting, which reduces the data processing steps and greatly improves the processing efficiency of complex data.

[0072] Each level of the hierarchical structure may correspond to one parameter name or multiple parameter names. Different processing methods are used for concatenating key-value pair strings for different situations. Therefore, for each level of the hierarchical structure, the parameter name corresponding to the level in the parameter name configuration data can be determined. If the level corresponds to only one parameter name, the parameter name corresponding to the level, the parameter value of the parameter name corresponding to the level, and the logic symbol of the level in the logic symbol configuration data are concatenated into a key-value pair string for the level.

[0073] If the level corresponds to multiple parameter names, the parameter names corresponding to each sub-level of the level in the parameter name configuration data are determined. Furthermore, for each sub-level, the parameter name corresponding to the sub-level, the parameter value of the parameter name corresponding to the sub-level, and the logic symbol of the sub-level in the logic symbol configuration data are concatenated into a key-value pair string of the sub-level. After obtaining the key-value pair strings of multiple sub-levels of the level, the key-value pair strings of the multiple sub-levels of the level can be concatenated to obtain the key-value pair string of the level.

[0074] For example, in Figure 4 In the configuration interface shown, the user configures multiple parameter names, and the computer device can determine the corresponding hierarchical structure based on this. A recursive concatenation function can be used to perform concatenation operations starting from the outermost layer of the hierarchical structure to concatenate key-value pair strings of each layer.

[0075] Among them, the parameter name "name", as the outermost level in the hierarchical structure, corresponds to only one parameter name. The parameter name and the parameter value and logical symbols configured by the user for this level can be concatenated into a key-value pair string for this level. Assuming that the user configures the parameter value of this level as the "[text] Name" field, it means that the field value mapped to the "Name" field needs to be determined in the preset data source. The mapped field value can be determined from the data source, assuming it is "Yan". And, if Figure 4 As shown, the user configures the logical symbols of this level as multiple logical symbols such as parameter name left quotation mark, parameter name right quotation mark, key value separator, parameter value left quotation mark, parameter value right quotation mark, value separator, etc., so the above parameter name, parameter value and multiple logical symbols can be concatenated into a key-value pair string, for example, it can be expressed as follows:

[0076] "name": "Yan",

[0077] Among them, the "," in the key-value pair string represents a value separator, which is used to separate different key-value pair strings. That is, this value separator can be used to distinguish different key-value pair strings between multiple key-value pair strings, and this value separator does not need to be spliced ​​after the last key-value pair string.

[0078] Similarly, we can get Figure 4 The key-value pair strings of multiple levels such as the "age" parameter name and the "isStudent" parameter name are represented as follows:

[0079] "age": 26,

[0080] "isStudent": false,

[0081] In the parameter names configured by the user, the parameter name "contactInfo" corresponds to multiple parameter names, including "email", "phoneNumbers" and other parameter names, that is, a corresponding key-value pair string is generated for each sub-level of the level. For example, for the parameter name "email", its parameter name, corresponding parameter value and corresponding logical symbol can be concatenated into a key-value pair string, which can be expressed as follows:

[0082] "email":"yan@example.com",

[0083] As for the parameter name "phoneNumbers", it also corresponds to multiple parameter names, such as private phone number, home phone number, office phone number and other types of phone parameter names. You can concatenate the corresponding key-value pair string for each parameter name. For example, the key-value pair string of the parameter names of multiple phone types can be expressed as follows:

[0084] {

[0085] "type": "home",

[0086] "number": "123-456-7890"

[0087] },

[0088] {

[0089] "type": "office"

[0090] "number": "098-765-4321"

[0091] },

[0092] {

[0093] "type": "personal"

[0094] "number": "12345612345

[0095] }

[0096] Among them, "{" and "}" in the above key-value pair string are the starting character and the ending character respectively, which are used to limit a complete key-value pair string, that is, to limit the starting position and the ending position of the key-value pair string.

[0097] After obtaining the key-value pair strings of the parameter names of the above multiple phone types, the multiple key-value pair strings of the parameter names of the above multiple phone types can be further concatenated into a key-value pair string of the parameter name "phoneNumbers". Similarly, the key-value pair string of the parameter name "email" can be further concatenated with the key-value pair string of the parameter name "phoneNumbers" to obtain a key-value pair string of the parameter name "contactInfo", which can be expressed as follows:

[0098]

[0099] Therefore, users can flexibly configure the hierarchical structure of parameter data, various logical symbols and parameter values ​​through the interface, so that the data serialization format fully meets the requirements of specific business scenarios, greatly improving the applicability of the solution.

[0100] In some scenarios, some parameter names may correspond to multiple parameter values. Users can configure the parameter value type as "single-choice option" or "multiple-choice option" on the configuration interface. "Single-choice option" means that the parameter name has only one parameter value, and "multiple-choice option" means that the parameter name has multiple parameter values. For any level in the hierarchical structure, if the level corresponds to only one parameter name, the parameter value corresponding to the level can be further determined based on the parameter value configuration data of the level, that is, the parameter value configuration data of the level indicates that it is configured as "single-choice option", which means that the level corresponds to only one parameter value; if the parameter value configuration data of the level indicates that it is configured as "multiple-choice option", it means that the level corresponds to multiple parameter values. Therefore, if the level corresponds to multiple parameter values, the parameter name corresponding to the level, the multiple parameter values ​​corresponding to the level, and the logical symbol of the level in the logical symbol configuration data are concatenated into a key-value pair string of the level.

[0101] For example, Figure 4As shown, the parameter value type of the parameter name "hobbies" is configured as "multiple-select option", indicating that it corresponds to multiple parameter values. Therefore, the field value mapped to the "interest" field can be determined in the preset data source. Assuming that the field values ​​include reading, swimming, and hiking, and the mapped multiple field values ​​are determined as parameter values, the parameter name, its corresponding multiple parameter values, and the logical symbols at this level can be concatenated into a key-value pair string, which can be expressed as follows:

[0102] "hobbies": ["reading", "swimming", "hiking"],

[0103] Therefore, users can configure the type of parameter value according to actual business needs and business conditions, so that the configuration parameter name has one parameter value or the configuration parameter name has multiple parameter values, and can obtain all parameter values ​​according to the user's configuration and then concatenate the strings, so that the expression of the string meets the actual business conditions and business needs, thereby improving the applicability of the solution.

[0104] In some other optional implementations of this embodiment, when generating a key-value pair string, the computer device may also create a corresponding string concatenation task for each level of the hierarchical structure, and add the string concatenation tasks of each level to the execution queue in sequence according to the hierarchical relationship in the hierarchical structure. For example, starting from the outermost layer of the hierarchical structure, the string concatenation tasks of each level are added to the execution queue in sequence, such as Figure 4 As shown in the figure, the string concatenation task at the parameter name "name" level is added to the execution queue first, followed by the string concatenation task at the parameter name "age", and then the string concatenation task at the parameter name "isStudent", and so on, until all the string concatenation tasks at all levels are added to the execution queue.

[0105] In the entire recursive splicing process, the principle of recursive splicing from the parent level to the child level is always strictly followed to ensure the correctness of the hierarchical relationship. When the recursive splicing function traverses the entire hierarchical structure, it will eventually generate a string that fully conforms to the data structure configured by the user. This string contains all the string data generated by dynamic loop splicing.

[0106] For any target level in the hierarchical structure that has completed the string splicing task, when the key-value pair string of the target level is obtained, it is determined that the string splicing task of the target level is completed. The string splicing task of the target level in the execution queue can be deleted, and the string splicing task of the next level of the target level in the execution queue can be started to continue executing the string splicing task of the next level.

[0107] Therefore, by processing multiple hierarchical structures of data in sequence through the data processing principle of queues, orderly processing of data can be achieved. This is especially suitable for processing large-scale data and complex structured data. It can ensure that the data processing order is not disordered, which is conducive to determining the relationship between data of each hierarchical structure, and can reduce the difficulty and complexity of data processing, thereby improving data processing efficiency.

[0108] In some scenarios, parameter values ​​with different parameter names may be configured as the same field, and then mapped to the same field value in the preset data source, that is, the parameter values ​​with different parameter names are consistent. In this case, the levels mapped to the same field value can be marked. If the corresponding parameter value of one level has been determined, the parameter value of another level can be directly determined according to the pre-made mark, without having to determine the mapped field value in the preset data source, thereby reducing the consumption of processing resources and avoiding repeated execution of similar operations.

[0109] 305. After obtaining the key-value pair string of the target level in the hierarchical structure, verify the key-value pair string of the target level according to a preset string format;

[0110] In some other optional implementations of this embodiment, after obtaining the key-value pair string of the target level in the hierarchical structure, the computer device can verify the key-value pair string of the target level according to a preset string format. When the verification determines that there are erroneous characters in the key-value pair string of the target level, the erroneous characters can be corrected according to the preset string format.

[0111] The error character may be an error character corresponding to a parameter name, a parameter value or a logical symbol in a key-value pair string.

[0112] For example, a key-value pair string may have inconsistent parameter value types. For example, the preset string format specifies that a parameter value needs to be enclosed in quotation marks and that a parameter value does not need to be enclosed in quotation marks. If the preset string format specifies that a parameter value needs to be enclosed in quotation marks, but the parameter value in a key-value pair string is not enclosed in quotation marks, then it can be determined that the parameter value is an incorrect character, and the incorrect character can be corrected based on the preset string format to correct it to a parameter value enclosed in quotation marks.

[0113] Therefore, the automatic conversion and error correction capabilities for key-value pair strings are provided. When encountering situations such as inconsistent parameter value types, the accuracy of the spliced ​​string can be guaranteed to the greatest extent without affecting user operations.

[0114] In this embodiment, by combining hierarchical structure analysis and recursive splicing, complex hierarchical structures of large-scale data and complex structure data can be efficiently processed, and hierarchical structure analysis of big data can be directly performed without the need for pre-processing steps of data splitting. Key-value pair strings of multiple hierarchical structures can be recursively spliced ​​to achieve rapid output of structured data expected by users, greatly improving the efficiency of big data processing.

[0115] Moreover, users can flexibly configure the hierarchical structure of data, various parameter values, and logical symbols through the interface, and customize the data serialization format completely according to their own business needs to meet the personalized needs in different scenarios, greatly improving the flexibility and customization of data serialization to meet the unique needs of different business scenarios. Secondly, by automatically preparing dynamic data of parameter values ​​and efficient splicing logic, human intervention is reduced, and the efficiency and accuracy of data processing are improved. Furthermore, the cost of manual operation by users is reduced, and users no longer need to perform complex programming or complex manual data processing.

[0116] The data serialization method in the embodiment of the present application is described above. The computer device in the embodiment of the present application is described below. Figure 5 In the embodiment of the present application, one embodiment of the computer device includes:

[0117] A configuration unit, used to obtain parameter name configuration data, parameter value configuration data and logic symbol configuration data based on the configuration operation;

[0118] A parsing unit, used for performing hierarchical structure parsing on the parameter name configuration data to determine the hierarchical structure between the plurality of parameter names;

[0119] An acquiring unit, used for acquiring a parameter value corresponding to each parameter name according to the parameter value configuration data;

[0120] A generation unit is used to generate a key-value pair string for each level in the hierarchical structure according to the parameter name configuration data, the parameter values ​​corresponding to each parameter name and the logical symbol configuration data; wherein each key-value pair string includes a key-value pair consisting of a parameter name and its parameter value and a logical symbol.

[0121] In a preferred implementation manner of this embodiment, the generating unit is specifically used for:

[0122] For each level in the hierarchical structure, concatenate the parameter name of the level in the parameter name configuration data, the parameter value of the parameter name of the level, and the logic symbol of the level in the logic symbol configuration data into a key-value pair string of the level;

[0123] The key-value pair strings of the multiple levels in the hierarchical structure are concatenated to obtain the key-value pair string of the hierarchical structure.

[0124] In a preferred implementation manner of this embodiment, the generating unit is specifically used for:

[0125] Determine the parameter name corresponding to the level in the parameter name configuration data;

[0126] If the level corresponds to only one parameter name, the parameter name corresponding to the level, the parameter value of the parameter name corresponding to the level, and the logic symbol of the level in the logic symbol configuration data are concatenated into a key-value pair string of the level;

[0127] If the level corresponds to multiple parameter names, then determine the parameter names corresponding to each sub-level of the level in the parameter name configuration data, and,

[0128] For each sub-level, concatenate the parameter name corresponding to the sub-level, the parameter value of the parameter name corresponding to the sub-level, and the logic symbol of the sub-level in the logic symbol configuration data into a key-value pair string of the sub-level;

[0129] The key-value pair strings of multiple sub-levels of the level are concatenated to obtain the key-value pair string of the level.

[0130] In a preferred implementation of this embodiment, if the level corresponds to only one parameter name, the generating unit is specifically used for:

[0131] Determine the parameter value corresponding to the level according to the parameter value configuration data;

[0132] If the level corresponds to multiple parameter values, the parameter name corresponding to the level, the multiple parameter values ​​corresponding to the level, and the logic symbol of the level in the logic symbol configuration data are concatenated into a key-value pair string of the level.

[0133] In a preferred implementation of this embodiment, the computer device further includes:

[0134] A task management unit, configured to create a corresponding string concatenation task for each level of the hierarchical structure, and sequentially add the string concatenation tasks of each level to an execution queue according to the hierarchical relationship in the hierarchical structure;

[0135] When the key-value pair string of the target level in the hierarchical structure is obtained, it is determined that the string concatenation task of the target level is completed, the string concatenation task of the target level in the execution queue is deleted, and the string concatenation task of the next level of the target level in the execution queue is started.

[0136] In a preferred implementation of this embodiment, the computer device further includes:

[0137] A verification unit, configured to verify the key-value pair string of the target level in the hierarchical structure according to a preset string format after obtaining the key-value pair string of the target level in the hierarchical structure;

[0138] When the verification determines that the key-value pair string of the target level has erroneous characters, the erroneous characters are corrected according to the preset string format.

[0139] In a preferred implementation manner of this embodiment, the acquisition unit is specifically used for:

[0140] If the parameter value configuration data includes a user input value, the user input value is used as the parameter value of the corresponding parameter name;

[0141] If the parameter value configuration data includes a field identifier, a field value mapped by the field identifier is determined in a preset data source, and the field value mapped by the field identifier is used as a parameter value of the corresponding parameter name;

[0142] If the parameter value configuration data includes an operation formula, and the operation formula includes multiple field identifiers, then the field value mapped by each field identifier in the operation formula is determined in the preset data source, and the field value mapped by each field identifier is substituted into the operation formula for calculation, and the calculation result is obtained as the parameter value of the corresponding parameter name.

[0143] In this embodiment, the operations performed by each unit in the computer device are the same as those described above. Figures 2 to 3 The description in the illustrated embodiment is similar and will not be repeated here.

[0144] The computer device in the embodiment of the present application is described below. Figure 6 In the embodiment of the present application, one embodiment of the computer device includes:

[0145] The computer device 600 may include one or more central processing units (CPU) 601 and a memory 605 , wherein the memory 605 stores one or more application programs or data.

[0146] The memory 605 may be a volatile storage or a persistent storage. The program stored in the memory 605 may include one or more modules, each of which may include a series of instruction operations in the computer device. Furthermore, the central processing unit 601 may be configured to communicate with the memory 605 and execute a series of instruction operations in the memory 605 on the computer device 600.

[0147] The computer device 600 may also include one or more power supplies 602, one or more wired or wireless network interfaces 603, one or more input and output interfaces 604, and / or one or more operating systems, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0148] The CPU 601 can execute the aforementioned Figures 2 to 3 The operations performed by the computer device in the illustrated embodiment will not be described in detail here.

[0149] The present application also provides a computer storage medium, wherein one embodiment includes: the computer storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the aforementioned Figures 2 to 3 The operations performed by the computer device in the illustrated embodiment.

[0150] The present application also provides a computer program product, wherein one embodiment includes: when the computer program product is run on a computer device, the computer device executes the aforementioned Figures 2 to 3 The operations performed by the computer device in the illustrated embodiment.

[0151] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0152] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0153] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0154] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0155] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A data serialization method, characterized in that: The method comprises: Acquire parameter name configuration data, parameter value configuration data, and logic symbol configuration data based on the configuration operation; Performing hierarchical structure analysis on the parameter name configuration data to determine the hierarchical structure between the multiple parameter names; Obtaining parameter values ​​corresponding to each parameter name according to the parameter value configuration data; A key-value pair string of each level in the hierarchical structure is generated according to the parameter name configuration data, the parameter values ​​corresponding to each parameter name and the logical symbol configuration data; wherein each key-value pair string includes a key-value pair consisting of a parameter name and its parameter value and a logical symbol.

2. The method according to claim 1, characterized in that The step of generating a key-value pair string for each level in the hierarchical structure according to the parameter name configuration data, the parameter value corresponding to each parameter name, and the logic symbol configuration data includes: For each level in the hierarchical structure, concatenate the parameter name of the level in the parameter name configuration data, the parameter value of the parameter name of the level, and the logic symbol of the level in the logic symbol configuration data into a key-value pair string of the level; The key-value pair strings of the multiple levels in the hierarchical structure are concatenated to obtain the key-value pair string of the hierarchical structure.

3. The method according to claim 2, characterized in that The step of concatenating the parameter name of the level in the parameter name configuration data, the parameter value of the parameter name of the level, and the logic symbol of the level in the logic symbol configuration data into a key-value pair string of the level includes: Determine the parameter name corresponding to the level in the parameter name configuration data; If the level corresponds to only one parameter name, the parameter name corresponding to the level, the parameter value of the parameter name corresponding to the level, and the logic symbol of the level in the logic symbol configuration data are concatenated into a key-value pair string of the level; If the level corresponds to multiple parameter names, then determine the parameter names corresponding to each sub-level of the level in the parameter name configuration data, and, For each sub-level, concatenate the parameter name corresponding to the sub-level, the parameter value of the parameter name corresponding to the sub-level, and the logic symbol of the sub-level in the logic symbol configuration data into a key-value pair string of the sub-level; The key-value pair strings of multiple sub-levels of the level are concatenated to obtain the key-value pair string of the level.

4. The method according to claim 3, characterized in that If the level corresponds to only one parameter name, the parameter name corresponding to the level, the parameter value of the parameter name corresponding to the level, and the logic symbol of the level in the logic symbol configuration data are concatenated into a key-value pair string of the level, including: Determine the parameter value corresponding to the level according to the parameter value configuration data; If the level corresponds to multiple parameter values, the parameter name corresponding to the level, the multiple parameter values ​​corresponding to the level, and the logic symbol of the level in the logic symbol configuration data are concatenated into a key-value pair string of the level.

5. The method according to claim 1, characterized in that The method further comprises: Creating a corresponding string concatenation task for each level of the hierarchical structure, and sequentially adding the string concatenation tasks of each level to an execution queue according to the hierarchical relationship in the hierarchical structure; When the key-value pair string of the target level in the hierarchical structure is obtained, it is determined that the string concatenation task of the target level is completed, the string concatenation task of the target level in the execution queue is deleted, and the string concatenation task of the next level of the target level in the execution queue is started.

6. The method according to claim 1, characterized in that After obtaining the key-value pair string of the target level in the hierarchical structure, the method further includes: Verifying the key-value pair string of the target level according to a preset string format; When the verification determines that the key-value pair string of the target level has erroneous characters, the erroneous characters are corrected according to the preset string format.

7. The method according to any one of claims 1 to 6, characterized in that: The acquiring the parameter value corresponding to each parameter name according to the parameter value configuration data includes: If the parameter value configuration data includes a user input value, the user input value is used as the parameter value of the corresponding parameter name; If the parameter value configuration data includes a field identifier, a field value mapped by the field identifier is determined in a preset data source, and the field value mapped by the field identifier is used as a parameter value of the corresponding parameter name; If the parameter value configuration data includes an operation formula, and the operation formula includes multiple field identifiers, then the field value mapped by each field identifier in the operation formula is determined in the preset data source, and the field value mapped by each field identifier is substituted into the operation formula for calculation, and the calculation result is obtained as the parameter value of the corresponding parameter name.

8. A computer device, characterized in that: The computer device comprises: A configuration unit, used to obtain parameter name configuration data, parameter value configuration data and logic symbol configuration data based on the configuration operation; A parsing unit, used for performing hierarchical structure parsing on the parameter name configuration data to determine the hierarchical structure between the plurality of parameter names; An acquiring unit, used for acquiring a parameter value corresponding to each parameter name according to the parameter value configuration data; A generation unit is used to generate a key-value pair string for each level in the hierarchical structure according to the parameter name configuration data, the parameter values ​​corresponding to each parameter name and the logical symbol configuration data; wherein each key-value pair string includes a key-value pair consisting of a parameter name and its parameter value and a logical symbol.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer storage medium, characterized in that: The computer storage medium stores instructions, and when the instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 7.

11. A computer program product, characterized in that When the computer program product is executed on a computer device, the computer device is caused to perform the method according to any one of claims 1 to 7.