Rule entry json file compression method and device and storage medium

By merging and cleaning the rule input data of the financial business system and constructing the optimized root table, and using the optimized root table to compress the data, the problem of low JSON file compression efficiency in the existing technology is solved and efficient data compression is achieved. and processing.

CN119337826AActive Publication Date: 2025-01-21WEBANK (CHINA)
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411369375.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-21
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

In financial transaction scenarios, the compression efficiency of the existing technology for json files is low, especially because the size of the encoded dictionary is comparable to the size of the json file before compression, resulting in low compression efficiency when frequently rereading the encoded dictionary.

Method used

By obtaining the rule input data of the financial business system, perform data merging and preset cleaning, use the optimal splitting algorithm to split the key data, build a preferred root table, and compress the rule input data according to the table to generate a preferred root tree. , and then serialize it to generate a compressed json file.

Benefits of technology

Realize efficient data compression, reduce data storage space, and at the same time, no need to rely on encoding dictionary, improve data processing efficiency, and improve the compression efficiency of the JSON file.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337826A_ABST
    Figure CN119337826A_ABST
Patent Text Reader

Abstract

The invention discloses a rule entry parameter json file compression method and device and a storage medium, and the method comprises the steps: obtaining rule entry parameter data of a financial business system in a first preset time period, and obtaining first rule entry parameter data; performing data merging processing on the first rule entry parameter data to obtain second rule entry parameter data; obtaining first key data in the second rule entry parameter data, and performing preset cleaning operation on the first key data to obtain second key data; splitting the second key data according to an optimal splitting algorithm to obtain an optimal root table; obtaining rule entry parameter data of the financial service system in a second preset time period to obtain target rule entry parameter data; compressing the target rule entry parameter data according to the preferred root table to obtain a preferred root tree; and serializing the preferred root tree to generate a compressed target json file. By adopting the embodiment of the invention, the compression efficiency of the json file is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data compression, and in particular to a JSON file compression method, device and storage medium with rule input. Background Art

[0002] In financial transaction scenarios, complex business logic is generally controlled by rule engines. To facilitate rapid verification and batch testing, rule input parameters are often saved in JSON files (JavaScript Object Notation) in hive (Hive Data Warehouse Software).

[0003] Since the JSON file storing the rule input parameters is large, it is usually necessary to compress the JSON file when writing it to Hive. This is usually done by abbreviating the key of the JSON file, re-encoding the key into a key with a length of 1, and caching the key encoding dictionary on the client. The disadvantage of this method is that if the dictionary changes, the latest encoding dictionary needs to be read from the server again. The size of the encoding dictionary is often comparable to the size of the JSON file before compression. If the encoding dictionary needs to be re-read each time, the compression effect cannot be achieved, resulting in low compression efficiency.

[0004] Therefore, in financial transaction scenarios, the problem of how to improve the compression efficiency of JSON files needs to be solved urgently. Summary of the invention

[0005] The embodiments of the present application provide a JSON file compression method, device and storage medium with rule input, which improves the compression efficiency of the JSON file.

[0006] In a first aspect, an embodiment of the present application provides a JSON file compression method for rule input, which is applied to a financial business system, and the method includes:

[0007] Obtaining rule input parameter data of the financial service system within a first preset time period to obtain first rule input parameter data;

[0008] Performing data merging processing on the first rule input parameter data to obtain the second rule input parameter data;

[0009] Obtain the first key data in the second rule input parameter data, perform a preset cleaning operation on the first key data, and obtain the second key data;

[0010] Splitting the second key data according to a preferred splitting algorithm to obtain a preferred root word table;

[0011] Obtaining rule input parameter data of the financial business system within a second preset time period to obtain target rule input parameter data; the start time of the second preset time period is later than the end time of the first preset time period;

[0012] Compressing the target rule input parameter data according to the preferred root table to obtain a preferred root tree;

[0013] The preferred root tree is serialized to generate a compressed target json file.

[0014] In a second aspect, an embodiment of the present application provides a JSON file compression device with rule input, which is applied to a financial business system. The device includes: an acquisition unit, a control unit, and a splitting unit, wherein:

[0015] The acquisition unit is used to acquire the rule input parameter data of the financial service system within a first preset time period to obtain the first rule input parameter data;

[0016] The control unit is used to perform data merging processing on the first rule input parameter data to obtain the second rule input parameter data;

[0017] The acquisition unit is further used to acquire the first key data in the second rule input parameter data, and perform a preset cleaning operation on the first key data to obtain the second key data;

[0018] The splitting unit is used to split the second key data according to a preferred splitting algorithm to obtain a preferred root word table;

[0019] The acquisition unit is further used to acquire the rule input parameter data of the financial business system within a second preset time period to obtain the target rule input parameter data; the start time of the second preset time period is later than the end time of the first preset time period;

[0020] The splitting unit is further used to compress the target rule input parameter data according to the preferred root table to obtain a preferred root tree;

[0021] The control unit is also used to serialize the preferred root tree to generate a compressed target json file.

[0022] In a third aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute some or all of the steps described in the first aspect of the present application.

[0023] In a fourth aspect, the present application provides an electronic device comprising: a processor and a memory, wherein the memory is used to store one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the processor, and the program includes instructions for executing the steps in the first aspect of the present application.

[0024] In a fifth aspect, the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the present application. The computer program product may be a software installation package.

[0025] The implementation of this application has the following beneficial effects:

[0026] It can be seen that the rule input json file compression method described in the present application is applied to a financial business system, and the method includes: obtaining the rule input data of the financial business system within a first preset time period to obtain the first rule input data; performing data merging processing on the first rule input data to obtain the second rule input data; obtaining the first key data in the second rule input data, performing a preset cleaning operation on the first key data to obtain the second key data; splitting the second key data according to the preferred splitting algorithm to obtain a preferred root table; obtaining the rule input data of the financial business system within the second preset time period to obtain the target rule input data; compressing the target rule input data according to the preferred root table to obtain a preferred root tree; serializing the preferred root tree to generate a compressed target json file, compressing the target rule input data according to the preferred root table to obtain a preferred root tree, the preferred root tree is an efficient data structure that can merge and compress similar data to reduce data storage space, and at the same time, the preferred root tree can quickly retrieve and query data without relying on a coding dictionary, thereby improving data processing efficiency and thus improving the compression efficiency of the json file. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0028] Figure 1 It is a structural diagram of a financial business system provided by an embodiment of the present application;

