A method and device for judging consistency of returned data
By reading and comparing the returned data configuration files of different versions of the ES database, the problem of data inconsistency caused by inconsistent versions is solved, data consistency judgment and configuration file expansion are realized, and the integrity and security of data transmission are ensured.
Patent Information
- Application Number
- CN202111592668.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2041-12-23
AI Technical Summary
When the ES database versions are not unified, there is a lack of tools to judge whether the data returned by different versions of the database are consistent, resulting in possible data inconsistencies during data transmission.
By reading the configuration files corresponding to the returned data from different data platforms, splitting and storing them as JSON objects, using preset judgment logic to compare the values of each field, judging the data consistency between data platforms, and providing configuration file support extensions .
It realizes the consistency judgment of the data returned by different platforms, ensures the integrity and consistency of the data during the data transmission process, and improves the security and performance during the data migration process.
Smart Images

Figure CN114330278B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method and device for determining the consistency of returned data. Background Art
[0002] Generally, ES (ElasticSearch) needs to be upgraded completely for the purpose of facilitating maintenance and unified management. When the versions are not unified, they are upgraded to a fixed version. At the same time, permission control is added to ES. Therefore, data verification is also required when migrating ES to prevent data inconsistency caused by changes in the transmission data type between different versions (especially when the version span is large). However, there is currently no tool to determine whether the data returned by two data platforms (such as different versions of ES databases) is completely consistent. Summary of the invention
[0003] One purpose of the present application is to provide a method and device for determining the consistency of returned data, which can uniformly process whether the data returned by different platforms are completely consistent, and provide a configuration file to support expansion.
[0004] According to one aspect of the present application, a method for determining consistency of returned data is provided, the method comprising:
[0005] Read the configuration files corresponding to the returned data from different data platforms;
[0006] Segment each of the read configuration files to obtain configuration files of multiple fields, and store the configuration files of the multiple fields in a memory;
[0007] Based on the returned data of each data platform, obtaining configuration file objects of multiple fields corresponding to each data platform from the memory, and converting the configuration file object of each field into a JSON object;
[0008] Use the preset judgment logic to compare the current fields of the JSON objects corresponding to each two data platforms to obtain consistency results.
[0009] Optionally, read the configuration files corresponding to the returned data of different data platforms, including:
[0010] Determine whether the returned data of different data platforms have passed the program parameters and obtain the determination result;
[0011] The path of the corresponding configuration file is determined according to the judgment result, and the configuration file is read according to the path of the corresponding configuration file.
[0012] Optionally, determining a path of a corresponding configuration file according to the judgment result, and reading the configuration file according to the path of the corresponding configuration file includes:
[0013] When the judgment result is that the program parameter is passed, the set parameter is read as the path of the configuration file, and the configuration file is read according to the set parameter;
[0014] When the judgment result is that the program parameter is not passed, the directory where the returned data is located is used as the path of the configuration file, and the configuration file is read from the directory.
[0015] Optionally, the current fields of the JSON objects corresponding to each two data platforms are compared using a preset judgment logic to obtain consistency results, including:
[0016] The current fields of the JSON objects corresponding to every two data platforms are passed as transfer parameters to a tool class containing a preset judgment logic. The preset judgment logic is used in the tool class to compare the passed parameters to obtain a consistency result.
[0017] Optionally, the preset judgment logic is used in the tool class to compare the transmitted parameters to obtain a consistency result, including:
[0018] In the tool class, determine whether the current fields of the JSON objects corresponding to each of the two data platforms are both empty as the passing parameters. If so, the return data of the data platforms corresponding to the two JSON objects are consistent. If one is not empty, the return data of the data platforms corresponding to the two JSON objects are inconsistent.
[0019] If both are not empty, add the keys of the current fields of the two JSON objects to the unordered set, traverse the unordered set, obtain the values of the current fields of the two JSON objects from the unordered set and compare the values, and obtain the consistency result based on the comparison of the values.
[0020] Optionally, obtaining values of current fields of the two JSON objects from the unordered collection and comparing the values, and obtaining a consistency result according to the comparison of the values, includes:
[0021] Traverse all fields of two JSON objects in the unordered collection, obtain values of two current fields and compare the values of the two current fields;
[0022] If only one of the values of the two current fields is empty, the returned data of the data platform corresponding to the two JSON objects are inconsistent;
[0023] If the values of the two current fields are not empty, then compare whether the values of the two current fields are consistent. If they are inconsistent, continue to determine the types of the values of the two current fields, and obtain a consistency result based on the types.
[0024] Optionally, continue to determine the types of the values of the two current fields, and obtain a consistency result according to the types, including:
[0025] If one of the values of the two current fields is a long integer type and the other is a string type, the value of the character type is parsed according to the formatting format in the configuration file;
[0026] If the parsed value is equal to the value of the long integer type, continue to traverse the next field. When the values corresponding to all fields are equal, the return data of the data platform corresponding to the two JSON objects are consistent.
[0027] Optionally, the configuration file includes configuring multiple date formatting formats.
[0028] According to another aspect of the present application, a device for determining consistency of returned data is also provided, the device comprising:
[0029] A reading device, used to read configuration files corresponding to the returned data of different data platforms;
[0030] A segmentation device, used for segmenting each read configuration file to obtain configuration files of multiple fields, and storing the configuration files of the multiple fields in a memory;
[0031] A conversion device, used for obtaining configuration file objects of multiple fields corresponding to each data platform from the memory based on the return data of each data platform, and converting the configuration file object of each field into a JSON object;
[0032] The comparison device is used to compare the current fields of the JSON objects corresponding to each two data platforms using a preset judgment logic to obtain a consistency result.
[0033] According to another aspect of the present application, a device for determining consistency of returned data is also provided, the device comprising:
[0034] one or more processors; and
[0035] A memory storing computer readable instructions, which, when executed, cause the processor to perform the operations of the method as described above.
[0036] According to another aspect of the present application, a computer-readable medium is provided, on which computer-readable instructions are stored. The computer-readable instructions can be executed by a processor to implement the method described above.
[0037] Compared with the prior art, this application reads the configuration files corresponding to the returned data of different data platforms; splits each read configuration file to obtain configuration files of multiple fields, and stores the configuration files of the multiple fields in the memory; obtains the configuration file objects of the multiple fields corresponding to each data platform from the memory based on the returned data of each data platform, and converts the configuration file object of each field into a JSON object; uses the preset judgment logic to compare the current fields of the JSON objects corresponding to each two data platforms to obtain the consistency result. In this way, it is possible to uniformly handle whether the data returned by different platforms are completely consistent, and provide the form of configuration files to support expansion. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0039] Figure 1 A schematic flow chart of a method for determining consistency of returned data provided according to one aspect of the present application is shown;
[0040] Figure 2 A schematic diagram showing the process of tool class initialization in one embodiment of the present application is shown;
[0041] Figure 3 A schematic diagram of a process of reading a configuration file in an embodiment of the present application is shown;
[0042] Figure 4 A schematic diagram of the structure of a device for determining consistency of returned data provided according to another aspect of the present application is shown.
[0043] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0044] The present application is described in further detail below in conjunction with the accompanying drawings.
[0045] In a typical configuration of the present application, the terminal, the device of the service network and the trusted party all include one or more processors (eg, a central processing unit (CPU)), an input / output interface, a network interface and a memory.
[0046] Memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0047] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, Phase-Change RAM (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 technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0048] Figure 1A flow chart of a method for determining the consistency of returned data provided according to one aspect of the present application is shown, the method comprising: steps S11 to S14, wherein, in step S11, configuration files corresponding to the returned data of different data platforms are read; in step S12, each configuration file read is segmented to obtain configuration files of multiple fields, and the configuration files of the multiple fields are stored in the memory; in step S13, configuration file objects of multiple fields corresponding to each data platform are obtained from the memory based on the returned data of each data platform, and the configuration file object of each field is converted into a JSON object; in step S14, the current fields of the JSON objects corresponding to each two data platforms are compared using a preset judgment logic to obtain a consistency result. Thus, a unified processing is performed on whether the data returned by different platforms are completely consistent, a consistency result can be obtained, and expansion can be supported through the provided configuration file.
[0049] Specifically, in step S11, the configuration files corresponding to the return data of different data platforms are read; here, the data objects returned by different data platforms may be inconsistent, and the tool class can be used for verification. First, the return data of these different platforms are passed into the tool class. Because the return data of different data platforms are configured with configuration files, the configuration files include the data format of the data. The tool class first reads the configuration files corresponding to the return data of different data platforms that need to be judged for consistency, and then uses the configuration files to perform data consistency judgment. Among them, the configuration file includes configuring multiple date formatting formats. The configuration file configures a variety of common date formatting formats. If there are inconsistencies in different regions or time zones, they can be supplemented in the configuration file, or they can be customized in the command or elsewhere for assignment.
[0050] Specifically, in step S12, each configuration file read is segmented to obtain configuration files of multiple fields, and the configuration files of the multiple fields are stored in the memory; here, the read configuration file is segmented, such as by row, into field form, to obtain configuration files of multiple fields, and the configuration files of these fields are stored in the memory (such as JVM memory) for subsequent use.
[0051] Specifically, in step S13, based on the return data of each data platform, the configuration file objects of multiple fields corresponding to each data platform are obtained from the memory, and the configuration file object of each field is converted into a JSON object; here, the configuration file objects of multiple fields corresponding to the return data are obtained from the memory according to the return data that needs to be compared. For example, the return data that needs to be compared may come from multiple different data platforms. In this case, it is necessary to take out the configuration files of multiple fields obtained by cutting according to the configuration files of the return data of each platform from the memory, and use the read configuration file of each field as the configuration file object, thereby converting the configuration file object of each field into a JSON object, so as to facilitate one-by-one comparison of the fields.
[0052] Specifically, in step S14, the current fields of the JSON objects corresponding to each two data platforms are compared using the preset judgment logic to obtain a consistency result. Here, the JSON objects from each two different data platforms are compared according to the preset judgment logic set within the tool class. For example, when there are two data platforms, the JSON objects of the two data platforms are compared one by one according to the fields to obtain a consistency result.
[0053] In some embodiments of the present application, in step S11, it is determined whether the returned data of different data platforms pass the program parameters to obtain a judgment result; the path of the corresponding configuration file is determined according to the judgment result, and the configuration file is read according to the path of the corresponding configuration file. Here, it is determined in the tool class whether the returned data of different data platforms received pass the program parameters, so as to read the corresponding configuration file according to the program parameters. Specifically, when the judgment result is that the program parameters are passed, the set parameters are read as the path of the configuration file, and the configuration file is read according to the set parameters; when the judgment result is that the program parameters are not passed, the directory where the returned data is located is used as the path of the configuration file, and the configuration file is read from the directory. Here, when the returned data passes the program parameters, it means that the configuration file of the returned data can be called, and the set parameters read by the program parameters are used as the path of the configuration file, so as to read the corresponding configuration file according to the path of the configuration file; when the returned data does not pass the program parameters, the configuration file (date_formation.conf) in the same directory is directly read by default.
[0054] In a specific embodiment of the present application, Figure 2As shown, the tool class is used to judge the data consistency. The tool class automatically performs initialization work when the program is started. When the initialization starts, the configuration file (date_formation.conf) in the source directory (resources directory) under the current project directory using the tool class is obtained by default. The file configures multiple formats of date formatting, and each line is a configuration, such as: ['yyyy-MM-dd HH:mm:ss', 'yyyy-MM-dd HH:mm:ss.SSS']. By default, the date_formation.conf file in the resources directory under the current project directory using the tool class is obtained, and the file content of date_formation.conf is read and put into the memory so that the tool class can be used for data parsing; then step S100 is executed, and the specific content of step S100 includes steps S10, S101~S105 and S201, as shown in FIG. Figure 3 As shown, S10, determine whether the reading of the date_formation.conf file is successful; when the reading is successful, S101, store the file content in the form of a string array in the memory; S102, mark the identifier [initialized] in the tool class as TRUE, and then S103, convert the data with the same id obtained from different platforms into a JSON object, so that the fields and values of the same number can be compared to see if they are the same; S104, start calling the [isSame] method of the tool class, and the two parameters are the JSON objects converted from the data with the same id obtained in the previous step (S103); S105, determine whether the tool class is successfully initialized, if so, continue to compare the data using the preset judgment logic, if not, throw an "initialization failure exception" to prompt the user that the comparison cannot be made. When the reading of the date_formation.conf file fails, S201 is executed, the file reading fails, and an "initialization failure exception" is thrown to prompt the user. At this time, it may be that the configuration file does not exist or the configuration file has no content, so the configuration file in the default directory is used, and then S103 to S105 are executed.
[0055] In some embodiments of the present application, in step S14, the current fields of the JSON objects corresponding to every two data platforms are passed as transfer parameters to a tool class containing a preset judgment logic, and the preset judgment logic is used in the tool class to compare the passed transfer parameters to obtain a consistency result. Here, when there are at least two data platforms that need to be compared, each two are used as comparison objects, and the JSON objects corresponding to every two data platforms are passed as parameters to the tool class, which contains a preset judgment logic. The incoming JSON objects include multiple fields, and the comparison is performed according to each field. The fields of the JSON object are traversed according to the preset judgment logic, and the current fields corresponding to different data platforms are compared.
[0056] Next, in the tool class, determine whether the current fields of the JSON objects corresponding to each of the two data platforms are empty as the passing parameters. If so, the return data of the data platforms corresponding to the two JSON objects are consistent. If there is one that is not empty, the return data of the data platforms corresponding to the two JSON objects are inconsistent. If both are not empty, the keys of the current fields of the two JSON objects are added to the unordered set, the unordered set is traversed, the values of the current fields of the two JSON objects are obtained from the unordered set and the values are compared, and the consistency result is obtained based on the comparison of the values. Here, first check whether the passing parameters are all empty. If both are empty, TRUE is returned, indicating that the data is the same. If one is empty and the other is not empty, it means that the data is different, and FALSE is returned. If both are not empty, the keys of the current fields of the two objects are added to the unordered set, and then the unordered set is traversed to obtain the values of the current fields of the two JSON objects, so as to compare and obtain the consistency result.
[0057] Specifically, all fields of the two JSON objects in the unordered collection are traversed, the values of the two current fields are obtained and the values of the two current fields are compared; if only one of the values of the two current fields is empty, the return data of the data platform corresponding to the two JSON objects is inconsistent; if the values of the two current fields are not empty, the values of the two current fields are compared to see if they are consistent. If they are inconsistent, the types of the values of the two current fields are further determined, and the consistency result is obtained according to the types. Here, all fields of the JSON objects in the unordered collection are traversed, the values of the current fields of the two JSON objects are obtained, and the values of the current fields are compared. If both values are empty, it means that the current fields are equal, and the traversal of the next field is continued; if only one of the two is empty, it means that the current fields and values of the two JSONs are not equal, and the traversal is exited and FALSE is directly returned. If the values of the current fields of the two JSONs are not empty, the values of the two current fields are compared to see if they are consistent. If they are consistent, the traversal is continued until the traversal is completed or the traversal is exited in case of inconsistency.
[0058] Continuing with the above embodiment, if the type of the value of the two current fields is a long integer type and the other is a string type, the value of the character type is parsed according to the formatting format in the configuration file; if the parsed value is equal to the value of the long integer type, continue to traverse the next field. When the values corresponding to all fields are equal, the return data of the data platform corresponding to the two JSON objects are consistent. Here, when the values of the two current fields are inconsistent, continue to judge whether the values of the two current fields are one long integer type (Long type) and the other string type (String type). If not, jump out of the traversal and return FALSE directly. If so, parse the value of the String type according to the formatting format in the configuration file. If one of the parsing is successful and the value is equal to the value of the Long type, it means that the value of the current field is equal, and continue to traverse. If the parsing is not successful or the values are not equal after the parsing is successful, jump out of the traversal and return FALSE directly. Through the simplicity of JSON structure, it is possible to determine whether the returned data of different data platforms are completely consistent without the need to reference other tool classes. This tool can be used to improve performance and security due to the upgrade of new tools or platforms during business development, and can ensure the consistency of data after the upgrade.
[0059] In addition, an embodiment of the present application further provides a computer-readable medium on which computer-readable instructions are stored. The computer-readable instructions can be executed by a processor to implement the aforementioned method for determining the consistency of returned data.
[0060] Corresponding to the method described above, the present application also provides a terminal, which includes a terminal capable of executing the above Figure 1 or Figure 2 or Figure 3 The modules or units of the method steps described in each embodiment may be implemented by hardware, software, or a combination of hardware and software, which is not limited by the present application. For example, in one embodiment of the present application, a device for determining the consistency of returned data is also provided, and the device includes:
[0061] one or more processors; and
[0062] A memory storing computer readable instructions, which, when executed, cause the processor to perform the operations of the method as described above.
[0063] For example, the computer readable instructions, when executed, cause the one or more processors to:
[0064] Read the configuration files corresponding to the returned data from different data platforms;
[0065] Segment each of the read configuration files to obtain configuration files of multiple fields, and store the configuration files of the multiple fields in a memory;
[0066] Based on the returned data of each data platform, obtaining configuration file objects of multiple fields corresponding to each data platform from the memory, and converting the configuration file object of each field into a JSON object;
[0067] Use the preset judgment logic to compare the current fields of the JSON objects corresponding to each two data platforms to obtain consistency results.
[0068] Figure 4 A structural schematic diagram of a device for determining the consistency of returned data provided according to another aspect of the present application is shown, the device comprising: a reading device 11, a segmentation device 12, a conversion device 13 and a comparison device 14, wherein the reading device 11 is used to read configuration files corresponding to return data of different data platforms; the segmentation device 12 is used to segment each read configuration file to obtain configuration files of multiple fields, and store the configuration files of the multiple fields in a memory; the conversion device 13 is used to obtain configuration file objects of multiple fields corresponding to each data platform from the memory based on the return data of each data platform, and convert the configuration file object of each field into a JSON object; the comparison device 14 is used to compare the current fields of the JSON objects corresponding to each two data platforms using a preset judgment logic to obtain a consistency result.
[0069] It should be noted that the contents executed by the reading device 11, the segmentation device 12, the conversion device 13 and the comparison device 14 are respectively the same or correspondingly the same as the contents in the above steps S11, S12, S13 and S14, and are not repeated here for the sake of simplicity.
[0070] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
[0071] It should be noted that the present application can be implemented in software and / or a combination of software and hardware, for example, can be implemented using an application specific integrated circuit (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented using hardware, for example, as a circuit that cooperates with a processor to perform each step or function.
[0072] In addition, a part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. The program instruction for calling the method of the present application may be stored in a fixed or removable recording medium, and / or transmitted through a data stream in a broadcast or other signal-bearing medium, and / or stored in a working memory of a computer device that runs according to the program instruction. Here, according to an embodiment of the present application, a device is included, the device including a memory for storing computer program instructions and a processor for executing program instructions, wherein, when the computer program instruction is executed by the processor, the device is triggered to run the method and / or technical solution based on the aforementioned multiple embodiments according to the present application.
[0073] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
Claims
1. A method for determining the consistency of returned data, It is characterized in that The method comprises: Read the configuration files corresponding to the returned data of different data platforms, wherein the configuration files include configuring multiple date formatting formats; Segment each of the read configuration files to obtain configuration files of multiple fields, and store the configuration files of the multiple fields in a memory; Based on the returned data of each data platform, obtaining configuration file objects of multiple fields corresponding to each data platform from the memory, and converting the configuration file object of each field into a JSON object; Use the preset judgment logic to compare the current fields of the JSON objects corresponding to each two data platforms to obtain consistency results; Among them, the configuration files corresponding to the returned data of different data platforms are read, including: Determine whether the returned data of different data platforms have passed the program parameters and obtain the determination result; Determine the path of the corresponding configuration file according to the judgment result, and read the configuration file according to the path of the corresponding configuration file; Wherein, determining the path of the corresponding configuration file according to the judgment result, and reading the configuration file according to the path of the corresponding configuration file includes: When the judgment result is that the program parameter is passed, the set parameter is read as the path of the configuration file, and the configuration file is read according to the set parameter; When the judgment result is that the program parameter is not passed, the directory where the returned data is located is used as the path of the configuration file, and the configuration file is read from the directory.
2. The method according to claim 1, It is characterized in that Use the preset judgment logic to compare the current fields of the JSON objects corresponding to each two data platforms to obtain consistency results, including: The current fields of the JSON objects corresponding to every two data platforms are passed as transfer parameters to a tool class containing a preset judgment logic. The preset judgment logic is used in the tool class to compare the passed parameters to obtain a consistency result.
3. The method according to claim 2, It is characterized in that The preset judgment logic is used in the tool class to compare the transmitted parameters to obtain a consistency result, including: In the tool class, determine whether the current fields of the JSON objects corresponding to each of the two data platforms are both empty as the passing parameters. If so, the return data of the data platforms corresponding to the two JSON objects are consistent. If one is not empty, the return data of the data platforms corresponding to the two JSON objects are inconsistent. If both are not empty, add the keys of the current fields of the two JSON objects to the unordered set, traverse the unordered set, obtain the values of the current fields of the two JSON objects from the unordered set and compare the values, and obtain the consistency result based on the comparison of the values.
4. The method according to claim 3, It is characterized in that Obtaining values of current fields of the two JSON objects from the unordered set and comparing the values, and obtaining consistency results according to the comparison of the values, including: Traverse all fields of two JSON objects in the unordered collection, obtain values of two current fields and compare the values of the two current fields; If only one of the values of the two current fields is empty, the returned data of the data platform corresponding to the two JSON objects are inconsistent; If the values of the two current fields are not empty, then compare whether the values of the two current fields are consistent. If they are inconsistent, continue to determine the types of the values of the two current fields, and obtain a consistency result based on the types.
5. The method according to claim 4, It is characterized in that Continue to determine the types of the values of the two current fields, and obtain consistency results according to the types, including: If one of the values of the two current fields is a long integer type and the other is a string type, the value of the string type is parsed according to the formatting format in the configuration file; If the parsed value is equal to the value of the long integer type, continue to traverse the next field. When the values corresponding to all fields are equal, the return data of the data platform corresponding to the two JSON objects are consistent.
6. A device for determining the consistency of returned data, It is characterized in that The device comprises: A reading device, used to read configuration files corresponding to the returned data of different data platforms, wherein the configuration files include formats for configuring multiple date formats; A segmentation device, used for segmenting each read configuration file to obtain configuration files of multiple fields, and storing the configuration files of the multiple fields in a memory; A conversion device, used for obtaining configuration file objects of multiple fields corresponding to each data platform from the memory based on the return data of each data platform, and converting the configuration file object of each field into a JSON object; A comparison device, used to compare the current fields of the JSON objects corresponding to each two data platforms using a preset judgment logic to obtain a consistency result; Wherein, the reading device is used for: Determine whether the returned data of different data platforms have passed the program parameters and obtain the determination result; Determine the path of the corresponding configuration file according to the judgment result, and read the configuration file according to the path of the corresponding configuration file; Wherein, the reading device is used for: When the judgment result is that the program parameter is passed, the set parameter is read as the path of the configuration file, and the configuration file is read according to the set parameter; When the judgment result is that the program parameter is not passed, the directory where the returned data is located is used as the path of the configuration file, and the configuration file is read from the directory.
7. A device for determining the consistency of returned data, It is characterized in that The device comprises: one or more processors; and A memory storing computer readable instructions which, when executed, cause the processor to perform the operations of the method as claimed in any one of claims 1 to 5.
8. A computer-readable medium having computer-readable instructions stored thereon, wherein the computer-readable instructions can be executed by a processor to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Configuration file calibration method and device
CN106021119A
Data calling method and device
CN107346320A
Data analysis and verification method and device
CN110727691A
Configuration file analysis method and system and electronic equipment
CN111124479A
