Data encryption query method and device, equipment and storage medium
By generating keys based on browser fingerprints to encrypt and decrypt the target product information in the e-commerce system, the problem of crawler programs crawling key information in the e-commerce system is solved, and the system performance and security are improved.
Patent Information
- Application Number
- CN202411507344.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-07
AI Technical Summary
Key information such as product prices in e-commerce systems is crawled in large quantities by crawler programs, resulting in increased server resource consumption, affecting website performance and stability, and may cause information leakage and user misleading.
By using the key obtained based on the browser fingerprint to encrypt and decrypt the target product information, avoid displaying information in the form of pictures, thereby preventing the crawler program from identifying and crawling key information through OCR technology.
It effectively avoids crawler programs identifying and crawling product information through OCR technology, preventing key information leakage, reducing the consumption of server resources, and improving the performance and stability of the website.
Smart Images

Figure CN119397594A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a data encryption query method, device, equipment and storage medium. Background Art
[0002] E-commerce systems refer to platforms that provide goods or service transactions through the Internet. The price of goods in e-commerce systems is an important factor that affects users' purchasing decisions, and is also sensitive information between e-commerce platforms and competitors. If key information such as product prices is captured in large quantities by crawlers, on the one hand, crawlers will consume the server resources of e-commerce platforms and affect the performance and stability of the website; on the other hand, crawlers may tamper with or leak product price information, causing misleading or losses to users.
[0003] At present, the commonly used anti-crawler solution for product information is to display product information such as prices in the form of pictures on the web page. Displaying product information through picture technology will increase the computing resources occupied by the web page, and it is impossible to completely prevent crawlers from using OCR (Optical Character Recognition) technology to identify and crawl product information in the picture. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a data encryption query method, device, equipment and storage medium, which can use the key obtained based on the browser fingerprint to perform encryption and decryption operations on the target product information to be queried, avoiding the problem that the key information of the product is crawled by the crawler program due to the display of the target product information in the form of pictures. The specific scheme is as follows:
[0005] In a first aspect, the present application provides a data encryption query method, comprising:
[0006] Embed the basic product information corresponding to the target product to be queried and the target key obtained based on the browser fingerprint into the preset access request;
[0007] Sending the preset access request to the server based on the preset axios library, so that the server searches for the target product information corresponding to the target product according to the basic product information in the preset access request, encrypts the found target product information using the target key, and returns a response message containing the encrypted target product information to the browser;
[0008] The response message returned by the server is received, and the encrypted target product information in the response message is decrypted using the target key to obtain the target product information corresponding to the target product.
[0009] Optionally, before embedding the basic product information corresponding to the target product to be queried and the target key obtained based on the browser fingerprint into the preset access request, the method further includes:
[0010] Determine whether there is a preset storage file with a preset string as a prefix and a preset time point as a suffix in the preset axios library;
[0011] If the preset storage file with the preset string as a prefix and the preset time point as a suffix does not exist in the preset axios library, the characteristic information of the browser end is recorded on a preset canvas element, and the data uniform resource locator corresponding to the characteristic information is determined as the browser fingerprint;
[0012] The browser fingerprint is subjected to summary calculation by a preset summary calculation algorithm, and the corresponding calculation result is determined as the target key.
[0013] Optionally, before sending the preset access request to the server based on the preset axios library, the method further includes:
[0014] storing the target key in the preset storage file with a preset key name, and determining the preset storage file storing the target key as a first target storage file;
[0015] Retrieve from the preset storage file list whether there is a second target storage file for recording the request order; if the second target storage file does not exist, generate the second target storage file, generate a target parameter value corresponding to the second target storage file, and set the target parameter value to an initial value; wherein the target parameter value is used to perform encryption and decryption operations on the target commodity information;
[0016] If the second target storage file exists, the target parameter value corresponding to the second target storage file is increased, and the second target storage file is updated based on the corresponding increase result;
[0017] If the target parameter value corresponding to the second target storage file is greater than a preset threshold, resetting the target parameter value to the initial value;
[0018] The target key in the first target storage file and the target parameter value corresponding to the second target storage file are added to the preset access request, so that the server can encrypt the target commodity information by using the target key and the target parameter value.
[0019] Optionally, the decrypting the encrypted target commodity information in the response message by using the target key to obtain the target commodity information corresponding to the target commodity includes:
[0020] Acquire a target field corresponding to the target product information from the response message;
[0021] Determining encrypted data from the encrypted target commodity information using the target field;
[0022] Decrypting the encrypted data in the encrypted target commodity information using the target key and the target parameter value corresponding to the second target storage file to obtain decrypted data;
[0023] The decrypted data is rendered to display the target product information corresponding to the target product.
[0024] In a second aspect, the present application provides a data encryption query method, which is applied to a server, including:
[0025] Obtaining a preset access request sent by the browser end, which includes basic product information and a target key obtained based on the browser fingerprint, searching for target product information corresponding to the target product according to the basic product information in the preset access request, and encrypting the found target product information using the target key;
[0026] Embedding the encrypted target product information corresponding to the target product into a response message;
[0027] A response message containing the encrypted target product information is returned to the browser end, so that the browser end decrypts the encrypted target product information in the response message using the target key to obtain the target product information corresponding to the target product.
[0028] Optionally, the using a target key to encrypt the found target commodity information includes:
[0029] defining a target annotation, and using the target annotation to mark the target commodity information to be encrypted, so as to obtain the marked target commodity information;
[0030] Obtaining the target key and the target parameter value corresponding to the second target storage file from the preset access request; wherein the target parameter value is used to perform encryption and decryption operations on the target commodity information;
[0031] The marked target commodity information is encrypted by using the target key and the target parameter value.
[0032] Optionally, after encrypting the found target commodity information by using the target key, the method further includes:
[0033] The field content is set to the target field of the basic product information, and the target field is embedded in the response message, so that the browser side searches for the encrypted data contained in the encrypted target product information according to the target field, and uses the target key to decrypt the encrypted data in the encrypted target product information.
[0034] In a third aspect, the present application provides a data encryption query device, which is applied to a browser, and includes:
[0035] A key embedding module, used to embed basic commodity information corresponding to the target commodity to be queried and a target key obtained based on the browser fingerprint into a preset access request;
[0036] A request sending module, used for sending the preset access request to the server based on the preset axios library, so that the server searches for the target product information corresponding to the target product according to the basic product information in the preset access request, encrypts the found target product information using the target key, and returns a response message containing the encrypted target product information to the browser;
[0037] The information decryption module is used to receive the response message returned by the server, and use the target key to decrypt the encrypted target product information in the response message to obtain the target product information corresponding to the target product.
[0038] In a fourth aspect, the present application provides an electronic device, including:
[0039] Memory, used to store computer programs;
[0040] A processor is used to execute the computer program to implement the aforementioned data encryption query method.
[0041] In a fifth aspect, the present application provides a computer-readable storage medium for storing a computer program, which implements the aforementioned data encryption query method when executed by a processor.
[0042] This application first embeds the basic product information corresponding to the target product to be queried and the target key obtained based on the browser fingerprint into a preset access request, and then sends the preset access request to the server based on the preset axios library, so that the server can find the target product information corresponding to the target product according to the basic product information in the preset access request, and use the target key to encrypt the found target product information, and return the response message containing the encrypted target product information to the browser, and finally receive the response message returned by the server, and use the target key to decrypt the encrypted target product information in the response message to obtain the target product information corresponding to the target product. It can be seen that this application first generates a target key based on the browser fingerprint, the server encrypts the target product information by using the target key, and the browser decrypts the received encrypted target product information by using the target key, avoiding the problem of displaying the target product information in the form of a picture, causing the crawler program to use OCR technology to identify and crawl the product information in the picture, thereby avoiding the problem of leakage of key product information. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0044] Figure 1 A flow chart of a data encryption transmission method disclosed in this application;
[0045] Figure 2 A flow chart of a data encryption method disclosed in this application;
[0046] Figure 3 A flow chart of a data encryption transmission method disclosed in this application;
[0047] Figure 4 A flow chart of a data decryption method disclosed in this application;
[0048] Figure 5 This is a schematic diagram of the structure of a data encryption transmission device disclosed in this application;
[0049] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] At present, the common anti-crawler scheme for product information is to display the price and other information of the product in the form of pictures on the web page, which will cause the crawler program to use OCR technology to identify and crawl the key product information in the picture, thereby causing the leakage of key product information. To this end, the present application provides a data encryption query method, which generates a target key by using a browser fingerprint and encrypts and decrypts the product information by using the target key, thereby avoiding the key product information being stolen by the crawler program using OCR technology due to the use of pictures to display the product information.
[0052] See also Figure 1 As shown, the embodiment of the present invention discloses a data encryption query method, which is applied to a browser side and includes:
[0053] Step S11: embed the basic product information corresponding to the target product to be queried and the target key obtained based on the browser fingerprint into the preset access request.
[0054] In this embodiment, before the basic product information and the target key obtained based on the browser fingerprint are embedded in the preset access request, it specifically also includes: determining whether there is a preset storage file with a preset string as a prefix and a preset time point as a suffix in the preset axios library; if there is no preset storage file with a preset string as a prefix and a preset time point as a suffix in the preset axios library, recording the characteristic information of the browser side on the preset canvas element, and determining the data uniform resource locator corresponding to the characteristic information as the browser fingerprint; performing a summary calculation on the browser fingerprint through a preset summary calculation algorithm, and determining the corresponding calculation result as the target key. In a specific implementation, check whether there is a cookie starting with "obf-" and ending with the date of the day in the axios library, that is, a preset storage file, such as "obf-20230618". If it does not exist, perform the following steps: first use the canvas element, that is, the preset canvas element, to draw the date of the day, user agent information, etc. on the canvas, calculate its data URL (Uniform Resource Locator) as the browser fingerprint, and then use the MD5 (Message Digest Algorithm 5) algorithm to perform a digest calculation on the browser fingerprint to obtain a 32-bit hexadecimal string as an encryption key, that is, a target key. It can be understood that when sending a preset access request, that is, an ajax request, it is also necessary to pass the commodity information to be queried, that is, the basic commodity information, as a parameter to the server, so that the server can use the basic commodity information to determine the target commodity that the browser needs to find. This embodiment generates a target key for encryption and decryption operations on the target commodity information by using the browser fingerprint, thereby ensuring the reliability of the generated target key.
[0055] Step S12: Send the preset access request to the server based on the preset axios library, so that the server searches for the target product information corresponding to the target product according to the basic product information in the preset access request, and uses the target key to encrypt the found target product information, and returns a response message containing the encrypted target product information to the browser.
[0056] In this embodiment, before sending a preset access request to the server, it specifically also includes: storing the target key in a preset storage file with a preset key name, and determining the preset storage file storing the target key as the first target storage file; retrieving from the preset storage file list whether there is a second target storage file for recording the request order, if the second target storage file does not exist, generating a second target storage file, generating a target parameter value corresponding to the second target storage file, and setting the target parameter value to an initial value; wherein the target parameter value is used to perform encryption and decryption operations on the target product information; if the second target storage file exists, increasing the target parameter value corresponding to the second target storage file, and updating the second target storage file based on the corresponding increase result; if the target parameter value corresponding to the second target storage file is greater than a preset threshold, resetting the target parameter value to the initial value; adding the target key in the first target storage file and the target parameter value corresponding to the second target storage file in the preset access request, so that the server encrypts the target product information through the target key and the target parameter value. In a specific implementation, the encryption key is stored in a cookie with a key name of "obf-key" and a validity period of the current day. Check whether there is a cookie named "obf-order", which is the second target storage file for recording the order of requests. If it does not exist, set its value to 1, i.e., the initial value, and store it in the cookie. If it exists, add 1 to its value and update it in the cookie. If its value exceeds the preset threshold of 10,000, it is reset to 1. The cookie is used to record the order of requests. Add two fields to the http request header of the preset access request: "obf-key" and "obf-order", which are set to the corresponding values in the cookie respectively. These two fields are used for encryption and decryption operations. By storing the target key in the cookie with a preset validity period, the timeliness of the target key is guaranteed. By using the dynamically changing target parameter value to encrypt and decrypt the target product information, the security of the encryption and decryption process is guaranteed.
[0057] Step S13: receiving the response message returned by the server, and decrypting the encrypted target product information in the response message using the target key to obtain the target product information corresponding to the target product.
[0058] In this embodiment, the process of decrypting the encrypted target commodity information may specifically include: obtaining the target field corresponding to the target commodity information from the response message; determining the encrypted data from the encrypted target commodity information using the target field; decrypting the encrypted data in the encrypted target commodity information using the target key and the target parameter value corresponding to the second target storage file to obtain the decrypted data; rendering the decrypted data to display the target commodity information corresponding to the target commodity. In a specific implementation, the browser first obtains the "obf-fields" field, i.e., the target field corresponding to the target commodity information, from the response header of the response message returned by the server using the axios interceptor. It should be noted that the field is a string separated by commas, indicating which fields are encrypted, such as "price, amount"; then, according to the "obf-key" and "obf-order" fields in the cookie, the encrypted fields in the response body are decrypted and restored to the real values, and the decrypted response body is passed to the front-end page for rendering, and finally the front-end page displays the price, quantity and other information of the commodity according to the data in the response body. By using the target field corresponding to the encrypted data in the target commodity information to determine the encrypted data in the target commodity information, the reliability of the data decryption process is ensured.
[0059] It can be seen that this application first generates a target key based on the browser fingerprint, the server encrypts the target product information by using the target key, and the browser decrypts the received encrypted target product information by using the target key, thereby avoiding the problem of displaying the target product information in the form of a picture, causing the crawler program to use OCR technology to identify and crawl the product information in the picture, thereby avoiding the problem of leakage of key product information.
[0060] In order to further illustrate the specific process of decrypting the encrypted target commodity information using the target key and the target parameter value, and make this scheme more specific and complete, as follows Figure 2 As shown, the embodiment of the present application discloses a data decryption method, including:
[0061] Step S21: Acquire a target field corresponding to the target product information from the response message, and use the target field to determine encrypted data from the encrypted target product information.
[0062] Step S22: Decrypt the encrypted data in the encrypted target commodity information using the target key and the target parameter value corresponding to the second target storage file to obtain decrypted data.
[0063] In this embodiment, the specific process of decrypting the encrypted data in the target commodity information using the target key and the target parameter value is as follows: the encryption result of the target data is recorded as b, and the last 5 characters of the encryption key key are obtained, which is a string consisting of 26 English letters, and converted into a hexadecimal value, recorded as key26, and key26 is added to the encryption order order to obtain a decimal value, recorded as sum, and sum is converted into a string form, and its last two characters are obtained, recorded as m and n respectively; if sum has only one digit, m and n are both equal to sum; according to the value of n, s is transformed differently to obtain a new string, recorded as r. The specific transformation rules are as follows: (1) If n is 0 or 5, no transformation is performed, that is, r=s. (2) If n is 1 or 6, m is converted into a decimal value, recorded as m10. Then s is divided by 10 to the power of m10, that is, the decimal point is moved to the left by m10 places, and the extra 0 at the end is removed to obtain r. For example, if s=12345000, m=5, n=1, then r=123.45. (3) If n is 2 or 8, convert both m and s to strings, then remove the same part in front of s as m to get r. For example, if s=5123.45, m=5, n=2, then r=123.45. (4) If n is 3 or 7, divide s into an integer part and a decimal part, and convert them to strings respectively. Then remove the n at the end of the integer part, and then concatenate the decimal part to get r. For example, if s=1233.45, m=5, n=3, then r=123.45 (5) If n is 4 or 9, convert both r and m to decimal values, then subtract m from r to get s. For example, if r=128.45, m=5, n=4, then s=123.45. Finally, convert r into a decimal value to get the final decryption result.
[0064] For the specific process of the above step S21, reference may be made to the corresponding contents disclosed in the above embodiment, which will not be described again here.
[0065] It can be seen that the embodiment of the present application determines the encrypted data from the encrypted target product information by utilizing the target field, thereby avoiding the problem of being unable to identify the encrypted data in the target product information during the data decryption process and ensuring the reliability of data decryption; in the data decryption process, by utilizing the decryption method corresponding to the data encryption method, different types of data decryption methods are performed according to the specific values of the parameters, thereby ensuring the reliability of the data encryption and decryption process.
[0066] Furthermore, in order to improve the integrity of the data encryption query method, such as Figure 3 As shown, the embodiment of the present application provides another data encryption query method, which is applied to the server, including:
[0067] Step S31, obtaining a preset access request sent by the browser end, which includes basic product information and a target key obtained based on the browser fingerprint, searching for target product information corresponding to the target product according to the basic product information in the preset access request, and encrypting the found target product information using the target key.
[0068] In this embodiment, encrypting the target commodity information may specifically include: defining a target annotation, marking the target commodity information to be encrypted with the target annotation to obtain the marked target commodity information; obtaining the target key and the target parameter value corresponding to the second target storage file from the preset access request; wherein the target parameter value is used to perform encryption and decryption operations on the target commodity information; encrypting the marked target commodity information with the target key and the target parameter value. In a specific implementation, define an annotation named "@Obf" to mark the fields to be encrypted, and the annotation can be applied to the attributes in the entity class or the return value type; use the Spring framework as a web development tool, and use its filter function to obtain the "obf-key" and "obf-order" fields from the request header of the preset access request sent by the front end as the encryption key and order; traverse all the attributes in the response body, find the attributes with the "@Obf" annotation, and encrypt their values using the preset encryption algorithm. By defining the target annotation to mark the encrypted data to be encrypted in the target commodity information, the problem of being unable to determine the data to be encrypted is avoided, and the reliability of the data encryption process is ensured. After encrypting the target product information, the process further includes: setting the field content to the target field of the basic product information, namely "obf-fields", to the names of all encrypted attributes separated by commas, and embedding the target field into the response header of the response message, so that the browser can search for the encrypted data contained in the encrypted target product information according to the target field, and decrypt the encrypted data in the encrypted target product information using the target key.
[0069] Step S32: embed the encrypted target product information corresponding to the target product into a response message.
[0070] It is understandable that after the target product information is encrypted, the encrypted target product information needs to be embedded in the response message so that the browser can perform a decryption operation according to the encrypted target product information in the response message.
[0071] Step S33: Return the response message containing the encrypted target product information to the browser end, so that the browser end uses the target key to decrypt the encrypted target product information in the response message to obtain the target product information corresponding to the target product.
[0072] It can be understood that in this embodiment, in addition to the encrypted target product information, the response message returned to the browser also includes a target field whose field content is the basic product information, so that the browser can use the target key, target parameter value and the target field contained in the corresponding message to decrypt the encrypted target product information sent locally.
[0073] It can be seen that this application first generates a target key based on the browser fingerprint, the server encrypts the target product information by using the target key, and the browser decrypts the received encrypted target product information by using the target key, thereby avoiding the problem of displaying the target product information in the form of a picture, causing the crawler program to use OCR technology to identify and crawl the product information in the picture, thereby avoiding the problem of leakage of key product information.
[0074] To further illustrate the specific process of encrypting the target product information using the target key and the target parameter value, and to make this scheme more complete, Figure 4 As shown, the embodiment of the present application discloses a data encryption method, including:
[0075] Step S41: define a target annotation, use the target annotation to mark the target commodity information that needs to be encrypted, and obtain the target key and the target parameter value corresponding to the second target storage file from a preset access request.
[0076] Step S42: Encrypt the marked target commodity information using the target key and the target parameter value corresponding to the second target storage file.
[0077] In this embodiment, the process of encrypting the target product may specifically include: recording the real value as r and converting it into a string form; obtaining the last 5 characters of the encryption key key, which is a string composed of 26 English letters, and converting it into a hexadecimal value, recorded as key26; adding key26 and the encryption order order to obtain a decimal value, recorded as sum; converting sum into a string form and obtaining its last two characters, recorded as m and n respectively. If sum has only one digit, m and n are both equal to sum; performing different transformations on r according to the value of n to obtain a new string, recorded as s. The specific transformation rules are as follows: (1) If n is 0 or 5, no transformation is performed, that is, s=r. (2) If n is 1 or 6, convert m into a decimal value, recorded as m10. Then multiply r by 10 to the power of m, that is, move the decimal point to the right by m places, to obtain s. For example, if r=123.45, m=5, and n=1, then s=12345000. (3) If n is 2 or 7, convert both m and r to strings, and then concatenate m to the front of r to obtain s. For example, if r=123.45, m=5, and n=2, then s=5123.45. (4) If n is 3 or 8, divide r into the integer part and the decimal part and convert them into strings respectively. Then add n to the end of the integer part and concatenate the decimal part to obtain s. For example, if r=123.45, m=5, and n=3, then s=1233.45. (5) If n is 4 or 9, convert both r and m to decimal values, and then add r to m to obtain s. For example, if r=123.45, m=5, and n=4, then s=128.45. Then convert s to binary form and pad it to 32 bits with 0, denoted as b. Finally, perform XOR operation on b and key, and convert the result to hexadecimal form to obtain the final encryption result. By performing encryption operations of different encryption processes on the data according to the specific value of the parameter n, the reliability of the encrypted data is guaranteed.
[0078] For the specific process of the above step S41, reference may be made to the corresponding contents disclosed in the above embodiment, which will not be described again here.
[0079] It can be seen that the present application encrypts the target product information using different encryption methods according to the specific values of the parameters in the encryption process, thereby ensuring that the encrypted target product information cannot be easily cracked, thereby improving the information security during data transmission.
[0080] For further information, see Figure 5 As shown, the embodiment of the present application also discloses a data encryption transmission device, which is applied to a browser side, including:
[0081] A key embedding module 11 is used to embed basic commodity information corresponding to the target commodity to be queried and a target key obtained based on the browser fingerprint into a preset access request;
[0082] A request sending module 12 is used to send the preset access request to the server based on the preset axios library, so that the server searches for the target product information corresponding to the target product according to the basic product information in the preset access request, encrypts the found target product information using the target key, and returns a response message containing the encrypted target product information to the browser;
[0083] The information decryption module 13 is used to receive the response message returned by the server, and use the target key to decrypt the encrypted target product information in the response message to obtain the target product information corresponding to the target product.
[0084] It can be seen that this application first generates a target key based on the browser fingerprint, the server encrypts the target product information by using the target key, and the browser decrypts the received encrypted target product information by using the target key, thereby avoiding the problem of displaying the target product information in the form of a picture, causing the crawler program to use OCR technology to identify and crawl the product information in the picture, thereby avoiding the problem of leakage of key product information.
[0085] In some specific implementations, the key embedding module 11 further includes:
[0086] A file determination unit, used to determine whether there is a preset storage file with a preset string as a prefix and a preset time point as a suffix in the preset axios library;
[0087] A fingerprint determination unit, configured to record the characteristic information of the browser end on a preset canvas element if the preset storage file with the preset string as a prefix and the preset time point as a suffix does not exist in the preset axios library, and determine a data uniform resource locator corresponding to the characteristic information as the browser fingerprint;
[0088] The target key determination unit is used to perform summary calculation on the browser fingerprint by using a preset summary calculation algorithm, and determine the corresponding calculation result as the target key.
[0089] In some specific implementations, the request sending module 12 specifically includes:
[0090] A file determining unit, configured to store the target key in the preset storage file with a preset key name, and determine the preset storage file storing the target key as a first target storage file;
[0091] a parameter value setting unit, configured to retrieve from a preset storage file list whether there is a second target storage file for recording the request order, and if the second target storage file does not exist, generate the second target storage file, generate a target parameter value corresponding to the second target storage file, and set the target parameter value as an initial value; wherein the target parameter value is used to perform encryption and decryption operations on the target commodity information;
[0092] a file updating unit, configured to increase the target parameter value corresponding to the second target storage file if the second target storage file exists, and update the second target storage file based on the corresponding increase result;
[0093] a parameter value resetting unit, configured to reset the target parameter value to the initial value if the target parameter value corresponding to the second target storage file is greater than a preset threshold;
[0094] A key adding unit is used to add the target key in the first target storage file and the target parameter value corresponding to the second target storage file in the preset access request, so that the server can encrypt the target product information through the target key and the target parameter value.
[0095] In some specific implementations, the information decryption module 13 specifically includes:
[0096] A field acquisition unit, used to acquire a target field corresponding to the target commodity information from the response message;
[0097] An encrypted data determining unit, configured to determine the encrypted data from the encrypted target commodity information using the target field;
[0098] a data decryption unit, configured to decrypt the encrypted data in the encrypted target commodity information by using the target key and the target parameter value corresponding to the second target storage file to obtain decrypted data;
[0099] A data rendering unit is used to render the decrypted data to display the target product information corresponding to the target product.
[0100] Furthermore, the present application also discloses an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0101] Figure 6A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the data encryption transmission method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0102] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0103] In addition, the memory 22 as a carrier for storing resources may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.
[0104] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the data encryption transmission method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0105] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed data encryption transmission method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0106] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0107] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0108] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0109] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0110] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data encryption query method, characterized in that: Applied to the browser side, including: Embed the basic product information corresponding to the target product to be queried and the target key obtained based on the browser fingerprint into the preset access request; Sending the preset access request to the server based on the preset axios library, so that the server searches for the target product information corresponding to the target product according to the basic product information in the preset access request, encrypts the found target product information using the target key, and returns a response message containing the encrypted target product information to the browser; The response message returned by the server is received, and the encrypted target product information in the response message is decrypted using the target key to obtain the target product information corresponding to the target product.
2. The data encryption query method according to claim 1, characterized in that: Before embedding the basic commodity information corresponding to the target commodity to be queried and the target key obtained based on the browser fingerprint into the preset access request, the method further includes: Determine whether there is a preset storage file with a preset string as a prefix and a preset time point as a suffix in the preset axios library; If the preset storage file with the preset string as a prefix and the preset time point as a suffix does not exist in the preset axios library, the characteristic information of the browser end is recorded on a preset canvas element, and the data uniform resource locator corresponding to the characteristic information is determined as the browser fingerprint; The browser fingerprint is subjected to summary calculation by a preset summary calculation algorithm, and the corresponding calculation result is determined as the target key.
3. The data encryption query method according to claim 2, characterized in that: Before sending the preset access request to the server based on the preset axios library, the method further includes: storing the target key in the preset storage file with a preset key name, and determining the preset storage file storing the target key as a first target storage file; Retrieve from the preset storage file list whether there is a second target storage file for recording the request order; if the second target storage file does not exist, generate the second target storage file, generate a target parameter value corresponding to the second target storage file, and set the target parameter value to an initial value; wherein the target parameter value is used to perform encryption and decryption operations on the target commodity information; If the second target storage file exists, the target parameter value corresponding to the second target storage file is increased, and the second target storage file is updated based on the corresponding increase result; If the target parameter value corresponding to the second target storage file is greater than a preset threshold, resetting the target parameter value to the initial value; The target key in the first target storage file and the target parameter value corresponding to the second target storage file are added to the preset access request, so that the server can encrypt the target commodity information by using the target key and the target parameter value.
4. The data encryption query method according to claim 3, characterized in that: The decrypting the encrypted target commodity information in the response message by using the target key to obtain the target commodity information corresponding to the target commodity includes: Acquire a target field corresponding to the target product information from the response message; Determining encrypted data from the encrypted target commodity information using the target field; Decrypting the encrypted data in the encrypted target commodity information using the target key and the target parameter value corresponding to the second target storage file to obtain decrypted data; The decrypted data is rendered to display the target product information corresponding to the target product.
5. A data encryption query method, characterized in that: Applied to the server, including: Obtaining a preset access request sent by the browser end, which includes basic product information and a target key obtained based on the browser fingerprint, searching for target product information corresponding to the target product according to the basic product information in the preset access request, and encrypting the found target product information using the target key; Embedding the encrypted target product information corresponding to the target product into a response message; A response message containing the encrypted target product information is returned to the browser end, so that the browser end decrypts the encrypted target product information in the response message using the target key to obtain the target product information corresponding to the target product.
6. The data encryption query method according to claim 5, characterized in that: The step of encrypting the found target commodity information by using the target key includes: defining a target annotation, and using the target annotation to mark the target commodity information to be encrypted, so as to obtain the marked target commodity information; Obtaining the target key and the target parameter value corresponding to the second target storage file from the preset access request; wherein the target parameter value is used to perform encryption and decryption operations on the target commodity information; The marked target commodity information is encrypted by using the target key and the target parameter value.
7. The data encryption query method according to claim 5, characterized in that: After the target commodity information is encrypted by using the target key, the method further includes: The field content is set to the target field of the basic product information, and the target field is embedded in the response message, so that the browser side searches for the encrypted data contained in the encrypted target product information according to the target field, and uses the target key to decrypt the encrypted data in the encrypted target product information.
8. A data encryption query device, characterized in that: Applied to the browser side, including: A key embedding module, used to embed basic commodity information corresponding to the target commodity to be queried and a target key obtained based on the browser fingerprint into a preset access request; A request sending module, used for sending the preset access request to the server based on the preset axios library, so that the server searches for the target product information corresponding to the target product according to the basic product information in the preset access request, encrypts the found target product information using the target key, and returns a response message containing the encrypted target product information to the browser; The information decryption module is used to receive the response message returned by the server, and use the target key to decrypt the encrypted target product information in the response message to obtain the target product information corresponding to the target product.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, used to execute the computer program to implement the data encryption query method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program, when executed by a processor, implements the data encryption query method as described in any one of claims 1 to 7.