[0029] Figure 2 It is a flowchart of a JSON file compression method with rule input provided in an embodiment of the present application;

[0030] Figure 3is a schematic diagram of a preferred root tree provided in an embodiment of the present application;

[0031] Figure 4 is a schematic diagram of another preferred root tree provided in an embodiment of the present application;

[0032] Figure 5 It is a functional unit composition block diagram of a JSON file compression device with rule input provided in an embodiment of the present application;

[0033] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0035] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0036] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0037] The electronic devices described in the embodiments of the present application may include smart phones (such as Android phones, iOS phones, Windows Phone phones, etc.), tablet computers, PDAs, laptops, video matrices, monitoring platforms, mobile Internet devices (mobile internet devices, MID) or wearable devices, etc. The above are only examples and not exhaustive, including but not limited to the above devices. Of course, the above electronic devices can also be servers, for example, cloud servers.

[0038] The following is an explanation of some professional terms involved in this application:

[0039] json (JavaScript Object Notation): is a lightweight data exchange format. json data consists of key-value pairs, where both the key and the value must be enclosed in double quotes and the key-value pairs are separated by commas.

[0040] Rule input parameters: A set of N groups of risk variables. To facilitate data analysis or batch testing, they are generally stored in a single-level JSON field. In financial scenarios, rule input parameters have the following characteristics: long key fields, no duplication of single rule input parameters, regular parameter naming, same-type rule input parameters have the same prefix, arrays are also represented in a single level, and array subscripts are distinguished by [numbers].

[0041] Risk variable: a set of key-value pairs, where the key represents the risk variable name and the value represents the variable value, for example, {"name":"10"}.

[0042] Hive (Hive Data Warehouse Software): A data warehouse tool based on Hadoop. Hive can map structured data files into a database table and provide SQL-like query functions for querying and analyzing large-scale data stored in the Hadoop distributed file system. It allows developers who are familiar with SQL to easily perform data query, aggregation, analysis and other operations without having to directly write complex operation programs.

[0043] Serialization: converting the data structure of the preferred word root tree into a format that can be persistently stored or transmitted, usually in text format, according to a specific rule, so that it can be read and restored in different systems, environments or time points. The reverse process of serialization is deserialization. When the preferred word root tree is needed, the data can be read from the serialized format and restored to the original tree data structure.

[0044] See also Figure 1 , Figure 1 It is a structural diagram of a financial business system provided in an embodiment of the present application; it can be seen that the financial business system includes: a preferred root table modeling system, a business system, a db (database), a data extraction module, a hive, and a data processing module, wherein the preferred root table modeling system includes: a data acquisition module, a data cleaning module, a preferred root table construction module, a first communication module, etc., which are not limited here; the business system includes: a second communication module, a business processing module, etc., which are not limited here.

[0045] Among them, the preferred root table modeling system is used to construct the preferred root table. Specifically, the historical rule input data of the financial business system is collected through the data collection module, which is the basis for constructing the optimal root table. By collecting historical data, the various situations and changing trends of the rule input in the business system can be understood; the collected historical rule input data is cleaned by the data cleaning module, for example, invalid data, noise data and abnormal data are removed, etc., to improve the quality and reliability of the data; the preferred root table construction module constructs the latest optimal root table according to the cleaned data; the first communication module is used to realize the communication between the preferred root table modeling system and the business system, and push the constructed optimal root table to the business system to ensure that the business system can obtain the latest root table information in time for compression and processing of rule input.

[0046] Among them, the business system is used to receive the preferred root table of the preferred root table modeling system, and process the rule input parameter data according to the preferred root table to obtain the preferred root tree. Specifically, the optimal root table pushed by the preferred root table modeling system is received through the second communication module, and the rule input parameter data in the business system is processed according to the received optimal root table through the business processing module to convert it into a more compact and efficient data structure, namely, the optimal root tree.

[0047] Among them, db is used to store the optimal root tree data compressed by the business system. As a persistent storage medium for data, the database db can safely save the rule input parameter data processed by the business system for subsequent query and analysis.

[0048] The data extraction module is responsible for asynchronously writing the JSON data of the optimal root tree of the rule input from the database of the application system to Hive, realizing the transfer of data from the database of the business system to Hive for large-scale data storage and analysis.

[0049] Hive, as a data warehouse, stores the optimal root tree data of rule input parameters extracted from the business system database. Hive provides large-scale data storage and analysis capabilities, and can perform complex query and analysis operations on rule input parameter data. Hive can also provide data for business personnel to analyze the business situation of the financial business system.

[0050] The data processing module is used to deserialize the optimal root tree and further process and analyze the data read from hive to meet specific business needs. For example, the optimal root tree data in hive is deserialized into a data structure in memory, and data cleaning, conversion, aggregation and other operations are performed to generate reports, analysis results and other outputs to provide more valuable information for business decisions.

[0051] See also Figure 2 , Figure 2 This is a flowchart of a JSON file compression method for rule input provided by an embodiment of the present application, which is applied to a financial business system. The method includes:

[0052] S201. Obtain rule input parameter data of the financial service system within a first preset time period to obtain first rule input parameter data.

[0053] In the embodiment of the present application, the first preset time period can be preset or defaulted in advance. For example, the first preset time period can be the past week, month, or year. The structure of the financial business system can be as follows: Figure 1 shown.

[0054] In a specific embodiment, the rule input parameter data of the financial business system is generally stored in hive in the form of JSON, and the hive query language can be used to obtain the rule input parameter data within a first preset time period in hive, thereby obtaining the first rule input parameter data.

[0055] S202: Perform data merging processing on the first rule input parameter data to obtain second rule input parameter data.

