Field value determination method and device, and electronic equipment
By obtaining similar field groups and value groups from existing files, and utilizing cluster analysis and cluster core similarity calculation, the problem of low field value retrieval efficiency was solved, achieving fast and accurate field value retrieval.
Patent Information
- Application Number
- CN202310519677.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-09
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2043-05-09
AI Technical Summary
In existing technologies, developers often encounter inefficient field retrieval when registering file structure information or file transfer information, especially when there is a large amount of file structure information, which can take a long time.
By obtaining the existing field groups corresponding to multiple existing files and the target field groups corresponding to the target files, similar field groups that meet the predetermined similarity conditions are determined, and the target value groups are determined based on the similar field groups and similar value groups. Cluster analysis and cluster core similarity calculation are used to improve the efficiency of field value selection.
It improves the efficiency of retrieving field values in file structure information or file transfer information, ensuring the accuracy and speed of field value retrieval.
Smart Images

Figure CN116541730B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fintech, and more specifically, to a method, apparatus, and electronic device for determining field values. It should be noted that the method, apparatus, and electronic device for determining field values according to this invention can be used to determine field values in the fintech field, and also in any field other than fintech. The application areas of the method, apparatus, and electronic device for determining field values according to this invention are not limited. Background Technology
[0002] When developers transfer new files, they need to register file structure information, file transfer information, etc., which means filling in the values corresponding to the field names. For example, when registering a host file interface, copybook information, i.e., file structure information, needs to be registered. Required fields include domain name, domain name description, data type, and data length. The domain name, data type, and data length are mainly filled in sequentially by developers based on the copybook file, or by writing a program to read the copybook file and generate the corresponding field values. However, the domain name description generally needs to be filled in based on experience or by looking up existing data. After registering the file structure information, file transfer information also needs to be registered. The decoding information in the file transfer information needs to determine the decoding type of the corresponding field, which can also only be determined based on experience or existing data.
[0003] Currently, developers face issues such as low efficiency when registering file structure and transfer information. If field values are determined manually, it can be time-consuming, especially with a large amount of file structure information.
[0004] There is currently no effective solution to the technical problem of low efficiency in retrieving field values for fields in the registration of file structure information or file transfer information in related technologies. Summary of the Invention
[0005] This invention provides a method, apparatus, and electronic device for determining field values, in order to at least solve the technical problem of low efficiency in determining field values corresponding to fields in registered file structure information or file transfer information.
[0006] To achieve the above objectives, according to one aspect of this application, a method for determining field values is provided. The method includes: obtaining N sets of existing field groups corresponding to N existing files, and a target field group corresponding to a target file, where N is an integer greater than 1; identifying field groups among the N sets of existing field groups whose similarity to the target field group meets predetermined conditions as similar field groups; obtaining similar value groups corresponding to the similar field groups; and determining the target value group corresponding to the target field group based on the similar field groups and the similar value groups.
[0007] Optionally, among the N sets of existing field groups, the field groups whose similarity to the target field group meets a predetermined condition are identified as similar field groups. This includes: dividing the N sets of existing field groups into M clusters, where M is an integer greater than 1; sorting the M clusters to obtain a clustering sequence; and, according to the clustering sequence, sequentially identifying the field groups whose similarity to the target field group meets a predetermined condition among the M clusters as similar field groups.
[0008] Optionally, the M clusters are sorted to obtain a clustering sequence, including: determining the M cluster centers corresponding to the M clusters respectively; determining the similarity between the target field group and the M cluster centers respectively; and sorting the M clusters according to the similarity between the target field group and the M cluster centers to obtain a clustering sequence.
[0009] Optionally, according to the clustering sequence, field groups whose similarity to the target field group meets a predetermined condition are identified as similar field groups in the M clusters. This includes: if the clustering sequence is arranged in descending order of similarity between the target field group and the M cluster centers, the cluster ranked first in the clustering sequence is identified as the target cluster; the similarity between the existing field groups included in the target cluster and the target field group is determined; existing field groups in the target cluster whose similarity to the target field group is greater than a predetermined threshold are identified as similar field groups; existing field groups in the M clusters whose similarity to the target field group is greater than a predetermined threshold are identified as similar field groups, until all fields included in the target field group have a matching field in the similar field groups; or, existing field groups in the M clusters whose similarity to the target field group is greater than a predetermined threshold are identified as similar field groups, until the similar field groups include field groups in the M clusters whose similarity to the target field group is greater than a predetermined threshold.
[0010] Optionally, it further includes: if the similar field group includes M clusters in which the similarity to the target field group is greater than a predetermined threshold, and there are fields in the target field group that do not match the fields in the similar field group, then determine the fields in the target field group that do not match the fields in the similar field group; and display the target field group and the unmatched fields.
[0011] Optionally, the target value group corresponding to the target field group is determined based on the similar field group and the similar value group, including: when the similar field group is group L, determining the similarity between the similar field group L and the target field group respectively, where L is an integer greater than 1; sorting the similar field group L according to the similarity between the similar field group L and the target field group to obtain a field group sequence; and determining the target value group according to the field group sequence and the similar value group L corresponding to the similar field group L respectively.
[0012] Optionally, according to the field group sequence, the target value group is determined sequentially based on the L similar value groups corresponding to the L similar field groups, including: when the field group sequence is arranged in descending order of similarity between the L similar field groups and the target field group, the field group ranked first in the field group sequence is determined as the first similar field group; the first similar field group is matched with the target field group, the matched field in the first similar field group is determined as the first field, and the matched field in the target field group is determined as the second field; the value corresponding to the second field is determined as the value corresponding to the first field, wherein the target value group includes the value corresponding to the second field; the field group ranked next to the target similar field group in the field group sequence is determined as the second similar field group; the second similar field group is matched with the unmatched fields in the target field group, and the value of the field in the unmatched field that matches the field in the second similar field group is determined, wherein the target value group includes the value of the field that matches the field in the second similar field group; the target value group is determined sequentially based on the similar value groups corresponding to the L similar field groups.
[0013] To achieve the above objectives, according to another aspect of this application, a field value determination apparatus is provided. The apparatus includes: a first acquisition module, configured to acquire N sets of existing field groups corresponding to N existing files, and a target field group corresponding to a target file, wherein N is an integer greater than 1; a first determination module, configured to determine, among the N sets of existing field groups, field groups whose similarity to the target field group meets predetermined conditions as similar field groups; a second acquisition module, configured to acquire similar value groups corresponding to the similar field groups; and a second determination module, configured to determine the target value group corresponding to the target field group based on the similar field groups and the similar value groups.
[0014] To achieve the above objectives, according to another aspect of this application, a non-volatile storage medium is provided, the non-volatile storage medium including a stored program, wherein, during program execution, a method for determining the values of any of the fields of the device where the non-volatile storage medium is located is provided.
[0015] To achieve the above objectives, according to another aspect of this application, an electronic device is provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining the value of any of the fields described above.
[0016] This application employs the following steps: obtaining N sets of existing field groups corresponding to N existing files, and a target field group corresponding to the target file, where N is an integer greater than 1; identifying field groups whose similarity to the target field group meets predetermined conditions as similar field groups among the N sets of existing field groups; obtaining similar value groups corresponding to the similar field groups; and determining the target value group corresponding to the target field group based on the similar field groups and similar value groups. This achieves the goal of determining field values based on the similarity between fields in existing files and target files, solving the technical problem of low efficiency in retrieving field values corresponding to fields in registered file structure information or file transfer information in related technologies, thereby improving the technical effect of improving the efficiency of retrieving field values corresponding to fields in registered file structure information or file transfer information. Attached Figure Description
[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0018] Figure 1 This is a flowchart of a method for determining field values according to an embodiment of this application;
[0019] Figure 2 This is a schematic diagram of a field value determination device provided in the embodiments of this application;
[0020] Figure 3 This is a schematic diagram of the structure of an electronic device for determining field values according to an embodiment of this application. Detailed Implementation
[0021] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:
[0025] A copybook file is typically a text file containing data structure definitions. It can be read or imported by other programs and used to generate code or interact with other systems. Copybook files usually use specific formats and syntax to describe fixed-length fields, record structures, and report layouts.
[0026] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.
[0027] When developers add a new file transfer, they need to register file structure information, file transfer information, etc., that is, fill in the field values corresponding to the field names. The present invention will now be described with reference to preferred implementation steps. Figure 1 This is a flowchart of the method for determining field values according to the embodiments of this application, such as... Figure 1 As shown, the method includes the following steps:
[0028] Step S101: Obtain N sets of existing field groups corresponding to N existing files, and a target field group corresponding to the target file, where N is an integer greater than 1.
[0029] In this step, the existing file is a file already stored in the system or media, while the target file can be an incremental file, i.e., a newly added file. Before transferring the target file, developers need to determine its structure or transmission information. Determining the target file's structure or transmission information means determining the values of the multiple fields included in the target field group of the target file, i.e., determining the target value group. This can be done by obtaining the structure or transmission information corresponding to the existing file. The structure information can be recorded in the form of field groups and their corresponding value groups. Then, the values of the target field groups in the target file are filled in according to the existing field groups of the existing file. Specifically, the structure or transmission information of an existing file can correspond to a field group. A field group can include multiple fields, each corresponding to multiple values, which together form the value group corresponding to the field group. A field group can include multiple fields, which can be domain name, domain name description, data type, and data length. The specific values corresponding to each of these fields constitute the value group corresponding to the field group.
[0030] It should be noted that the number of fields in a field group is the same as the number of values in the corresponding value group, and both the fields in the field group and the values in the value group are ordered. Therefore, there is a one-to-one correspondence between the fields and values in the corresponding field group and value group. For example, the existing field group corresponding to existing file A may include fields a, b, c, and d, where field a has a value of 1, field b has a value of 2, field c has a value of 3, and field d has a value of 4. In this case, the existing field group includes four fields, namely a, b, c, and d, and the existing value group corresponding to the existing field group includes four values, namely 1, 2, 3, and 4. The target field group corresponding to target file B may include fields a, c, d, and e, but the target value group corresponding to the target field group is unknown. The target value group can be determined based on the existing value group.
[0031] Step S102: Among the N groups of existing fields, determine the field groups whose similarity to the target field group meets the predetermined conditions as similar field groups.
[0032] In related technologies, when determining the field values of a target file based on the field values of an existing file, the new field values are generally determined by the distribution of existing data in the table. For example, statistical methods such as the median and mode are used to infer the possible target value groups corresponding to the target field groups. However, existing methods do not consider the source and context of the data, that is, they do not consider the similarity of different file structures.
[0033] In this step, the values of the target field group are determined based on the structural similarity between the existing file and the target file. Since the field groups and value groups of files of the same type are generally highly similar, the field groups among the N existing field groups that meet the predetermined conditions for similarity with the target field group can be identified as similar field groups. Based on the similar field groups that are similar to the target field group, the target value group is determined. This method has a higher accuracy rate than the median or mode values.
[0034] Step S103: Obtain the similar value group corresponding to the similar field group.
[0035] Step S104: Determine the target value group corresponding to the target field group based on the similar field group and the similar value group.
[0036] In this step, the target value group corresponding to the target field group can be determined based on the correspondence between similar field groups and similar value groups. In other words, the values corresponding to the multiple fields included in the target field group can be determined respectively.
[0037] Through the above steps, the goal of determining field values based on the similarity between fields in the existing file and the target file is achieved. This solves the technical problem of low efficiency in retrieving field values corresponding to fields in the registration of file structure information or file transfer information in related technologies, thereby improving the technical effect of retrieving field values corresponding to fields in the registration of file structure information or file transfer information.
[0038] As an optional embodiment, determining the field groups that meet the predetermined similarity criteria with the target field group among N existing field groups can include the following steps: dividing the N existing field groups into M clusters, where M is an integer greater than 1; sorting the M clusters to obtain a clustering sequence; and, according to the clustering sequence, sequentially determining the field groups that meet the predetermined similarity criteria with the target field group among the M clusters as similar field groups.
[0039] Optionally, if there is a large amount of existing data, the value of N will also be large, and the computational workload of determining the similarity between each group of existing field data and the target field data will be large. In this case, the N groups of existing field data can be divided into M clusters, and the M clusters can be sorted. Then, the field groups in the M clusters that meet the predetermined similarity criteria with the target field group are identified as similar field groups.
[0040] As an optional embodiment, sorting the M clusters to obtain a clustering sequence may include the following steps: determining the M cluster centers corresponding to the M clusters respectively; determining the similarity between the target field group and the M cluster centers respectively; and sorting the M clusters according to the similarity between the target field group and the M cluster centers to obtain a clustering sequence.
[0041] Optionally, the M clusters can be sorted according to their similarity to the target field group. When calculating the similarity between field groups, the similarity between the M cluster centers and the target field group can be used as the similarity between the M clusters and the target field group. When sorting the M clusters based on similarity, it can be in ascending or descending order. Preferably, a clustering sequence can be generated by sorting in descending order of similarity. In the descending clustering sequence, field groups that meet predetermined similarity criteria with the target field group can be identified sequentially from the M clusters as similar field groups.
[0042] It should be noted that, in order to improve computational efficiency and reduce computational load, if a sufficient number of field groups that meet the predetermined conditions have been identified as similar field groups in the first few clusters of the clustering sequence, we can stop here and do not need to continue to determine whether there are field groups with similarity that meet the predetermined conditions in the remaining clusters.
[0043] As an optional embodiment, according to the clustering sequence, the similar field groups that meet the predetermined conditions of similarity with the target field group are determined sequentially from the M clusters. This may include the following steps: if the clustering sequence is arranged in descending order of similarity between the target field group and the M cluster centers, the cluster ranked first in the clustering sequence is determined as the target cluster; the similarity between the existing field groups included in the target cluster and the target field group is determined; the existing field groups in the target cluster that have a similarity greater than a predetermined threshold with the target field group are determined as similar field groups; the existing field groups in the M clusters that have a similarity greater than the predetermined threshold with the target field group are determined as similar field groups sequentially, until all fields included in the target field group have a matching field in the similar field groups, or, the existing field groups in the M clusters that have a similarity greater than the predetermined threshold with the target field group are determined as similar field groups sequentially, until the similar field groups include the field groups in the M clusters that have a similarity greater than the predetermined threshold with the target field group.
[0044] Optionally, when the clustering sequence is sorted in descending order of similarity, the cluster at the top of the sequence can be identified as the target cluster. The similarity between all existing field groups in the target cluster and the target field group can be determined, and similar field groups can be identified, including existing field groups in the target cluster with a similarity greater than a predetermined threshold. Then, the next cluster in the sequence can be identified, and field groups in the next cluster with a similarity greater than the predetermined threshold can be identified as similar field groups. This continues until all fields in the target field group have matching fields in the similar field groups. In other words, based on the identified similar field groups, all fields in the target field group can be filled in, and it is not necessary to continue determining whether there are any field groups in the remaining clusters that meet the predetermined similarity criteria. Alternatively, the process can continue until the similar field groups include M clusters with a similarity greater than the predetermined threshold to the target field group, i.e., the similar field groups have sequentially been identified, including all existing field groups in M clusters that meet the predetermined criteria, at which point the process of determining the similar field groups can end.
[0045] The predefined condition can be that the similarity to the target field group is greater than a predefined threshold, which can be set based on experience. It's important to note that selecting only fields from the similar field groups that have a similarity greater than the predefined threshold can ensure the accuracy of the target value group to a certain extent. This is because if some field groups have low similarity to the target field group, using the value groups corresponding to these field groups to fill in the target value group could very likely lead to errors in the values within the target value group.
[0046] As an optional embodiment, the following steps may also be included: if the similar field group includes field groups in M clusters whose similarity to the target field group is greater than a predetermined threshold, and there are fields in the target field group that do not match the fields in the similar field group, then determine the fields in the target field group that do not match the fields in the similar field group; and display the target field group and the unmatched fields.
[0047] Optionally, if the similar field group already includes all existing field groups that meet the predetermined conditions in M clusters, and there are still some special fields in the target field group that cannot be matched in the similar field group, then the fields in the target field that do not match the fields in the similar field group can be selected and displayed to the developers, so that the developers can manually determine the value of the mismatched field to ensure the accuracy of the field values entered.
[0048] As an optional embodiment, determining the target value group corresponding to the target field group based on the similar field group and the similar value group may include the following steps: when the similar field group is group L, determine the similarity between the L group of similar field groups and the target field group, where L is an integer greater than 1; sort the L group of similar field groups according to the similarity between the L group of similar field groups and the target field group to obtain a field group sequence; and determine the target value group according to the field group sequence and the L group of similar value groups corresponding to the L group of similar field groups respectively.
[0049] Optionally, after determining the similar value groups corresponding to the similar field groups, if there is only one similar field group, the target value group can be directly determined based on the similar field group. If there are L groups of similar field groups, the L groups of similar field groups can be sorted, and the target value group can be determined according to the L groups of similar value groups corresponding to the L groups of similar field groups in turn, based on the field group sequence. Preferably, the L groups of similar field groups can be sorted in descending order according to their similarity to the target field group.
[0050] As an optional embodiment, determining the target value group according to the field group sequence and the L similar value groups corresponding to the L similar field groups can include the following steps: If the field group sequence is arranged in descending order of similarity between the L similar field groups and the target field group, determine the field group that ranks first in the field group sequence as the first similar field group; match the first similar field group with the target field group, determine the matched field in the first similar field group as the first field, and determine the matched field in the target field group as the second field; determine the value corresponding to the second field as the value corresponding to the first field, wherein the target value group includes the value corresponding to the second field; determine the field group that ranks next to the target similar field group in the field group sequence as the second similar field group; match the second similar field group with the unmatched fields in the target field group, and determine the value of the field among the unmatched fields that matches the field in the second similar field group, wherein the target value group includes the value of the field that matches the field in the second similar field group; determine the target value group according to the similar value groups corresponding to the L similar field groups.
[0051] Optionally, when the field group sequence is arranged in descending order of similarity between the L group of similar field groups and the target field group, the field group at the top of the field group sequence can be taken as the first similar field group. Then, the fields in the first similar field group that match the target field group are considered identical fields. These identical fields are designated as the first field in the first similar field group and the second field in the target field group. The values corresponding to the first field and the second field can be used to fill in a portion of the target value group. Next, the field group next to the target similar field group in the field group sequence can be identified as the second similar field group. The second similar field group is then matched with the unmatched fields in the target field group. These unmatched fields are those not filled in based on the first similar field group. Fields that can match the unmatched fields are identified in the second similar field group. The values of the fields that match the second similar field group are then determined based on the values of the second similar field group. Finally, the target value group can be determined by sequentially determining the similar value groups corresponding to the L group of similar field groups based on the sequence of field groups.
[0052] Specifically, the information for similar file 1 is shown in Table 1. The first similarity field group consists of four fields: a, b, c, and d, with values of 1, 2, 3, and 4 respectively. That is, the first similarity value group is 1, 2, 3, and 4. The information for similar file 2 is shown in Table 2. The second similarity field group consists of four fields: b, e, f, and h, with values of 3, 2, 4, and 1 respectively. That is, the second similarity value group is 1, 3, 2, and 4. The information for similar file 3 is shown in Table 3. The third similarity value group consists of four fields: b, e, g, and h, with values of 3, 2, 4, and 1 respectively. That is, the third similarity value group is 3, 2, 4, and 1.
[0053] Table 1 shows the similar field groups and similar value groups for similar files 1.
[0054] a b c d 1 2 3 4
[0055] Table 2 shows the similar field groups and similar value groups for similar files 2.
[0056] b e f h 3 2 4 1
[0057] Table 3 shows the similar field groups and similar value groups for similar files 3.
[0058] b e g h 3 2 4 1
[0059] Given a target file 4 with fields a, b, c, f, and g, and three similar files sorted as 1, 2, and 3, first, match the field groups of similar file 1 with those of target file 4, and determine the target value group for target file 4 as 1, 2, 3, empty, empty based on similar file 1. Then, match the unmatched fields f and g in target file 4 with the similar field groups of similar file 2, and determine the value of field f as 4. Finally, match the still unmatched field g in target file 4 with the similar field groups of similar file 3, and determine the value of field g as 4. The final target value group is 1, 2, 3, 4, 4.
[0060] If we fill in the target value group according to the mode rule in statistical analysis, the values of a, b, c, f, and g are 1, 3, 3, 4, and 4, respectively. If we fill in the target value group according to similarity, the values of a, b, c, f, and g are 1, 2, 3, 4, and 4, respectively. The value of field b is 2 instead of 3 because similar file 1 and target file 4 have the highest similarity, and they are likely to be tables of the same type, with a high probability of the field taking the same value.
[0061] This optional embodiment can determine the target value group in order based on the similarity between the field group and the target field, ensuring a high accuracy rate for the target value group filled in.
[0062] As a specific implementation, firstly, the existing field groups corresponding to the existing files are clustered to obtain k clusters and k cluster centers C. t=1,2,...,k And set a similarity threshold △. For the target field group X corresponding to the newly added target file, calculate the similarity between the target field group X and the k cluster centers using cosine similarity, as follows:
[0063] Where t = 1, 2, ..., k, and ||X|| represents the vector length of X.
[0064] Secondly, for the target field group X and k cluster centers C t=1,...,k The cluster centers Q are obtained by sorting the clusters by their similarity scores from highest to lowest. t=1,...,k .
[0065] 1) Calculate the target field group X and Q t The similarity of stock field groups in the cluster (t=1,2,...,k) for Q t Within the cluster, sort by similarity from highest to lowest, Q t Sort by cluster and select Q t Similar field groups Y in a cluster whose similarity to the target field group X is greater than or equal to a set similarity threshold △ j .
[0066] 2) Select the similar field group Y with high similarity. j Compare target field group X with Y j The same fields, and the target value group corresponding to the target field group X to be filled.
[0067] 3) If the target value group corresponding to the target field group X is not completely filled, j = j + 1, and execute step 2 until j > m or the target value group corresponding to the target field group X is completely filled.
[0068] 4) If the target value group corresponding to the target field group X is not completely filled, t = t + 1, execute step 1 until t > k, or the target value group corresponding to the target field group X is completely filled.
[0069] Secondly, if, after the above steps, there are still fields in the target field group X that have not been filled with their corresponding values, then you need to consult the architect.
[0070] Finally, the filled incremental data, i.e. the target field group X, is added to the existing data and periodically clustered and updated.
[0071] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0072] This application also provides a field value determination device. It should be noted that the Z device in this application can be used to execute the field value determination method provided in this application. The field value determination device provided in this application is described below.
[0073] Figure 2 This is a schematic diagram of a field value determination device according to an embodiment of this application. Figure 2 As shown, the device includes:
[0074] The first acquisition module 21 is used to acquire N sets of existing field groups corresponding to N existing files, and a target field group corresponding to the target file, where N is an integer greater than 1.
[0075] The first determining module 22, connected to the first obtaining module 21, is used to determine, among N sets of existing field groups, the field groups whose similarity to the target field group meets predetermined conditions as similar field groups.
[0076] The second acquisition module 23 is connected to the first determination module 22 and is used to acquire similar value groups corresponding to similar field groups.
[0077] The second determining module 24, connected to the second obtaining module 23, is used to determine the target value group corresponding to the target field group based on the similar field group and the similar value group.
[0078] The field value determination device provided in this application embodiment obtains N sets of existing field groups corresponding to N existing files and a target field group corresponding to a target file, where N is an integer greater than 1; among the N sets of existing field groups, the field groups whose similarity to the target field group meets a predetermined condition are determined as similar field groups; similar value groups corresponding to the similar field groups are obtained; and based on the similar field groups and similar value groups, the target value group corresponding to the target field group is determined. This achieves the purpose of determining field values based on the similarity between fields in existing files and target files, solves the technical problem of low efficiency in determining field values corresponding to fields in the registration of file structure information or file transfer information in related technologies, and thus achieves the technical effect of improving the efficiency of determining field values corresponding to fields in the registration of file structure information or file transfer information.
[0079] The device for determining the value of the above-mentioned field includes a processor and a memory. The first acquisition module 21, the first determination module 22, the second acquisition module 23, and the second determination module 24 are all stored in the memory as program units. The processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.
[0080] The processor contains a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured, and kernel parameters are adjusted to determine field values based on the similarity of fields between the existing file and the target file.
[0081] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0082] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements a method for determining the value of the field.
[0083] This invention provides a processor for running a program, wherein the program executes a method for determining the value of the field during runtime.
[0084] Figure 3 This is a schematic diagram of the structure of an electronic device for determining field values according to an embodiment of this application, as shown below. Figure 3As shown, this application embodiment provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: obtaining N sets of existing field groups corresponding to N existing files, and a target field group corresponding to a target file, where N is an integer greater than 1; determining, among the N sets of existing field groups, field groups whose similarity to the target field group meets a predetermined condition as similar field groups; obtaining similar value groups corresponding to the similar field groups; and determining the target value group corresponding to the target field group based on the similar field groups and the similar value groups.
[0085] Optionally, among the N sets of existing field groups, the field groups whose similarity to the target field group meets a predetermined condition are identified as similar field groups. This includes: dividing the N sets of existing field groups into M clusters, where M is an integer greater than 1; sorting the M clusters to obtain a clustering sequence; and, according to the clustering sequence, sequentially identifying the field groups whose similarity to the target field group meets a predetermined condition among the M clusters as similar field groups.
[0086] Optionally, the M clusters are sorted to obtain a clustering sequence, including: determining the M cluster centers corresponding to the M clusters respectively; determining the similarity between the target field group and the M cluster centers respectively; and sorting the M clusters according to the similarity between the target field group and the M cluster centers to obtain a clustering sequence.
[0087] Optionally, according to the clustering sequence, field groups whose similarity to the target field group meets a predetermined condition are identified as similar field groups in the M clusters. This includes: if the clustering sequence is arranged in descending order of similarity between the target field group and the M cluster centers, the cluster ranked first in the clustering sequence is identified as the target cluster; the similarity between the existing field groups included in the target cluster and the target field group is determined; existing field groups in the target cluster whose similarity to the target field group is greater than a predetermined threshold are identified as similar field groups; existing field groups in the M clusters whose similarity to the target field group is greater than a predetermined threshold are identified as similar field groups, until all fields included in the target field group have a matching field in the similar field groups; or, existing field groups in the M clusters whose similarity to the target field group is greater than a predetermined threshold are identified as similar field groups, until the similar field groups include field groups in the M clusters whose similarity to the target field group is greater than a predetermined threshold.
[0088] Optionally, it further includes: if the similar field group includes M clusters in which the similarity to the target field group is greater than a predetermined threshold, and there are fields in the target field group that do not match the fields in the similar field group, then determine the fields in the target field group that do not match the fields in the similar field group; and display the target field group and the unmatched fields.
[0089] Optionally, the target value group corresponding to the target field group is determined based on the similar field group and the similar value group, including: when the similar field group is group L, determining the similarity between the similar field group L and the target field group respectively, where L is an integer greater than 1; sorting the similar field group L according to the similarity between the similar field group L and the target field group to obtain a field group sequence; and determining the target value group according to the field group sequence and the similar value group L corresponding to the similar field group L respectively.
[0090] Optionally, according to the field group sequence, the target value group is determined sequentially based on the L similar value groups corresponding to the L similar field groups, including: when the field group sequence is arranged in descending order of similarity between the L similar field groups and the target field group, the field group ranked first in the field group sequence is determined as the first similar field group; the first similar field group is matched with the target field group, the matched field in the first similar field group is determined as the first field, and the matched field in the target field group is determined as the second field; the value corresponding to the second field is determined as the value corresponding to the first field, wherein the target value group includes the value corresponding to the second field; the field group ranked next to the target similar field group in the field group sequence is determined as the second similar field group; the second similar field group is matched with the unmatched fields in the target field group, and the value of the field in the unmatched field that matches the field in the second similar field group is determined, wherein the target value group includes the value of the field that matches the field in the second similar field group; the target value group is determined sequentially based on the similar value groups corresponding to the L similar field groups.
[0091] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0092] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: obtaining N sets of existing field groups corresponding to N existing files, and a target field group corresponding to a target file, where N is an integer greater than 1; determining, among the N sets of existing field groups, field groups whose similarity to the target field group meets predetermined conditions as similar field groups; obtaining similar value groups corresponding to the similar field groups; and determining the target value group corresponding to the target field group based on the similar field groups and the similar value groups.
[0093] Optionally, among the N sets of existing field groups, the field groups whose similarity to the target field group meets a predetermined condition are identified as similar field groups. This includes: dividing the N sets of existing field groups into M clusters, where M is an integer greater than 1; sorting the M clusters to obtain a clustering sequence; and, according to the clustering sequence, sequentially identifying the field groups whose similarity to the target field group meets a predetermined condition among the M clusters as similar field groups.
[0094] Optionally, the M clusters are sorted to obtain a clustering sequence, including: determining the M cluster centers corresponding to the M clusters respectively; determining the similarity between the target field group and the M cluster centers respectively; and sorting the M clusters according to the similarity between the target field group and the M cluster centers to obtain a clustering sequence.
[0095] Optionally, according to the clustering sequence, field groups whose similarity to the target field group meets a predetermined condition are identified as similar field groups in the M clusters. This includes: if the clustering sequence is arranged in descending order of similarity between the target field group and the M cluster centers, the cluster ranked first in the clustering sequence is identified as the target cluster; the similarity between the existing field groups included in the target cluster and the target field group is determined; existing field groups in the target cluster whose similarity to the target field group is greater than a predetermined threshold are identified as similar field groups; existing field groups in the M clusters whose similarity to the target field group is greater than a predetermined threshold are identified as similar field groups, until all fields included in the target field group have a matching field in the similar field groups; or, existing field groups in the M clusters whose similarity to the target field group is greater than a predetermined threshold are identified as similar field groups, until the similar field groups include field groups in the M clusters whose similarity to the target field group is greater than a predetermined threshold.
[0096] Optionally, it further includes: if the similar field group includes M clusters in which the similarity to the target field group is greater than a predetermined threshold, and there are fields in the target field group that do not match the fields in the similar field group, then determine the fields in the target field group that do not match the fields in the similar field group; and display the target field group and the unmatched fields.
[0097] Optionally, the target value group corresponding to the target field group is determined based on the similar field group and the similar value group, including: when the similar field group is group L, determining the similarity between the similar field group L and the target field group respectively, where L is an integer greater than 1; sorting the similar field group L according to the similarity between the similar field group L and the target field group to obtain a field group sequence; and determining the target value group according to the field group sequence and the similar value group L corresponding to the similar field group L respectively.
[0098] Optionally, according to the field group sequence, the target value group is determined sequentially based on the L similar value groups corresponding to the L similar field groups, including: when the field group sequence is arranged in descending order of similarity between the L similar field groups and the target field group, the field group ranked first in the field group sequence is determined as the first similar field group; the first similar field group is matched with the target field group, the matched field in the first similar field group is determined as the first field, and the matched field in the target field group is determined as the second field; the value corresponding to the second field is determined as the value corresponding to the first field, wherein the target value group includes the value corresponding to the second field; the field group ranked next to the target similar field group in the field group sequence is determined as the second similar field group; the second similar field group is matched with the unmatched fields in the target field group, and the value of the field in the unmatched field that matches the field in the second similar field group is determined, wherein the target value group includes the value of the field that matches the field in the second similar field group; the target value group is determined sequentially based on the similar value groups corresponding to the L similar field groups.
[0099] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0100] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0101] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0102] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0103] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0104] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0105] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0106] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0107] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0108] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for determining the value of a field, characterized in that, include: Get N sets of existing field groups corresponding to N existing files, and the target field group corresponding to the target file, where N is an integer greater than 1; Among the N sets of existing field groups, the field groups whose similarity to the target field group meets the predetermined conditions are identified as similar field groups; Obtain the similar value groups corresponding to the similar field groups; Based on the similar field group and the similar value group, determine the target value group corresponding to the target field group; The step of determining, among the N sets of existing field groups, field groups whose similarity to the target field group meets a predetermined condition as similar field groups includes: dividing the N sets of existing field groups into M clusters, where M is an integer greater than 1; sorting the M clusters to obtain a clustering sequence; and, according to the clustering sequence, sequentially determining, among the M clusters, field groups whose similarity to the target field group meets a predetermined condition as similar field groups.
2. The method according to claim 1, characterized in that, The step of sorting the M clusters to obtain a cluster sequence includes: Determine the M cluster centers corresponding to the M clusters respectively; Determine the similarity between the target field group and the M cluster centers respectively; The M clusters are sorted according to the similarity between the target field group and the M cluster centers to obtain the clustering sequence.
3. The method according to claim 2, characterized in that, The step of determining, according to the clustering sequence, the field groups in the M clusters that meet the predetermined conditions for similarity with the target field group as the similar field group includes: If the clustering sequence is arranged in descending order of similarity between the target field group and the M cluster centers, the cluster that ranks first in the clustering sequence is determined as the target cluster. Determine the similarity between the existing field groups included in the target cluster and the target field group; The existing field groups in the target cluster whose similarity to the target field group is greater than a predetermined threshold are defined as the similar field groups. Sequentially, in the M clusters, existing field groups whose similarity to the target field group is greater than the predetermined threshold are identified as the similar field groups, until all fields included in the target field group have a matching field in the similar field groups; or, sequentially, in the M clusters, existing field groups whose similarity to the target field group is greater than the predetermined threshold are identified as the similar field groups, until the similar field groups include field groups in the M clusters whose similarity to the target field group is greater than the predetermined threshold.
4. The method according to claim 3, characterized in that, Also includes: If the similar field group includes existing field groups in the M clusters whose similarity to the target field group is greater than the predetermined threshold, and there are fields in the target field group that do not match the fields in the similar field group, then determine the fields in the target field group that do not match the fields in the similar field group. Display the target field group and the mismatched fields.
5. The method according to any one of claims 1 to 4, characterized in that, The step of determining the target value group corresponding to the target field group based on the similar field group and the similar value group includes: When the similar field group is L, the similarity between the L similar field groups and the target field group is determined respectively, where L is an integer greater than 1; Based on the similarity between the L groups of similar field groups and the target field group, the L groups of similar field groups are sorted to obtain a field group sequence; According to the field group sequence, the target value group is determined sequentially based on the L similar value groups corresponding to the L similar field groups.
6. The method according to claim 5, characterized in that, The step of determining the target value group according to the field group sequence and sequentially based on the L similar value groups corresponding to the L similar field groups includes: When the field group sequence is arranged in descending order of similarity between the L group of similar field groups and the target field group, the field group that ranks first in the field group sequence is determined to be the first similar field group. The first similar field group is matched with the target field group, and the field matched in the first similar field group is determined to be the first field, and the field matched in the target field group is determined to be the second field; The value corresponding to the second field is determined to be the value corresponding to the first field, wherein the target value group includes the value corresponding to the second field; The field group that ranks next to the target similar field group in the field group sequence is identified as the second similar field group; The second similar field group is matched with the unmatched fields in the target field group, and the values of the fields in the unmatched fields that match the fields in the second similar field group are determined, wherein the target value group includes the values of the fields that match the fields in the second similar field group; The target value group is determined sequentially based on the similar value groups corresponding to the L groups of similar fields.
7. A device for determining the value of a field, characterized in that, include: The first acquisition module is used to acquire N sets of existing field groups corresponding to N existing files, and the target field group corresponding to the target file. The first determining module is used to determine, among the N groups of existing field groups, a field group whose similarity to the target field group meets a predetermined condition as a similar field group, where N is an integer greater than 1; The second acquisition module is used to acquire similar value groups corresponding to the similar field groups; The second determining module is used to determine the target value group corresponding to the target field group based on the similar field group and the similar value group; The first determining module is further configured to divide the N groups of existing field groups into M clusters, where M is an integer greater than 1; sort the M clusters to obtain a clustering sequence; and, according to the clustering sequence, sequentially determine the field groups in the M clusters whose similarity to the target field group meets a predetermined condition as the similar field groups.
8. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein, when the program is executed, it controls the device where the non-volatile storage medium is located to execute the method for determining the field value as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method for determining the field value as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Data processing method and device
CN110276060A
Monitoring rule processing method and device, processor and electronic equipment
CN114817209A