Data interaction method and device and computer equipment
By separating data acquisition requests and decrypting encrypted sub-objects with preset keys, the inconvenience of key management in the data service system is solved, data security and privacy protection are enhanced, and a variety of application scenarios are supported.
Patent Information
- Application Number
- CN202411340787.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-03
AI Technical Summary
During the data encryption and decryption process of existing data service systems, data users need to hold a key, which leads to the system being modified and upgraded when the key version is iterated, which brings inconvenience to users.
Provides a data interaction method, which queries the data object and returns the encrypted sub-object by responding to the data acquisition request of the account, decrypts it with a preset key, separates the data acquisition request to reduce association relationships, and enhances privacy protection and security.
It reduces the risk of data leakage, enhances account privacy protection, supports multiple application scenarios, improves the flexibility and adaptability of the system, and simplifies data monitoring and potential leakage risk identification.
Smart Images

Figure CN119249450A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a data interaction method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] With the development of big data, data service systems have emerged. These systems can store large amounts of data and provide corresponding data when users need it through interaction with the service system. However, when providing data services to the outside world, some data is core data, which involves the association between data. Therefore, its associated items cannot be output in plain text and must be encrypted.
[0003] In traditional technologies, symmetric encryption or asymmetric encryption is usually used. When using symmetric encryption, the data provider (data service system) and the data user (user) need to share a key. In asymmetric encryption, the data provider uses a public key, while the data user uses a private key. However, both methods require the data user to hold the key, so in subsequent key version iterations, the data user needs to transform and upgrade its own system, which brings great inconvenience to the data user. Summary of the invention
[0004] Based on this, it is necessary to provide a data interaction method, apparatus, computer device, computer-readable storage medium and computer program product to address the above technical issues.
[0005] In a first aspect, the present application provides a data interaction method. The method comprises:
[0006] Responding to a first data acquisition request sent by an account; wherein the first data acquisition request carries data index information;
[0007] Querying the data object corresponding to the data index information, and returning the data object to the account;
[0008] Responding to a second data acquisition request sent by the account; wherein the second data acquisition request carries an encrypted sub-object of the data object;
[0009] Based on the preset key, the encrypted sub-object is decrypted to obtain a sub-data object, and the sub-data object is returned to the account.
[0010] In one embodiment, querying the data object corresponding to the data index information and returning the data object to the account includes:
[0011] According to the preset association identifier, matching and obtaining the data object corresponding to the association identifier from the data objects;
[0012] Using a preset encryption strategy, encrypt the data object corresponding to the association identifier to obtain an encrypted sub-object;
[0013] Return the encrypted sub-object and the data object whose association identifier does not match to the account.
[0014] In one embodiment, the method of encrypting the data object corresponding to the association identifier by using a preset encryption strategy to obtain an encrypted sub-object includes:
[0015] Establishing a first reference text and a second reference text; wherein the reference text contains all characters in the data object;
[0016] Obtaining a target character from the data object using a preset position strategy;
[0017] Acquire position information of the target character in the first reference text;
[0018] Obtaining a replacement character corresponding to the position information of the second reference text;
[0019] The corresponding target characters in the data object are replaced with the replacement characters to obtain an encrypted sub-object.
[0020] In one embodiment, obtaining the target character from the data object by using a preset position strategy includes:
[0021] Establishing a first position parameter and a second position parameter;
[0022] Taking the character of the first position parameter of the data object as the starting point and the second position parameter as the interval, characters are extracted in sequence to obtain the target character corresponding to the data object.
[0023] In one embodiment, decrypting the encrypted sub-object to obtain the sub-data object includes:
[0024] Obtaining a preset first reference text and a second reference text, as well as position parameters of encrypted characters;
[0025] According to the position parameter of the encrypted character, obtaining the position information of the encrypted character in the second reference text;
[0026] Obtaining a decrypted character corresponding to the position information of the first reference text;
[0027] The decrypted characters are used to replace the corresponding encrypted characters in the encrypted sub-object to obtain a sub-data object.
[0028] In one embodiment, the method further comprises:
[0029] Detecting the data acquisition request to determine whether there is an encryption identifier in the data acquisition request;
[0030] In a case where there is no encryption identifier in the data acquisition request, determining the data acquisition request as a first data acquisition request;
[0031] When the data acquisition request contains an encryption identifier, the data acquisition request is determined as a second data acquisition request.
[0032] In a second aspect, the present application also provides a data interaction device. The device comprises:
[0033] A request response module, used to respond to a first data acquisition request sent by an account; wherein the first data acquisition request carries data index information;
[0034] A data query module, used to query the data object corresponding to the data index information and return the data object to the account;
[0035] The request response module is further used to respond to a second data acquisition request sent by the account; wherein the second data acquisition request carries an encrypted sub-object of the data object;
[0036] The data decryption module is used to decrypt the encrypted sub-object based on a preset key to obtain a sub-data object, and return the sub-data object to the account.
[0037] In one embodiment, the data query module includes:
[0038] A data matching submodule, used to match the data object corresponding to the association identifier from the data objects according to the preset association identifier;
[0039] A data encryption submodule, used to encrypt the data object corresponding to the association identifier using a preset encryption strategy to obtain an encrypted subobject;
[0040] The data return submodule is used to return the encrypted sub-object and the data object whose association identifier does not match to the account.
[0041] In one embodiment, the data encryption submodule includes:
[0042] A reference text establishing unit, used to establish a first reference text and a second reference text; wherein the reference text contains all characters in the data object;
[0043] A target character acquisition unit, used to acquire the target character from the data object by using a preset position strategy;
[0044] A position information acquisition unit, used to acquire position information of the target character in the first reference text;
[0045] a replacement character obtaining unit, configured to obtain a replacement character corresponding to the position information of the second reference text;
[0046] The character replacement unit is used to replace the corresponding target characters in the data object with the replacement characters to obtain an encrypted sub-object.
[0047] In one embodiment, the target character acquisition unit includes:
[0048] A position parameter establishing subunit, used to establish a first position parameter and a second position parameter;
[0049] The target character acquisition subunit is used to extract characters in sequence starting from the character of the first position parameter of the data object and taking the second position parameter as an interval to obtain the target character corresponding to the data object.
[0050] In one embodiment, the data decryption module includes:
[0051] A data acquisition submodule, used to acquire a preset first reference text and a second reference text, and position parameters of encrypted characters;
[0052] A position information acquisition submodule, used for acquiring the position information of the encrypted character in the second reference text according to the position parameter of the encrypted character;
[0053] A decrypted character acquisition submodule, used to acquire a decrypted character corresponding to the position information of the first reference text;
[0054] The data decryption submodule is used to replace the corresponding encrypted characters in the encrypted sub-object with the decrypted characters to obtain a sub-data object.
[0055] In one embodiment, the device further comprises:
[0056] An encryption mark detection module is used to detect the data acquisition request and determine whether there is an encryption mark in the data acquisition request;
[0057] an acquisition request determination module, configured to determine the data acquisition request as a first data acquisition request when no encryption identifier is present in the data acquisition request;
[0058] The acquisition request acquisition module is further configured to determine the data acquisition request as a second data acquisition request when an encryption identifier exists in the data acquisition request.
[0059] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method for processing resource application as described in any one of the embodiments of the present disclosure is implemented.
[0060] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for processing resource application as described in any one of the embodiments of the present disclosure is implemented.
[0061] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for processing resource application as described in any one of the embodiments of the present disclosure is implemented.
[0062] The above-mentioned data interaction method, device, computer equipment, storage medium and computer program product can query and return the data object through the index information corresponding to the first data acquisition request in response to the first data acquisition request, and obtain and return the decrypted sub-data object by decrypting the encrypted sub-object in response to the second data acquisition request carrying the encrypted sub-object of the data object. The account data object is returned through the first data acquisition request, and there is an encrypted sub-object in the data object, and the second data acquisition is performed through the encrypted sub-object, which reduces the association between the data of the first data acquisition request and the data of the second data acquisition request, thereby reducing the risk of data leakage and enhancing the privacy protection of the account. At the same time, the first data acquisition request is separated from the second data acquisition request, so that the corresponding data can be monitored more clearly, potential leakage risks can be identified, and the security of the data can be further improved. At the same time, the account can flexibly obtain data through the first data acquisition request and the second data acquisition request, so that the system can support a variety of application scenarios, further improving the flexibility and adaptability of the method. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] FIG1 is a schematic diagram of a flow chart of a data interaction method in one embodiment;
[0064] FIG2 is a schematic diagram of a process of obtaining and encrypting data in one embodiment;
[0065] FIG3 is a schematic diagram of a process of data encryption in one embodiment;
[0066] FIG4 is a schematic diagram of a process of acquiring a target character in one embodiment;
[0067] FIG5 is a schematic diagram of a process of data decryption in one embodiment;
[0068] FIG6 is a schematic diagram of a process of classifying data acquisition requests in one embodiment;
[0069] FIG7 is a schematic diagram of a flow chart of a data interaction method according to an embodiment;
[0070] FIG8 is a schematic diagram of a flow chart of data encryption implementation in one embodiment;
[0071] FIG9 is a schematic diagram of a flow chart of data decryption implementation in one embodiment;
[0072] FIG10 is a structural block diagram of a data interaction device in one embodiment;
[0073] FIG. 11 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0074] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0075] In one embodiment, as shown in FIG1 , a data interaction method is provided. This embodiment is illustrated by applying the method to a server. It is understandable that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0076] Step S100, responding to a first data acquisition request sent by an account; wherein the first data acquisition request carries data index information.
[0077] In an exemplary embodiment, the method may be applied to a server of a data provider, and the account may include a server of a data user; that is, the data user interacts with the data provider through the account, and the data acquisition request sent is the data that the data user needs to obtain, etc.
[0078] In an exemplary embodiment, the data index information may be used to indicate the data to be obtained, such as the transcript of class XX, etc. The data acquisition request may include the data index information and other information, and may specifically include other information in the interaction between the two parties, such as, I need XX data, and extracting the data index information is XX data, etc.
[0079] Step S200, querying the data object corresponding to the data index information, and returning the data object to the account.
[0080] In an exemplary embodiment, index information can be used to query data objects corresponding to the index information, etc. It can be understood that the query method here can include using the index information to convert the index information into a data query statement (for example, an SQL statement) for searching and obtaining the corresponding data objects, etc.
[0081] Step S300, responding to a second data acquisition request sent by the account; wherein the second data acquisition request carries an encrypted sub-object of the data object.
[0082] In an exemplary embodiment, the source of the encrypted sub-object may include the encrypted sub-object returned by the first data acquisition request, etc.
[0083] In an exemplary embodiment, the second data acquisition request may include the encrypted sub-object returned by the first data acquisition request sent by the account, that is, the data returned by the first data acquisition request may include the encrypted sub-object and the data object. The encrypted sub-object can be used as a data acquisition request to interact with the data provider to obtain the target data object, etc.
[0084] In an exemplary embodiment, when the data corresponding to the first data interaction request does not need to be encrypted, that is, there is no encryption sub-object, the target data can be obtained only through the first data interaction request.
[0085] In an exemplary embodiment, the second data acquisition request may include an encrypted sub-object, wherein the encrypted sub-object may be obtained by encrypting a data query identifier, and the data query identifier may include storing the sub-data object in a data table, and the data table may be obtained by querying the data query identifier; for example, multiple data such as ID and name may be stored in a sub-data object (the corresponding data may be obtained by querying the sub-object data), and the sub-object data may be encrypted to obtain an encrypted sub-object, and when acquiring data, the encrypted sub-object and the unencrypted data object may be returned to the account; in another exemplary embodiment, the encrypted sub-object may also include directly encrypting the object data, and returning the encrypted data object as an encrypted sub-object to the account, and the account interacts with the data provider through the encrypted sub-object for decryption to obtain the target data, etc.
[0086] In an exemplary embodiment, the second data acquisition request may include an encrypted sub-object and may also include a data identifier. It can be understood that the encrypted sub-object can be obtained by encrypting the data query identifier. In this case, the data query identifier stores a lot of data. The data identifier can be used to specify the acquisition of part of the data instead of all the data. For example, the encrypted sub-object stores the ID, name, sales, etc. The second data acquisition request may include obtaining the ID in the encrypted sub-object, that is, only returning the ID, etc.
[0087] In an exemplary embodiment, when a second data acquisition request is received, only the data corresponding to the second data acquisition request can be returned. It is understandable that the encrypted sub-object corresponding to the second data acquisition request is obtained through the first data acquisition request, and the data corresponding to the second data acquisition request can be returned through the second data acquisition request. In this way, the data of the first data acquisition request and the data of the second data acquisition request can be separated, that is, the relationship between the two cannot be determined. It is understandable that there is a large amount of internal core data in the data summary, and this part of the data is internal related data, so this method can avoid the leakage of internal related data, etc. In this way, the account can clearly know the relationship between the two through the encrypted sub-object, but in the case of data leakage, the relationship between the two cannot be clearly known.
[0088] Step S400: decrypt the encrypted sub-object based on a preset key to obtain a sub-data object, and return the sub-data object to the account.
[0089] In an exemplary embodiment, the preset key of the data can be stored in the data provider, and the data user does not store any key; it can be understood that the encryption and decryption of the data are both performed by the data provider, and the data user is not involved in the encryption and decryption. This method can enable the data user to obtain the corresponding data without noticing, and complete the encryption of the data.
[0090] In the above data interaction method, in response to the first data acquisition request, the data object can be queried and returned through the index information corresponding to the first data acquisition request, and in response to the second data acquisition request carrying the encrypted sub-object of the data object, the encrypted sub-object is decrypted to obtain and return the decrypted sub-data object. The account data object is returned through the first data acquisition request, and there is an encrypted sub-object in the data object, and the second data is acquired through the encrypted sub-object, which reduces the association between the data of the first data acquisition request and the data of the second data acquisition request, thereby reducing the risk of data leakage and enhancing the privacy protection of the account. At the same time, the first data acquisition request is separated from the second data acquisition request, so that the corresponding data can be monitored more clearly, potential leakage risks can be identified, and the security of the data can be further improved. At the same time, the first data acquisition request and the second data acquisition request allow the account to flexibly obtain data, so that the system can support a variety of application scenarios, further improving the flexibility and adaptability of this method.
[0091] In one embodiment, as shown in FIG. 2 , the querying of the data object corresponding to the data index information and returning the data object to the account includes:
[0092] Step S201, according to the preset association identifier, matching and obtaining the data object corresponding to the association identifier from the data objects.
[0093] In an exemplary embodiment, the association identifier may include a data identifier of a pre-set core data, wherein the core data is associated with the internal data, so the association relationship between the core data and the other data cannot be output in plain text, that is, the core data and the other data cannot be output in plain text at the same time. The association identifier can be used to obtain the corresponding core data in the data object, and the data object corresponding to the association identifier is the core data, etc.
[0094] Step S202: using a preset encryption strategy, encrypt the data object corresponding to the association identifier to obtain an encrypted sub-object.
[0095] In an exemplary embodiment, an encryption strategy can be used to encrypt core data to obtain an encrypted sub-object. The encrypted sub-object can be used to make a second data acquisition request with the data to further obtain core data. The second data acquisition can only return the core data. It can be understood here that the first data acquisition request obtains part of the data, and the second data acquisition request obtains another part of the data. The data are not output at the same time. For example, the first data acquisition request obtains the student numbers of the entire class, and the second data acquisition request obtains the grades. The target data can be obtained by matching the student numbers with the grades one by one.
[0096] Step S203, returning the encrypted sub-object and the data object whose association identifier does not match to the account.
[0097] In an exemplary embodiment, the data object whose association identifier is not matched may include data whose identifier does not exist in the preset association identifier, etc. The data returned to the account here may include partially encrypted data objects, etc.
[0098] In this embodiment, the data object corresponding to the association identifier is obtained through the association identifier, and the data object is encrypted to obtain an encrypted sub-object, and the encrypted sub-object and the data object that does not match the association identifier are returned to the account. It can achieve encryption of some data objects through the association identifier, improve security and reduce the risk of sensitive information leakage, while retaining the availability of unencrypted data, meeting data acquisition requirements in different scenarios, and improving data acquisition efficiency while ensuring data security.
[0099] In one embodiment, as shown in FIG3 , the method of encrypting the data object corresponding to the association identifier by using a preset encryption strategy to obtain an encrypted sub-object includes:
[0100] Step S211, establishing a first reference text and a second reference text; wherein the reference text includes all characters in the data object.
[0101] In an exemplary embodiment, the reference text may be generated by random generation, wherein the first reference text must include all characters of the data object, etc.
[0102] Step S212: Obtain target characters from the data object using a preset position strategy.
[0103] In an exemplary embodiment, the target characters may include encrypted characters, that is, these characters are encrypted, etc. The specific position strategy may include any way of acquiring characters, including random acquisition, storing the acquired character position information, etc.
[0104] Step S213: obtaining the position information of the target character in the first reference text.
[0105] In an exemplary embodiment, the first reference text may include all characters of the data object, so the position information of the corresponding characters can be queried in the first reference text. Specifically, when there are two identical characters in the reference text, the position of the character that appears for the first time can be selected.
[0106] Step S214: obtaining a replacement character corresponding to the position information of the second reference text.
[0107] In an exemplary embodiment, obtaining the replacement characters corresponding to the position information of the second reference text may include extracting corresponding characters from the second reference text based on the position information. It can be understood here that, in order to facilitate decryption, the second reference text can use non-repeating characters, that is, there are no repeated characters, etc.
[0108] Step S215: Use the replacement character to replace the corresponding target character in the data object to obtain an encrypted sub-object.
[0109] In an exemplary embodiment, the target characters of the data object may be replaced with replacement characters obtained from the second reference text to obtain an encrypted sub-object, thereby completing encryption of the data object.
[0110] In this embodiment, by obtaining the target character, using the position of the target character in the first reference text, searching for the replacement character corresponding to the second reference text, and replacing the target character in the data object with the replacement character, an encrypted sub-object is obtained. This encryption method replaces the target character in the data object by establishing the first and second reference texts and using a preset position strategy, thereby achieving character-level encryption. This approach not only enhances the security of the data and reduces the risk of sensitive information being identified, but also maintains the structure and readability of the data, making it easy to decrypt and restore when needed. At the same time, the flexible replacement mechanism makes the encryption process more efficient and controllable, and adapts to different security requirements.
[0111] In one embodiment, as shown in FIG4 , obtaining the target character from the data object by using a preset position strategy includes:
[0112] Step S221, establishing a first position parameter and a second position parameter.
[0113] Step S222, starting from the character of the first position parameter of the data object and taking the second position parameter as an interval, extracting characters in sequence to obtain target characters corresponding to the data object.
[0114] In an exemplary embodiment, the first position parameter and the second position parameter can be obtained by randomly generating a character. It is understandable that in order to obtain the target character in this way, it is necessary to ensure that the sum of the first position parameter and the second position parameter is less than the number of characters in the data object. Otherwise, the character of the second position parameter cannot be found starting from the first position parameter.
[0115] In an exemplary embodiment, the characters of the first position parameter may be extracted, and the characters of the second position parameter may not be extracted, and so on.
[0116] In this embodiment, the target character is obtained by using the first position parameter and the second position parameter. This character extraction encryption method based on position parameters effectively extracts the target character from the data object by setting the starting point and interval, thereby realizing encryption. The position of the encrypted character can be flexibly selected and controlled, which improves the randomness and complexity of encryption and enhances the security of data; secondly, by extracting specific characters instead of the entire data object, the amount of calculation for encryption processing can be reduced and the system performance can be improved.
[0117] In one embodiment, as shown in FIG5 , decrypting the encrypted sub-object to obtain the sub-data object includes:
[0118] Step S401, obtaining a preset first reference text and a second reference text, and position parameters of encrypted characters.
[0119] In an exemplary embodiment, the first reference text and the second reference text may correspond to the first reference text and the second reference text used when encrypting the data object, etc. The position parameter of the encrypted character may include the position information of the target character obtained during the encryption process of the data object, etc. The encrypted character may include the target character, etc.
[0120] Step S402: acquiring position information of the encrypted character in the second reference text according to the position parameter of the encrypted character.
[0121] In an exemplary embodiment, the second reference text may include non-repeating characters, that is, each character may appear only once, in which way the position information of the encrypted character in the second reference text may be accurately determined.
[0122] Step S403, obtaining the decrypted characters corresponding to the position information of the first reference text.
[0123] In an exemplary embodiment, the characters at the corresponding positions of the first reference text can be obtained, that is, the decrypted characters. It can be understood that during encryption, the characters corresponding to the first reference text are replaced by the characters of the second reference text, so during decryption, it is necessary to use the characters of the first reference text to replace the characters corresponding to the second reference text, etc.
[0124] Step S404: Use the decrypted characters to replace the corresponding encrypted characters in the encrypted sub-object to obtain a sub-data object.
[0125] In an exemplary embodiment, after replacing the encryption sub-object of the encryption sub-object with the decryption character, the obtained data may include the target data, that is, the decrypted data, and the like.
[0126] In this embodiment, through this decryption method based on position parameters, the encrypted characters can be flexibly extracted from the encrypted sub-object, and replaced with the preset first and second reference texts to restore the original data. In this way, the efficiency and accuracy of the decryption process are ensured, the encrypted characters can be accurately located and replaced, and the risk of mis-encryption is reduced. At the same time, the flexibility of the position parameters allows the decryption process to adapt to different encryption strategies, enhances the security and scalability of the system, and ensures that the required information can be effectively restored while protecting data privacy.
[0127] In one embodiment, as shown in FIG6 , the method further includes:
[0128] Step S101: Detect the data acquisition request to determine whether there is an encryption identifier in the data acquisition request.
[0129] Step S102: if there is no encryption identifier in the data acquisition request, determine the data acquisition request as a first data acquisition request.
[0130] Step S103: when there is an encryption identifier in the data acquisition request, determine the data acquisition request as a second data acquisition request.
[0131] In an exemplary embodiment, when encrypting a data object, an encryption flag may be added to the encrypted sub-object. By determining whether the encryption flag exists, it may be accurately determined whether the data acquisition request is the first data acquisition request or the second data acquisition request.
[0132] In this embodiment, this encryption-identifier-based request detection method can effectively distinguish the types of data acquisition requests, so as to take corresponding processing measures. By judging whether there is an encryption identifier in the request, sensitive data requests that require special processing can be quickly identified, which enhances the flexibility of data security management; secondly, this classification mechanism enables the system to implement different access control policies for different types of requests, improving the security and efficiency of data access; finally, clear request classification helps to simplify the data processing process, reduce potential error risks, and ensure that the account can obtain appropriate permissions and protection when acquiring data.
[0133] In an exemplary embodiment, the data interaction method may be implemented as shown in the schematic diagram of FIG. 7 , and specifically includes:
[0134] Step S901: The data user sends a data acquisition request to the data provider, and transmits data feature items;
[0135] Step S902, the data provider receives a data request for data transmission;
[0136] Step S903, the data provider identifies whether the data feature item is encrypted; if so, proceed to step S904; if not, proceed to step S905;
[0137] Step S904, the data provider decrypts the data features;
[0138] Step S905, obtaining corresponding data;
[0139] Step S906, encrypt the core fields; and return the corresponding data to the data user;
[0140] Step S907: Obtain the data results returned by the data provider.
[0141] In an exemplary embodiment, the data encryption process may be implemented as shown in the schematic diagram of FIG8 , and specifically includes:
[0142] Step S911, define two sets of codebooks, A and B;
[0143] Step S912, convert the field to be encrypted into a lowercase string;
[0144] Step S913, decomposing the obtained lowercase character string into individual letters, and recording the corresponding position information of the letter in the code book A;
[0145] Step S914, storing the position information corresponding to all letters in an array;
[0146] Step S915, the data of the letter position information is stored, and a specific deletion operation is performed; that is, starting from position m, the nth value is deleted each time, the steps required for the deletion action are defined, and the position information of the letters deleted each time is recorded, and finally a new array is formed;
[0147] Step S916, traverse the new array, obtain the position information in the new array, obtain the character corresponding to each position information in the corresponding code book B, add the obtained string to the corresponding position of the field to be encrypted after deleting the character, and obtain a new string;
[0148] Step S917, mark the specified position of the new string to obtain the final encrypted sub-object.
[0149] In an exemplary embodiment, the data decryption process can be implemented as shown in the schematic diagram of FIG9 , and specifically includes:
[0150] Step S921, identifying whether there is an encryption mark in the encrypted sub-object, if so, the field is an encrypted string, and the corresponding encryption mark is removed;
[0151] Step S922, convert the string into a lowercase string, and decompose it into individual letters, record the position information corresponding to the letters, and form an array;
[0152] Step S923, performing a specific deletion operation on the position information array, i.e., starting from position m, deleting the nth value each time, defining the total number of steps to be performed for the deletion operation, and recording the position information of the letters deleted each time;
[0153] Step S924, split the encrypted character string corresponding to step S921 by letters, and obtain the position information corresponding to each character in key B;
[0154] Step S925, querying the letter corresponding to the position information in key A through the position information of step S924;
[0155] Step S926, add the letters in the queried key A to the corresponding positions of the field to be decrypted after the characters are deleted to obtain the decrypted data.
[0156] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0157] Based on the same inventive concept, the embodiment of the present application also provides a data interaction device for implementing the data interaction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data interaction device embodiments provided below can refer to the limitations on the data interaction method above, and will not be repeated here.
[0158] In one embodiment, as shown in FIG. 10 , a data interaction device 100 is provided, including: a request response module 101, a data query module 102 and a data decryption module 103, wherein:
[0159] A request response module, used to respond to a first data acquisition request sent by an account; wherein the first data acquisition request carries data index information;
[0160] A data query module, used to query the data object corresponding to the data index information and return the data object to the account;
[0161] The request response module is further used to respond to a second data acquisition request sent by the account; wherein the second data acquisition request carries an encrypted sub-object of the data object;
[0162] The data decryption module is used to decrypt the encrypted sub-object based on a preset key to obtain a sub-data object, and return the sub-data object to the account.
[0163] In one embodiment, the data query module includes:
[0164] A data matching submodule, used to match the data object corresponding to the association identifier from the data objects according to the preset association identifier;
[0165] A data encryption submodule, used to encrypt the data object corresponding to the association identifier using a preset encryption strategy to obtain an encrypted subobject;
[0166] The data return submodule is used to return the encrypted sub-object and the data object whose association identifier does not match to the account.
[0167] In one embodiment, the data encryption submodule includes:
[0168] A reference text establishing unit, used to establish a first reference text and a second reference text; wherein the reference text contains all characters in the data object;
[0169] A target character acquisition unit, used to acquire the target character from the data object by using a preset position strategy;
[0170] A position information acquisition unit, used to acquire position information of the target character in the first reference text;
[0171] a replacement character obtaining unit, configured to obtain a replacement character corresponding to the position information of the second reference text;
[0172] The character replacement unit is used to replace the corresponding target characters in the data object with the replacement characters to obtain an encrypted sub-object.
[0173] In one embodiment, the target character acquisition unit includes:
[0174] A position parameter establishing subunit, used to establish a first position parameter and a second position parameter;
[0175] The target character acquisition subunit is used to extract characters in sequence starting from the character of the first position parameter of the data object and taking the second position parameter as an interval to obtain the target character corresponding to the data object.
[0176] In one embodiment, the data decryption module includes:
[0177] A data acquisition submodule, used to acquire a preset first reference text and a second reference text, and position parameters of encrypted characters;
[0178] A position information acquisition submodule, used for acquiring the position information of the encrypted character in the second reference text according to the position parameter of the encrypted character;
[0179] A decrypted character acquisition submodule, used to acquire a decrypted character corresponding to the position information of the first reference text;
[0180] The data decryption submodule is used to replace the corresponding encrypted characters in the encrypted sub-object with the decrypted characters to obtain a sub-data object.
[0181] In one embodiment, the device further comprises:
[0182] An encryption mark detection module is used to detect the data acquisition request and determine whether there is an encryption mark in the data acquisition request;
[0183] an acquisition request determination module, configured to determine the data acquisition request as a first data acquisition request when no encryption identifier is present in the data acquisition request;
[0184] The acquisition request acquisition module is further configured to determine the data acquisition request as a second data acquisition request when an encryption identifier exists in the data acquisition request.
[0185] Each module in the above data interaction device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0186] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG11. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data object data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a data interaction method is implemented.
[0187] Those skilled in the art will understand that the structure shown in FIG. 11 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0188] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0189] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0190] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0191] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data interaction method, characterized in that: The method comprises: Responding to a first data acquisition request sent by an account; wherein the first data acquisition request carries data index information; Querying the data object corresponding to the data index information, and returning the data object to the account; Responding to a second data acquisition request sent by the account; wherein the second data acquisition request carries an encrypted sub-object of the data object; Based on the preset key, the encrypted sub-object is decrypted to obtain a sub-data object, and the sub-data object is returned to the account.
2. The method according to claim 1, characterized in that The querying of the data object corresponding to the data index information and returning the data object to the account includes: According to the preset association identifier, matching and obtaining the data object corresponding to the association identifier from the data objects; Using a preset encryption strategy, encrypt the data object corresponding to the association identifier to obtain an encrypted sub-object; Return the encrypted sub-object and the data object whose association identifier does not match to the account.
3. The method according to claim 2, characterized in that The method of encrypting the data object corresponding to the association identifier by using a preset encryption strategy to obtain an encrypted sub-object includes: Establishing a first reference text and a second reference text; wherein the reference text contains all characters in the data object; Obtaining a target character from the data object using a preset position strategy; Acquire position information of the target character in the first reference text; Obtaining a replacement character corresponding to the position information of the second reference text; The corresponding target characters in the data object are replaced with the replacement characters to obtain an encrypted sub-object.
4. The method according to claim 3, characterized in that The step of obtaining the target character from the data object by using a preset position strategy includes: Establishing a first position parameter and a second position parameter; Taking the character of the first position parameter of the data object as the starting point and the second position parameter as the interval, characters are extracted in sequence to obtain the target character corresponding to the data object.
5. The method according to claim 1, characterized in that The decrypting the encrypted sub-object to obtain the sub-data object comprises: Obtaining a preset first reference text and a second reference text, as well as position parameters of encrypted characters; According to the position parameter of the encrypted character, obtaining the position information of the encrypted character in the second reference text; Obtaining a decrypted character corresponding to the position information of the first reference text; The decrypted characters are used to replace the corresponding encrypted characters in the encrypted sub-object to obtain a sub-data object.
6. The method according to claim 1, characterized in that The method further comprises: Detecting the data acquisition request to determine whether there is an encryption identifier in the data acquisition request; In a case where there is no encryption identifier in the data acquisition request, determining the data acquisition request as a first data acquisition request; When the data acquisition request contains an encryption identifier, the data acquisition request is determined as a second data acquisition request.
7. A data interaction device, characterized in that: The device comprises: A request response module, used to respond to a first data acquisition request sent by an account; wherein the first data acquisition request carries data index information; A data query module, used to query the data object corresponding to the data index information and return the data object to the account; The request response module is further used to respond to a second data acquisition request sent by the account; wherein the second data acquisition request carries an encrypted sub-object of the data object; The data decryption module is used to decrypt the encrypted sub-object based on a preset key to obtain a sub-data object, and return the sub-data object to the account.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