[0056] In an embodiment of the present application, data merging processing can be performed on the first rule input data to obtain the second rule input data. Specifically, the data merging processing can be a daily merging, in which the data in the first rule input data is merged by time, and the data on the same day are merged together to obtain merged data. Then, the merged data can be checked to ensure the accuracy of the data merging. Some data can be randomly selected for verification, or compared with the original data to ensure that the merged result meets expectations. For example, it can be checked whether the sum of the merged data is consistent with the sum of the original data, or whether the number of merged data items meets expectations. In addition, if an abnormal situation occurs during the merging process, such as data type mismatch, missing values, etc., data filling, data type adjustment and other operations can be performed according to the specific situation. For example, if a field has missing values, it can be filled using the mean, median or other suitable methods. If the data type does not match, type conversion can be performed.

[0057] S203. Obtain the first key data in the input parameter data of the second rule, perform a preset cleaning operation on the first key data, and obtain the second key data.

[0058] In an embodiment of the present application, key data refers to the names of each key of the rule input parameter stored in a single-level JSON field. For example, assuming that a rule input parameter is {"loan_amount":50000}, then the key of the rule input parameter is loan_amount, and 50000 is the value.

[0059] In a specific embodiment, the first key data in the second rule input parameter data is obtained. Specifically, since the second rule input parameter data is stored in the form of json, a language suitable for processing json data can be selected, such as Python, JavaScript, etc. These languages ​​usually have special libraries to process json data. All key values ​​in the second rule input parameter data, that is, the first key data, can be obtained by traversing the key list. Then, a preset cleaning operation can be performed on the first key data to obtain the second key data.

[0060] Optionally, step S203, performing a preset cleaning operation on the first key data to obtain the second key data may include the following steps:

[0061] S31, obtaining the first array key in the first key data, and obtaining k first array keys; k is a natural number;

[0062] S32, using a preset replacement method to replace the array index of each first array key in the k first array keys with a preset character, to obtain k second array keys after replacement;

[0063] S33, performing deduplication processing on the k second array keys to obtain h second array keys; h is a natural number less than or equal to k;

[0064] S34, replacing the k first array keys in the first key data with the h second array keys to obtain reference second key data;

[0065] S35. Sort the reference second key data according to a preset sorting method to obtain the second key data.

[0066] In the embodiments of the present application, the preset replacement method, preset characters, and preset sorting method can all be preset or defaulted in advance; the array key refers to the key of the data item stored in the form of an array in the rule input data.

[0067] In a specific embodiment, a key of array type can be first found from the first key data to obtain k first array keys; then, a preset replacement method can be used to replace the array index of each first array key in the k first array keys with a preset character to obtain k replaced second array keys. Specifically, the preset replacement method can be a regular expression, and the preset character can be "*". The regular expression is used to replace the array index in the k first array keys with "*" to obtain k second array keys. For example, assuming that an array key is bs_score_1[1], after replacement, it becomes bs_score_1[*]. Since regular expressions are conventional techniques, they will not be described here.

[0068] Furthermore, the k second array keys can be deduplicated by deleting duplicate array keys therein to obtain h second array keys without duplicate array keys; then, the k first array keys in the first key data can be replaced by the h second array keys to obtain reference second key data; then, the reference second key data can be sorted according to a preset sorting method to obtain second key data. Specifically, the preset sorting method can be a natural sequence sorting method, and the keys in the reference second key data are sorted according to the natural sequence sorting method to obtain the second key data. For example, assuming there are 3 keys, their order in the reference second key data is: als.score2, bs_score_[*], als.score1, then after the preset sorting method, their order is: als.score1, als.score2, bs_score_[*].

[0069] Among them, the Natural Sort Order is a method for sorting strings according to human habits, and is particularly suitable for strings containing numbers.

[0070] In this way, by obtaining the first array key in the first key data, k first array keys are obtained; the array index of each first array key in the k first array keys is replaced with a preset character by a preset replacement method to obtain k second array keys after replacement; the k second array keys are deduplicated to obtain h second array keys; the k first array keys in the first key data are replaced by h second array keys to obtain reference second key data; the reference second key data is sorted according to a preset sorting method to obtain the second key data.

[0071] S204. Split the second key data according to a preferred splitting algorithm to obtain a preferred root word table.

[0072] Optionally, step S204, splitting the second key data according to the preferred splitting algorithm to obtain a preferred root word table may include the following steps:

[0073] S1. Determine the key contained in the second key data to obtain i keys, wherein the i keys constitute a set S; i is a positive integer;

[0074] S2. Obtain the prefixes corresponding to the i keys to obtain m prefixes; there is no duplicate prefix among the m prefixes; m is a positive integer less than or equal to i;

[0075] S3, determining the prefixes that meet the target condition among the m prefixes, obtaining j prefixes, wherein the j prefixes form a set P; j is a positive integer less than or equal to m;

[0076] S4. Calculate the profit coefficient of each key in the set S by using the prefix in the set P to split it according to the preset first profit calculation formula, and obtain a profit coefficient; a is equal to the value of i multiplied by j;

[0077] S5, determining the profit matrix Aij corresponding to the a profit coefficients;

[0078] S6, determining all possible prefix arrangement orders of the prefixes in the set P, and obtaining x prefix arrangement orders; m is a positive integer;

[0079] S7, split each key in the set S according to the arrangement order of the x prefixes and the j prefixes to obtain m target splitting results;

[0080] S8, determining a first-level preferred root table according to the benefit matrix Aij and the m target splitting results;

[0081] The first-level preferred root table is iterated according to steps S1-S8 until a preset number of iterations is reached, or the number of elements in the set P is zero, and the iteration ends to obtain the preferred root table.

[0082] In the embodiment of the present application, the preset number of times can be preset in advance or defaulted.

[0083] In a specific embodiment, the key contained in the second key data can be determined to obtain i keys, and then the i keys are combined into a set S; then, the prefixes corresponding to the i keys can be obtained to obtain m prefixes. Specifically, the prefix corresponding to each of the i keys can be obtained to obtain w prefixes, where w is an integer greater than or equal to i. This is because a key can be split in multiple ways, that is, a key can correspond to multiple prefixes. For example, assuming that a key is pbc_info.detail.detail_loan[*].detai l_ag_begin_dt, then the prefix of the key can be one of the following: "pbc_info", "pbc_info.detail", etc.; then, the w prefixes can be deduplicated to remove the repeated prefixes, thereby obtaining m prefixes, and then, the prefixes that meet the target conditions among the above m prefixes can be determined to obtain j prefixes, and these j prefixes form a set P; further, the profit coefficient of each key in the set S using the prefixes in the set P is calculated according to the preset first profit calculation formula, and the first profit calculation formula is as follows:

