Check patentability & draft patents in minutes with Patsnap Eureka AI!

JSON character string comparison method and device, equipment and storage medium

A string and comparison result technology, applied in the field of data processing, can solve the problems of wrong comparison results, time-consuming, and low accuracy of comparison results, and achieve the effect of reducing time loss and improving accuracy

Pending Publication Date: 2020-08-25
深圳市卡数科技有限公司
View PDF5 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, when the amount of JSON string data is large, it will take a lot of time to rely on manual comparison with the naked eye, and it is easy to miss, and the accuracy of the comparison result is not high; secondly, the key-value pairs in the JSON string are out of order, The order of the key-value pairs in the JSON string returned by the server will change each time. The two SON strings after the order of the key-value pairs are changed are essentially the same. Since the webmaster tool can only compare the text, if the two JSON If the order of the key-value pairs in the string is changed, Webmaster Tools will return a comparison conclusion that the two JSON strings are inconsistent, and an erroneous comparison result will appear.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • JSON character string comparison method and device, equipment and storage medium
  • JSON character string comparison method and device, equipment and storage medium
  • JSON character string comparison method and device, equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0038] figure 1 It is a flowchart of a method for comparing JSON strings provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation of receiving multiple JSON strings sent by a client and comparing the multiple JSON strings. The method can be performed by a JSON character string comparison device, which can be implemented by software and / or hardware, and generally can be integrated in a unified server, and the unified server can communicate with the client, and the method specifically Including the following steps:

[0039] Step 110, according to the at least two JSON strings to be compared sent by the client, use the message digest algorithm MD5 to calculate the MD5 value of each JSON string.

[0040] In this step, after the user inputs at least two character strings to be compared in any format on the client, the client sends the at least two character strings to be compared to the server, and the server verifies the at least two chara...

Embodiment 2

[0058] Figure 2a It is a flow chart of a method for comparing JSON strings provided by Embodiment 2 of the present invention. This embodiment is applicable to sending multiple character strings to be compared input by the user to the server, receiving the comparison result sent by the server, and comparing the In the case of displaying results, the method can be executed by a JSON string comparison device, which can be implemented by software and / or hardware, and generally can be integrated in a client, and the client can communicate with the server, Described method specifically comprises the steps:

[0059] Step 210, receiving at least two character strings to be compared input by the user, and sending the at least two character strings to be compared to the server.

[0060] In a specific embodiment, the user can use the web interface (such as Figure 2b Enter at least two character strings to be compared in the input box above the submit button), then click the submit bu...

Embodiment 3

[0066] image 3 A structural diagram of a JSON character string comparison device provided in Embodiment 3 of the present invention, the device is applied to a server, and includes: MD5 value calculation module 310, key-value pair arrangement module 320, key-value pair comparison module 330 and comparison result feedback Module 340.

[0067] Wherein, the MD5 value calculation module 310 is used to calculate the MD5 value of each JSON string using the message digest algorithm MD5 according to at least two JSON strings to be compared sent by the client; the key-value pair arrangement module 320 is used to When there are at least two target JSON strings with inconsistent MD5 values, the key-value pairs in each of the target JSON strings are arranged in a preset order; the key-value pair comparison module 330 is used to Arrangement order, compare the key-value pair difference between two target JSON character strings respectively, and generate the key-value pair difference compar...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a JSON character string comparison method and device, equipment and a storage medium, and the method comprises the steps: respectively calculating the MD5 value of each JSON character string through employing a message digest algorithm MD5 according to at least two to-be-compared JSON character strings transmitted by a client; if at least two target JSON character strings with inconsistent MD5 values exist, arranging the key value pairs in each target JSON character string according to a preset arrangement sequence; according to the arrangement sequence of the key valuepairs, comparing key value pair differences between every two target JSON character strings, and generating key value pair difference comparison results of every two target JSON character strings; and feeding back a key value pair difference comparison result to the client. The embodiment of the invention provides a simple and convenient method for comparing the JSON character strings, the accuracy of a comparison result is improved, and the time loss caused by manually comparing the JSON character strings is reduced.

Description

technical field [0001] Embodiments of the present invention relate to data processing technologies, and in particular to a method, device, equipment and storage medium for comparing JSON strings. Background technique [0002] JSON (JavaScript Object Notation, JavaScript Object Notation) is a lightweight data exchange format that uses a text format that is completely independent of the programming language to store and represent data. The concise and clear hierarchical structure makes JSON an ideal data exchange language . During server testing, it is often necessary to compare the returned JSON strings to find out the differences and determine whether the JSON strings returned by the server are correct. [0003] There are mainly two existing solutions for comparing JSON strings. The first is to compare two JSON strings with the naked eye; the second is to use other public web page comparison tools, such as webmaster tools, to compare JSON strings. Compared. [0004] Howev...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/903
CPCG06F16/90344
Inventor 万伟
Owner 深圳市卡数科技有限公司
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More