[0084] c=((ky)*nk) / n;

[0085] Among them, c is the profit coefficient of prefix c, and prefix c is any prefix among j prefixes; k is the length of prefix c; n is the number of keys split by prefix c; y is the preset pointer length, and y is an integer greater than or equal to 3, which is used to adjust the compression rate of data. The larger y is, the smaller the compression rate is. In the embodiment of the present application, in order to maximize the compression rate, y=3 can be set; according to the first profit calculation formula, a times of calculation can be obtained to obtain a profit coefficients; then, the corresponding profit matrix Aij can be constructed according to these a profit coefficients, as follows:

[0086]

[0087] Among them, A ij represents the profit coefficient of splitting the i-th word using the j-th word prefix, A ij The following conditions are met:

[0088]

[0089] Next, all possible prefix permutations of the prefixes in the set P can be determined, and the j prefix permutations in the set P can be calculated according to the permutation and combination calculation formula to obtain x prefix permutations. The permutation and combination calculation formula is a conventional technique and is not limited here.

[0090] Among them, A(n, m) represents the number of all permutations of taking m elements from n different elements; let n=j, m=j, and substitute them into the formula to calculate and get x; then, each key in the set S can be split according to the arrangement order of the x prefixes and the j prefixes to get m target splitting results; then, the first-level preferred root table can be determined according to the benefit matrix Aij and the m target splitting results.

[0091] Furthermore, since the first-level preferred root table may be further split, the first-level preferred root table may be iteratively processed according to steps S1-S8 until a preset number of iterations are reached, or the number of elements in set P is zero, the iteration ends, and a preferred root table is obtained.

[0092] In this way, by determining the key in the second key data and obtaining the corresponding prefix, the data can be preliminarily structured, making the complex data set clearer and facilitating subsequent data processing and analysis. In addition, by calculating the profit coefficient of splitting each key using different prefixes, the value of different splitting methods can be quantified, thereby selecting the optimal splitting scheme and improving the data compression rate.

[0093] Optionally, step S3, determining the prefixes that meet the target condition among the m prefixes to obtain j prefixes, may include the following steps:

[0094] A1. Obtain a target prefix; the target prefix is ​​any one of the m prefixes;

[0095] A2, determining a target prefix length of the target prefix;

[0096] A3. Determine the key of the target word prefix in the set S, and obtain b keys; b is a positive integer less than or equal to i;

[0097] A4. When the length of the target prefix is ​​greater than a preset length and b is greater than a preset value, determine that the target prefix is ​​one of the j prefixes.

[0098] In the embodiment of the present application, the preset length and the preset value can be preset in advance or defaulted.

[0099] In a specific embodiment, a target prefix can be obtained; then, a string processing function can be used to measure the character length of the target prefix, and the character length can be used as the target prefix length. For example, in Python, the len() function can be used to obtain the length of the string; then, the key of the target prefix included in the set S can be determined to obtain b keys. Specifically, a matching rule can be defined based on the characteristics of the target prefix. The matching rule can be one of the following: full match, partial match, regular expression match, etc., which are not limited here; according to the matching rule, the set S is traversed to find the key containing the target prefix to obtain b keys; when the target prefix length is greater than the preset length, and b is greater than the preset value, the target prefix is ​​determined to be one of the j prefixes.

[0100] In this way, by obtaining the target prefix; determining the target prefix length of the target prefix; determining the key of the target prefix included in the set S, b keys are obtained; when the target prefix length is greater than the preset length and b is greater than the preset value, the target prefix is ​​determined to be one of the j prefixes, and by obtaining the length of the target prefix and the number of target prefixes included in the set S, a double judgment is made based on the length and the number, so that those less important or irrelevant prefixes are excluded, thereby reducing the workload of data processing and analysis.

[0101] Optionally, step S7, splitting each key in the set S according to the arrangement order of the x prefixes and the j prefixes to obtain m target splitting results, may include the following steps:

[0102] B1. Obtain a first prefix arrangement sequence; the first prefix arrangement sequence is any prefix arrangement sequence among the x prefix arrangement sequences;

[0103] B2. Splitting each key in the set S using the prefixes in the j prefixes in turn according to the arrangement order of the first prefixes, to obtain a first splitting results;

[0104] B3. Determine a target splitting result corresponding to the first prefix arrangement order according to the a first splitting results.

[0105] In the embodiment of the present application, the first prefix arrangement order can be obtained first; then, each key in the set S can be split using the prefixes of the j prefixes in turn according to the first prefix arrangement order to obtain a first splitting results. For example, assuming that the first prefix arrangement order is: pbc_info, pbc_info.detail; assuming that the set S is {pbc_info.detail.detail_loan[*].detail_ag_begin_dt, pbc_info.detail.ag_dddd}, then the set S is split according to the first prefix arrangement order. First, the set S is split by pbc_info to obtain the first part of the splitting results: pbc_info, .detail.detail_loan[*].d etail_ag_begin_dt, pbc_info, .detail.ag_dddd, and secondly, the first part of the split result is further split through pbc_info.detail. However, since pbc_info.detail contains pbc_info, if the set S is split through pbc_info first, pbc_info.detail cannot split the first part of the split result, because the data in the first part of the split result does not contain the complete pbc_info.detail, that is, the first part of the split result is the final split result; finally, the target split result corresponding to the first prefix arrangement order can be determined according to the a first split results. For example, the target split result can include a first split results.

[0106] Optionally, step S8, determining the first-level preferred root table according to the benefit matrix Aij and the m target splitting results, may include the following steps:

[0107] C1. Determine the splitting matrix corresponding to each target splitting result in the m target splitting results, and obtain m splitting matrices; each splitting matrix is ​​a matrix with the same number of columns and rows as the profit matrix Aij;

[0108] C2. Multiply each of the m split matrices by the profit matrix Aij to obtain m target profit matrices;

[0109] C3. Calculate the sum of the profit coefficients of each target profit matrix in the m target profit matrices according to a preset second profit calculation formula to obtain m sums of profit coefficients;

[0110] C4, determining the maximum value among the sum of the m profit coefficients, determining the prefix arrangement order corresponding to the maximum value in the x prefix arrangement orders, and obtaining the target prefix arrangement order;

[0111] C5. Determine the first-level preferred root table according to the target prefix arrangement order and the set S.

[0112] In the embodiment of the present application, the profit coefficients and are used to evaluate the compression profit of splitting the set S, that is, the larger the profit coefficients and are, the greater the compression rate.

[0113] In a specific embodiment, a splitting matrix can be constructed according to m target splitting results to obtain m splitting matrices, wherein the target splitting matrix is ​​specifically:

[0114]

[0115] Among them, the target splitting matrix is ​​any matrix among the m splitting matrices, O ij Indicates whether the i-th word contains the j-th word head, O ij The following conditions are met:

[0116]

[0117] Next, each of the m split matrices can be multiplied by the profit matrix Aij to obtain m target profit matrices. Since matrix multiplication is a conventional technique, it is not limited here. The profit coefficient and of each target profit matrix in the m target profit matrices are calculated according to the preset second profit calculation formula. The second profit calculation formula is as follows:

[0118]

[0119] Among them, C1 is any split matrix among the m split matrices; Cm is the sum of the profit coefficients of C1. According to the formula, it can be seen that the sum of the profit coefficients is the sum of all elements in the target profit matrix; according to the above second profit calculation formula, m sums of profit coefficients can be calculated m times; then, the maximum value of the m sums of profit coefficients can be found, and the prefix arrangement order corresponding to the maximum value in the x prefix arrangement orders can be determined to obtain the target prefix arrangement order; the key in the set S can be split according to the target prefix arrangement order to obtain multiple split results, and these multiple split results are arranged into a table to obtain the first-level preferred root table. For example, assuming that the set S = [all.qry_date, als.score1, bs_score_1[*]], and the multiple split results are all.qry, _date, als.score, 1, bs_score, _1[*], then the first-level preferred root table is as follows:

[0120] Key First level prefix Second level prefix ······ n-level prefix root all.qry_date all.qry _date als.score1 als.score 1 bs_score_1[*] bs_score _1[*]

[0121] In this way, by multiplying the splitting matrix and the benefit matrix to obtain the target benefit matrix, the benefit quantification of each splitting result is achieved. This quantification method can comprehensively consider the impact of multiple factors on the splitting results and provide a comprehensive evaluation index, thereby being able to more accurately evaluate the value of the splitting results.

[0122] S205. Obtain the rule input parameter data of the financial business system within a second preset time period to obtain the target rule input parameter data; the start time of the second preset time period is later than the end time of the first preset time period.

[0123] In the embodiment of the present application, the second preset time period can be preset in advance or defaulted.

[0124] In a specific embodiment, hive query language can be used to obtain the rule input parameter data within the second preset time period in hive to obtain the target rule input parameter data.

[0125] S206. Compress the target rule input parameter data according to the preferred root word table to obtain a preferred root word tree.

[0126] In an embodiment of the present application, the key data in the target rule input data can be split and compressed according to the prefixes and roots in the preferred root table to obtain a preferred root tree.

[0127] Optionally, step S206, compressing the target rule input parameter data in the financial business system according to the preferred root table to obtain a preferred root tree, includes:

[0128] D1. Obtain the third key data corresponding to the input parameter data of the target rule;

[0129] D2. Split each key in the third key data according to the preferred root table to obtain a plurality of second split results; each split result includes at least one prefix and one root;

[0130] D3. Construct multiple nodes according to the prefixes and roots in the multiple second split results, and connect them according to the character sequence in the third key data to obtain the preferred root tree; each node corresponds to a prefix or root.

[0131] In the embodiment of the present application, the third key data corresponding to the input parameter data of the target rule can be obtained. Specifically, the method for obtaining the third key data can be the same as the method for obtaining the first key data mentioned above; then, each key in the third key data can be split according to the preferred root table to obtain multiple second split results. Specifically, for each key, first, it can be checked in turn whether it contains the first-level prefix in the preferred root table, and the string matching method can be used. If the match is successful, the key is split according to the matched prefix to obtain multiple third split results. For example, for "transaction_type_4", it is checked whether it contains the "trans" prefix. In this example, It is found that the key contains the prefix "trans", so "transaction_type_4" can be split according to the prefix "trans" to obtain trans and action_type_4. Secondly, for each root in the multiple third split results, it can be checked in turn whether it contains the secondary prefix in the preferred root table, and each root can be split according to the secondary prefix until all the prefixes in the preferred root table are checked to obtain the final multiple second split results; then, multiple nodes can be constructed according to the multiple second split results, each node corresponding to a prefix or root, and these multiple nodes can be connected according to the character order in the third key data to obtain a preferred root tree.

[0132] Assume that the first set is {all.qry_date, als.score1, bs_score_1[*]}, and the first prefix sequence in the preferred root table only includes the first-level prefix sequence, which is "all.", "als.", "bs_score". According to the first set and the first prefix sequence, a preferred root tree is constructed. For details, see Figure 3 , Figure 3 It is a schematic diagram of a preferred root tree provided in an embodiment of the present application. Since the first prefix sequence only includes the first-level prefix sequence, it can be seen that the preferred root tree has only three layers, wherein the root node of the first layer of the preferred root tree is the "Root" node, the nodes of the second layer are key data obtained by splitting according to the first-level prefixes, including the three nodes of "all.", "als.", and "bs_score", and the nodes of the third layer are the roots of the key data, including the three nodes of "qry_date", "score1", and "_1[*]".

[0133] Assume that the second prefix sequence in the preferred root table includes a primary prefix sequence and a secondary prefix sequence, wherein the primary prefix sequence is "all.", "als.", "bs_score", and the secondary prefix sequence is "qry_", "score", see Figure 4 , Figure 4 It is a schematic diagram of another preferred root tree provided in an embodiment of the present application. Since the second prefix order includes the first-level prefix order and the second-level prefix order, it can be known that the preferred root tree includes four layers, wherein the root node of the first layer of the preferred root tree is the "Root" node, the nodes of the second layer are obtained by splitting the key data according to the first-level prefix, including the three nodes "all.", "als.", and "bs_score", and the nodes of the third layer are obtained by splitting the key data according to the second-level prefix, including the three nodes "qry_", "score", and "_1[*]"; wherein, since "bs_score_1[*]" does not include the second-level prefix and cannot be split further, the nodes of the third layer include the root "_1[*]" of "bs_score_1[*]"; the nodes of the fourth layer are the roots of the key data, including the two nodes "date" and "1".

[0134] It should be explained that if there are secondary prefixes, ..., n-level prefixes, etc. in the preferred root table, the key data can be further split according to these prefixes to obtain a new preferred root tree. The number of layers of the preferred root tree is equal to n+1.

[0135] In this way, nodes are constructed according to the splitting results and connected in character order to form a preferred root tree. This method presents the data in a tree structure. By traversing the nodes of the tree, the key corresponding to a specific prefix or root can be quickly located, so that targeted analysis can be performed. In addition, the preferred root tree converts complex data into an intuitive tree structure, making the meaning of the data easier to understand. Each node represents a prefix or root. Users can quickly understand the business concept represented by the data by viewing the name and connection relationship of the node.

[0136] Optionally, step D2, splitting each key in the third key data according to the preferred root table to obtain multiple second splitting results, including:

[0137] E1. Obtain a target key; the target key is any key in the third key data;

[0138] E2. Match each prefix in the preferred root table with the target key to obtain a target matching result; the target matching result includes a match success or a match failure;

[0139] E3. When the target matching result includes the match success, split the target key according to the preferred root table to obtain at least one target prefix and one target root;

[0140] E4. Determine a second splitting result corresponding to the target key according to the at least one target prefix and the target root;

[0141] E5. When the target matching result includes the matching failure, the second splitting result corresponding to the target key includes the target key.

[0142] In an embodiment of the present application, a target key is obtained; then, each prefix in the preferred root table can be matched with the target key to obtain a target matching result. Specifically, a string matching method can be used to check whether the target key contains the currently traversed root. When the target matching result includes a successful match, the target key can be split according to the preferred root table to obtain at least one target prefix and one target root. For example, assuming that the preferred root table includes first-level prefixes trans, loan, credit, and second-level prefix action, and the target key is "transaction_type_2", then at least one target prefix is ​​trans, action, and the target root is _type_2; then, a second split result corresponding to the target key can be determined based on the at least one target prefix and the target root, that is, the second split result includes at least one target prefix and a target root.

[0143] When the target matching result includes a matching failure, it means that the target key cannot be split, and the second splitting result corresponding to the target key includes the target key.

[0144] In this way, by matching the root in the preferred root table with the target key, it is possible to accurately determine whether the target key can be split. If the target matching result is a successful match, it can be split according to the preferred root table to obtain a more specific target prefix and target root, thereby improving the accuracy of data processing. When the target matching result is a failed match, the target key is directly used as the second split result to ensure the integrity of data processing. Data will not be lost or processed incorrectly due to a failed match, ensuring that all data can get appropriate processing results.

[0145] S207: Serialize the preferred root tree to generate a compressed target json file.

[0146] In an embodiment of the present application, the preferred root tree can be serialized to generate a compressed target json file. Specifically, the preferred root tree can be serialized using a json serialization method to obtain a json file.

[0147] The implementation of this application has the following beneficial effects:

[0148] It can be seen that the rule input json file compression method described in the present application is applied to a financial business system, and the method includes: obtaining the rule input data of the financial business system within a first preset time period to obtain the first rule input data; performing data merging processing on the first rule input data to obtain the second rule input data; obtaining the first key data in the second rule input data, performing a preset cleaning operation on the first key data to obtain the second key data; splitting the second key data according to the preferred splitting algorithm to obtain a preferred root table; obtaining the rule input data of the financial business system within the second preset time period to obtain the target rule input data; compressing the target rule input data according to the preferred root table to obtain a preferred root tree; serializing the preferred root tree to generate a compressed target json file, compressing the target rule input data according to the preferred root table to obtain a preferred root tree, the preferred root tree is an efficient data structure that can merge and compress similar data to reduce data storage space, and at the same time, the preferred root tree can quickly retrieve and query data without relying on a coding dictionary, thereby improving data processing efficiency and thus improving the compression efficiency of the json file.

[0149] See also Figure 5 , Figure 5 It is a functional unit composition block diagram of a JSON file compression device 500 with rule input provided in an embodiment of the present application, which is applied to a financial business system. The JSON file compression device 500 with rule input includes: an acquisition unit 501, a control unit 502, and a splitting unit 503, wherein:

[0150] The acquisition unit 501 is used to acquire the rule input parameter data of the financial service system within a first preset time period to obtain the first rule input parameter data;

[0151] The control unit 502 is used to perform data merging processing on the first rule input parameter data to obtain second rule input parameter data;

[0152] The acquisition unit 501 is further used to acquire the first key data in the second rule input parameter data, and perform a preset cleaning operation on the first key data to obtain the second key data;

[0153] The splitting unit 503 is used to split the second key data according to the preferred splitting algorithm to obtain a preferred root table;

[0154] The acquisition unit 501 is further used to acquire the rule input parameter data of the financial service system within a second preset time period to obtain the target rule input parameter data; the start time of the second preset time period is later than the end time of the first preset time period;

[0155] The splitting unit 503 is further used to compress the target rule input parameter data according to the preferred root table to obtain a preferred root tree;

[0156] The control unit 502 is further used to serialize the preferred root tree to generate a compressed target json file.

[0157] Optionally, in the aspect of splitting the second key data according to the preferred splitting algorithm to obtain the preferred root table, the splitting unit 503 is specifically used for:

[0158] S1. Determine the key contained in the second key data to obtain i keys, wherein the i keys constitute a set S; i is a positive integer;

[0159] S2. Obtain the prefixes corresponding to the i keys to obtain m prefixes; there is no duplicate prefix among the m prefixes; m is a positive integer less than or equal to i;

[0160] S3, determining the prefixes that meet the target condition among the m prefixes, obtaining j prefixes, wherein the j prefixes form a set P; j is a positive integer less than or equal to m;

[0161] S4. Calculate the profit coefficient of each key in the set S by using the prefix in the set P to split it according to the preset first profit calculation formula, and obtain a profit coefficient; a is equal to the value of i multiplied by j;

[0162] S5, determining the profit matrix Aij corresponding to the a profit coefficients;

[0163] S6, determining all possible prefix arrangement orders of the prefixes in the set P, and obtaining x prefix arrangement orders; x is a positive integer;

[0164] S7, split each key in the set S according to the arrangement order of the x prefixes and the j prefixes to obtain m target splitting results;

[0165] S8, determining a first-level preferred root table according to the benefit matrix Aij and the m target splitting results;

[0166] The first-level preferred root table is iterated according to steps S1-S8 until a preset number of iterations is reached, or the number of elements in the set P is zero, and the iteration ends to obtain the preferred root table.

[0167] Optionally, in determining the prefixes that meet the target condition among the m prefixes to obtain j prefixes, the splitting unit 503 is specifically configured to:

[0168] Obtain a target prefix; the target prefix is ​​any one of the m prefixes;

[0169] determining a target prefix length of the target prefix;

[0170] Determine the key of the target word prefix in the set S, and obtain b keys; b is a positive integer less than or equal to i;

[0171] When the length of the target prefix is ​​greater than a preset length and b is greater than a preset value, the target prefix is ​​determined to be one of the j prefixes.

[0172] Optionally, in the aspect of splitting each key in the set S according to the arrangement order of the x prefixes and the j prefixes to obtain m target splitting results, the splitting unit 503 is specifically used to:

[0173] Obtaining a first prefix arrangement sequence; the first prefix arrangement sequence is any prefix arrangement sequence among the x prefix arrangement sequences;

[0174] According to the arrangement order of the first prefixes, each key in the set S is split using the prefixes in the j prefixes in turn to obtain a first splitting results;

[0175] A target splitting result corresponding to the first prefix arrangement order is determined according to the a first splitting results.

[0176] Optionally, in determining the first-level preferred root table according to the benefit matrix Aij and the m target splitting results, the splitting unit 503 is specifically used for:

[0177] Determine the splitting matrix corresponding to each target splitting result in the m target splitting results, and obtain m splitting matrices; each splitting matrix is ​​a matrix with the same number of columns and rows as the profit matrix Aij;

[0178] Multiply each of the m split matrices by the profit matrix Aij to obtain m target profit matrices;

[0179] Calculate the sum of the profit coefficients of each target profit matrix in the m target profit matrices according to a preset second profit calculation formula to obtain m sums of profit coefficients;

[0180] Determine the maximum value among the sum of the m profit coefficients, determine the prefix arrangement order corresponding to the maximum value in the x prefix arrangement orders, and obtain the target prefix arrangement order;

[0181] The first-level preferred root table is determined according to the target prefix arrangement order and the set S.

[0182] Optionally, in performing a preset cleaning operation on the first key data to obtain the second key data, the acquiring unit 501 is specifically configured to:

[0183] Obtain the first array key in the first key data to obtain k first array keys; k is a natural number;

[0184] Using a preset replacement method to replace the array index of each of the k first array keys with a preset character, to obtain k second array keys after replacement;

[0185] De-duplication processing is performed on the k second array keys to obtain h second array keys; h is a natural number less than or equal to k;

[0186] Replace the k first array keys in the first key data by the h second array keys to obtain reference second key data;

[0187] The reference second key data is sorted according to a preset sorting method to obtain the second key data.

[0188] Optionally, in the aspect of compressing the target rule input parameter data in the financial business system according to the preferred root table to obtain the preferred root tree, the splitting unit 503 is specifically used for:

[0189] Obtain the third key data corresponding to the input parameter data of the target rule;

[0190] Splitting each key in the third key data according to the preferred root table to obtain a plurality of second split results; each split result includes at least one prefix and one root;

[0191] A plurality of nodes are constructed according to the prefixes and roots in the plurality of second splitting results, and are connected according to the character sequence in the third key data to obtain the preferred root tree; each node corresponds to a prefix or root.

[0192] Optionally, in the aspect of splitting each key in the third key data according to the preferred root table to obtain a plurality of second splitting results, the splitting unit 503 is specifically used for:

[0193] Obtain a target key; the target key is any key in the third key data;

[0194] Match each prefix in the preferred root table with the target key to obtain a target matching result; the target matching result includes a match success or a match failure;

[0195] When the target matching result includes the match success, splitting the target key according to the preferred root table to obtain at least one target prefix and one target root;

[0196] Determine a second splitting result corresponding to the target key according to the at least one target prefix and the target root;

[0197] When the target matching result includes the matching failure, the second splitting result corresponding to the target key includes the target key.

[0198] In a specific implementation, the JSON file compression device 500 with rule input described in the embodiment of the present invention can also execute other implementation methods described in the JSON file compression method with rule input provided in the above embodiment of the present invention, which will not be repeated here.

[0199] See also Figure 6 , Figure 6 It is a structural diagram of an electronic device provided in an embodiment of the present application, the electronic device includes a processor, a memory, a communication interface and one or more programs, and the processor, the memory and the communication interface are interconnected through a bus. The electronic device is applied to a financial business system; the one or more programs are stored in the memory and are configured to be executed by the processor; the one or more programs include instructions for executing some or all steps of the json file compression method for rule input described in the embodiment of the present application.

[0200] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method recorded in the above method embodiments, and the above computer includes an electronic device.

[0201] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.

[0202] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0203] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0204] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above-mentioned units, which 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 through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0205] The units described above 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.

[0206] 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.

[0207] If the above-mentioned 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 memory. 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 memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or CD-ROM and other media that can store program codes.

[0208] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A JSON file compression method with rule input, characterized in that: Applied to a financial business system, the method comprises: Obtaining rule input parameter data of the financial service system within a first preset time period to obtain first rule input parameter data; Performing data merging processing on the first rule input parameter data to obtain the second rule input parameter data; Obtain the first key data in the second rule input parameter data, perform a preset cleaning operation on the first key data, and obtain the second key data; Splitting the second key data according to a preferred splitting algorithm to obtain a preferred root word table; Obtaining rule input parameter data of the financial business system within a second preset time period to obtain target rule input parameter data; the start time of the second preset time period is later than the end time of the first preset time period; Compressing the target rule input parameter data according to the preferred root table to obtain a preferred root tree; The preferred root tree is serialized to generate a compressed target json file.

2. The method according to claim 1, characterized in that The step of splitting the second key data according to the preferred splitting algorithm to obtain a preferred root table includes: S1. Determine the key contained in the second key data to obtain i keys, wherein the i keys constitute a set S; i is a positive integer; S2. Obtain the prefixes corresponding to the i keys to obtain m prefixes; there is no duplicate prefix among the m prefixes; m is a positive integer less than or equal to i; S3, determining the prefixes that meet the target condition among the m prefixes, obtaining j prefixes, wherein the j prefixes constitute a set P; j is a positive integer less than or equal to m; S4. Calculate the profit coefficient of each key in the set S by using the prefix in the set P to split it according to the preset first profit calculation formula, and obtain a profit coefficient; a is equal to the value of i multiplied by j; S5, determining the profit matrix Aij corresponding to the a profit coefficients; S6, determining all possible prefix arrangement orders of the prefixes in the set P, and obtaining x prefix arrangement orders; x is a positive integer; S7, split each key in the set S according to the arrangement order of the x prefixes and the j prefixes to obtain m target splitting results; S8, determining a first-level preferred root table according to the benefit matrix Aij and the m target splitting results; The first-level preferred root table is iterated according to steps S1-S8 until a preset number of iterations is reached, or the number of elements in the set P is zero, and the iteration ends to obtain the preferred root table.

3. The method according to claim 2, characterized in that The step of determining the prefixes that meet the target condition among the m prefixes to obtain j prefixes includes: Obtain a target prefix; the target prefix is ​​any one of the m prefixes; determining a target prefix length of the target prefix; Determine the key of the target word prefix in the set S, and obtain b keys; b is a positive integer less than or equal to i; When the length of the target prefix is ​​greater than a preset length and b is greater than a preset value, the target prefix is ​​determined to be one of the j prefixes.

4. The method according to claim 2, characterized in that The step of splitting each key in the set S according to the arrangement order of the x prefixes and the j prefixes to obtain m target splitting results includes: Obtaining a first prefix arrangement sequence; the first prefix arrangement sequence is any prefix arrangement sequence among the x prefix arrangement sequences; According to the arrangement order of the first prefixes, each key in the set S is split using the prefixes in the j prefixes in turn to obtain a first splitting results; A target splitting result corresponding to the first prefix arrangement order is determined according to the a first splitting results.

5. The method according to any one of claims 2 to 4, characterized in that: The determining of the first-level preferred root table according to the benefit matrix Aij and the m target splitting results includes: Determine the splitting matrix corresponding to each target splitting result in the m target splitting results, and obtain m splitting matrices; each splitting matrix is ​​a matrix with the same number of columns and rows as the profit matrix Aij; Multiply each of the m split matrices by the profit matrix Aij to obtain m target profit matrices; Calculate the sum of the profit coefficients of each target profit matrix in the m target profit matrices according to a preset second profit calculation formula to obtain m sums of profit coefficients; Determine the maximum value among the sum of the m profit coefficients, determine the prefix arrangement order corresponding to the maximum value in the x prefix arrangement orders, and obtain the target prefix arrangement order; The first-level preferred root table is determined according to the target prefix arrangement order and the set S.

6. The method according to any one of claims 1 to 4, characterized in that: The performing a preset cleaning operation on the first key data to obtain the second key data includes: Obtain the first array key in the first key data to obtain k first array keys; k is a natural number; Using a preset replacement method to replace the array index of each of the k first array keys with a preset character, to obtain k second array keys after replacement; Deduplication processing is performed on the k second array keys to obtain h second array keys; h is a natural number less than or equal to k; Replace the k first array keys in the first key data by the h second array keys to obtain reference second key data; The reference second key data is sorted according to a preset sorting method to obtain the second key data.

7. The method according to any one of claims 1 to 4, characterized in that: The step of compressing the target rule input parameter data in the financial business system according to the preferred root table to obtain a preferred root tree includes: Obtain the third key data corresponding to the target rule input parameter data; Splitting each key in the third key data according to the preferred root table to obtain a plurality of second split results; each split result includes at least one prefix and one root; A plurality of nodes are constructed according to the prefixes and roots in the plurality of second splitting results, and are connected according to the character sequence in the third key data to obtain the preferred root tree; each node corresponds to a prefix or root.

8. The method according to claim 7, characterized in that The step of splitting each key in the third key data according to the preferred root table to obtain a plurality of second splitting results includes: Obtain a target key; the target key is any key in the third key data; Match each prefix in the preferred root table with the target key to obtain a target matching result; the target matching result includes a match success or a match failure; When the target matching result includes the match success, splitting the target key according to the preferred root table to obtain at least one target prefix and one target root; Determine a second splitting result corresponding to the target key according to the at least one target prefix and the target root; When the target matching result includes the matching failure, the second splitting result corresponding to the target key includes the target key.

9. A JSON file compression device with rule input, characterized in that: Applied to a financial business system, the device comprises: an acquisition unit, a control unit, and a splitting unit, wherein: The acquisition unit is used to acquire the rule input parameter data of the financial service system within a first preset time period to obtain the first rule input parameter data; The control unit is used to perform data merging processing on the first rule input parameter data to obtain the second rule input parameter data; The acquisition unit is further used to acquire the first key data in the second rule input parameter data, and perform a preset cleaning operation on the first key data to obtain the second key data; The splitting unit is used to split the second key data according to a preferred splitting algorithm to obtain a preferred root word table; The acquisition unit is further used to acquire the rule input parameter data of the financial business system within a second preset time period to obtain the target rule input parameter data; the start time of the second preset time period is later than the end time of the first preset time period; The splitting unit is further used to compress the target rule input parameter data according to the preferred root table to obtain a preferred root tree; The control unit is also used to serialize the preferred root tree to generate a compressed target json file.

10. A computer-readable storage medium, characterized in that: A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Rule engine implementation method and device

    CN107220098A

  • JSON (JavaScript Object Notation) data processing method and device, electronic equipment and storage medium

    CN115629762A

  • New word determination method and device, computer equipment and storage medium

    CN117077670A

  • Compression of javascript object notation data using structure information

    US20170141791A1