Data processing method, device and equipment
By using data index fields, encryption fields and type fields at the software level for verification, decryption and deserialization, the automation and security problems of data reading in computer software are solved, reducing development costs and improving efficiency.
Patent Information
- Application Number
- CN202411411445.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-10-10
AI Technical Summary
During the operation of computer software, data needs to be read quickly and securely, but the existing technology is difficult to achieve automation and security. At the same time, the hardware tamper-proof mechanism increases development costs, and manual backup and encryption complicates the development process.
Verification, decryption and deserialization of data index fields, encryption fields and type fields in data query instructions ensures data integrity and security, and realizes automated data reading at the software level to avoid additional hardware requirements.
It realizes the automation and security of data reading, reduces development costs, improves development efficiency, avoids the propagation of wrong data and the security of computer software operation.
Smart Images

Figure CN119312366A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device and equipment. Background Art
[0002] In the field of computer software security storage, data needs to be read. During the operation of computer software, a large amount of data will be generated.
[0003] Furthermore, there is an urgent need for a solution that can automatically, quickly and safely read data. Summary of the invention
[0004] The embodiments of the present application provide a data processing method, device and equipment to achieve the effect of automatically, quickly and safely reading data.
[0005] In a first aspect, an embodiment of the present application provides a method for processing data, comprising: in response to a data query instruction, reading data to be read indicated by the data query instruction.
[0006] According to the data index field in the data query instruction, the data index field is determined and processed for the read data to be read.
[0007] If it is determined that the determination process of the data index field of the read data to be read passes, then the read data to be read is verified according to each field in the data query instruction.
[0008] If it is determined that the verification process of the read data to be read has passed, the read data to be read is decrypted and deserialized in sequence to obtain processed data; and the processed data is fed back to the user.
[0009] In a possible implementation, the data to be read includes a first verification value, and the first verification value is generated based on a data index field, a data encryption field, and a data type field acquired when storing the data to be read.
[0010] According to each field in the data query instruction, the read data to be read is verified, including:
[0011] A second check value is generated according to the data index field, the data encryption field, and the data type field in the data query instruction.
[0012] If it is determined that the second verification value is consistent with the first verification value, it is determined that the verification process for the read data to be read has passed.
[0013] If it is determined that the second verification value is inconsistent with the first verification value, it is determined that the verification process performed on the read data to be read fails.
[0014] In a possible implementation, according to the data index field in the data query instruction, the determination process of the data index field of the read data to be read includes:
[0015] A comparison is performed between the data index field in the data query instruction and the data index field in the read data to be read.
[0016] If it is determined that the data index field in the data query instruction is consistent with the data index field in the read data to be read, it is determined that the determination process of the data index field of the read data to be read is passed.
[0017] If it is determined that the data index field in the data query instruction is inconsistent with the data index field in the read data to be read, it is determined that the determination process of the data index field of the read data to be read fails.
[0018] In a possible implementation manner, before the read data to be read is decrypted and deserialized in sequence to obtain processed data, the method further includes:
[0019] The data type field in the data query instruction is compared with the data type field in the data to be read.
[0020] If it is determined that the data type field in the data query instruction is consistent with the data type field in the data to be read, the steps of sequentially decrypting and deserializing the read data to be read are executed to obtain processed data.
[0021] In a possible implementation, the read data to be read is decrypted and deserialized in sequence to obtain processed data, including:
[0022] According to the data encryption field in the data query instruction, the decryption algorithm corresponding to the data to be read is determined; and according to the decryption algorithm corresponding to the data to be read, the data to be read is decrypted to obtain the decrypted data.
[0023] The decrypted data is input into a preset first function for calculation and processing to obtain a first return value; wherein the first return value represents the calculation and processing result of the first function; in response to the first return value being consistent with a pre-stored first preset return value, it is determined that the decryption of the data to be read is successful; wherein the pre-stored first preset return value represents that the format of the decrypted data is correct.
[0024] The decrypted data is deserialized to obtain processed data.
[0025] In a possible implementation, after deserializing the decrypted data to obtain processed data, the method further includes:
[0026] The data conforming to the preset coding format is input into the preset second function for calculation and processing to obtain a second return value; wherein the second return value represents the calculation and processing result obtained after the data conforming to the preset coding format is input into the second function.
[0027] In response to the second return value being consistent with a pre-stored second preset return value, it is determined that the deserialization processing of the decrypted data is successful; wherein the pre-stored second preset return value represents a calculation processing result obtained after the data to be read is input into the second function.
[0028] In a possible implementation, the method further includes:
[0029] In response to a data storage instruction, a data index field of the data to be stored indicated by the data storage instruction is determined; wherein the data storage instruction is used to indicate the storage of the data to be stored; the data to be stored carries a data type field and a data encryption field of the data to be stored.
[0030] Based on a preset mapping relationship, the pre-stored data type field corresponding to the data to be stored is determined according to the determined data index field of the data to be stored; wherein the preset mapping relationship represents the correspondence between the data index field and the data type field.
[0031] If it is determined that the pre-stored data type field corresponding to the data to be stored is consistent with the data type field carried in the data to be stored, the data to be stored is serialized and encrypted in sequence to obtain and store the encrypted data.
[0032] A first check value of the data to be stored is generated according to the data type field carried in the data to be stored, the data encryption field carried in the data to be stored, and the determined data index field of the data to be stored.
[0033] In a possible implementation, determining a data index field of the data to be stored indicated by the data storage instruction includes:
[0034] If the data index field of the data to be stored is not stored, the data message format of the data to be stored is determined, key information of the data to be stored is determined according to the data message format of the data to be stored, and the data index field of the data to be stored is generated according to the key information of the data to be stored.
[0035] If the data index field of the data to be stored is stored, the stored data index field is determined to be the data index field of the data to be stored.
[0036] In a possible implementation, serializing and encrypting the data to be stored in sequence to obtain and store the encrypted data includes:
[0037] The data to be stored is serialized to obtain data that conforms to the preset encoding format.
[0038] Data conforming to a preset encoding format is input into a preset third function for calculation and processing to obtain a third return value; wherein the third return value represents the calculation and processing result of the third function; in response to the third return value being consistent with a pre-stored third preset return value, it is determined that the serialization processing of the data to be stored is successful; wherein the pre-stored third preset return value represents that the input data conforms to the data format specification after serialization.
[0039] According to the data encryption field carried by the data to be stored, the encryption algorithm corresponding to the data to be stored is determined; and according to the encryption algorithm corresponding to the data to be stored, the data conforming to the preset encoding format is encrypted to obtain the encrypted data.
[0040] The encrypted data is processed by a preset fourth function for calculation to obtain a fourth return value; wherein the fourth return value represents the calculation result of the fourth function; in response to the fourth return value being consistent with a pre-stored fourth preset return value, it is determined that the encryption of the data conforming to the preset encoding format is successful; wherein the pre-stored fourth preset return value represents that the format of the encrypted data is correct.
[0041] Store encrypted data.
[0042] In a second aspect, an embodiment of the present application provides a data processing device, comprising: a reading unit, configured to read the to-be-read data indicated by the data query instruction in response to the data query instruction.
[0043] The determination unit is used to perform determination processing on the data index field of the read data to be read according to the data index field in the data query instruction.
[0044] The first processing unit is used to verify the read data to be read according to each field in the data query instruction if it is determined that the determination processing of the data index field of the read data to be read is passed.
[0045] The second processing unit is used for, if it is determined that the read data to be read has passed the verification process, then performing decryption processing and deserialization processing on the read data to be read in sequence to obtain processed data; and feeding back the processed data to the user.
[0046] In a possible implementation, the data to be read includes a first verification value, and the first verification value is generated based on a data index field, a data encryption field, and a data type field acquired when storing the data to be read.
[0047] The first processing unit comprises:
[0048] The first generating module is used to generate a second verification value according to the data index field, the data encryption field, and the data type field in the data query instruction.
[0049] The first determination module is used to determine that the verification process for the read data to be read has passed if it is determined that the second verification value is consistent with the first verification value.
[0050] The first determination module is further configured to determine that the verification process for the read data to be read fails if it is determined that the second verification value is inconsistent with the first verification value.
[0051] In a possible implementation, the determination unit includes:
[0052] The comparison module is used to compare the data index field in the data query instruction with the data index field in the read data to be read.
[0053] The second determination module is used to determine that the determination process of the data index field of the read data to be read is passed if it is determined that the data index field in the data query instruction is consistent with the data index field in the read data to be read.
[0054] The second determination module is further used to determine that the determination processing of the data index field of the read data to be read fails if it is determined that the data index field in the data query instruction is inconsistent with the data index field in the read data to be read.
[0055] In a possible implementation manner, before the second processing unit, the method further includes:
[0056] The comparison unit is used to compare the data type field in the data query instruction with the data type field in the data to be read.
[0057] The first determination unit is used to perform decryption processing and deserialization processing on the read data to be read in sequence to obtain processed data if it is determined that the data type field in the data query instruction is consistent with the data type field in the data to be read.
[0058] In a possible implementation, the second processing unit includes:
[0059] The decryption module is used to determine the decryption algorithm corresponding to the data to be read according to the data encryption field in the data query instruction; and decrypt the data to be read according to the decryption algorithm corresponding to the data to be read to obtain the decrypted data.
[0060] The first calculation module is used to input the decrypted data into a preset first function for calculation processing to obtain a first return value; wherein the first return value represents the calculation processing result of the first function; in response to the first return value being consistent with a pre-stored first preset return value, it is determined that the decryption of the data to be read is successful; wherein the pre-stored first preset return value represents that the format of the decrypted data is correct.
[0061] The first processing module is used to perform deserialization processing on the decrypted data to obtain processed data.
[0062] In a possible implementation manner, after the second processing unit, the method further includes:
[0063] The calculation unit is used to input data that conforms to the preset coding format into a preset second function for calculation processing to obtain a second return value; wherein the second return value represents the calculation processing result obtained after the data that conforms to the preset coding format is input into the second function.
[0064] The second determination unit is used to determine that the deserialization processing of the decrypted data is successful in response to the second return value being consistent with a pre-stored second preset return value; wherein the pre-stored second preset return value represents the calculation processing result obtained after the data to be read is input into the second function.
[0065] In a possible implementation, the device further includes:
[0066] The third determination unit is used to determine the data index field of the data to be stored indicated by the data storage instruction in response to the data storage instruction; wherein the data storage instruction is used to indicate the storage of the data to be stored; the data to be stored carries the data type field and data encryption field of the data to be stored.
[0067] The fourth determination unit is used to determine the pre-stored data type field corresponding to the data to be stored based on a preset mapping relationship and according to the determined data index field of the data to be stored; wherein the preset mapping relationship represents the correspondence between the data index field and the data type field.
[0068] The third processing unit is used to serialize and encrypt the data to be stored in sequence to obtain and store the encrypted data if it is determined that the pre-stored data type field corresponding to the data to be stored is consistent with the data type field carried in the data to be stored.
[0069] The generating unit is used to generate a first check value of the data to be stored according to the data type field carried in the data to be stored, the data encryption field carried in the data to be stored, and the determined data index field of the data to be stored.
[0070] In a possible implementation manner, the third determining unit includes:
[0071] The third determination module is used to determine the data message format of the data to be stored if the data index field of the data to be stored is not stored, determine the key information of the data to be stored according to the data message format of the data to be stored, and generate the data index field of the data to be stored according to the key information of the data to be stored.
[0072] The fourth determining module is used to determine that the stored data index field is the data index field of the data to be stored if the data index field of the data to be stored is stored.
[0073] In a possible implementation manner, the third processing unit includes:
[0074] The second processing module is used to perform serialization processing on the data to be stored to obtain data that complies with a preset encoding format.
[0075] A second calculation module is used to input data that conforms to a preset encoding format into a preset third function for calculation processing to obtain a third return value; wherein the third return value represents the calculation processing result of the third function; in response to the third return value being consistent with a pre-stored third preset return value, it is determined that the serialization processing of the data to be stored is successful; wherein the pre-stored third preset return value represents that the input data conforms to the data format specification after serialization.
[0076] The encryption module is used to determine the encryption algorithm corresponding to the data to be stored according to the data encryption field carried by the data to be stored; and encrypt the data that conforms to the preset encoding format according to the encryption algorithm corresponding to the data to be stored to obtain the encrypted data.
[0077] A third calculation module is used to process the encrypted data in a preset fourth function for calculation to obtain a fourth return value; wherein the fourth return value represents the calculation result of the fourth function; in response to the fourth return value being consistent with a pre-stored fourth preset return value, it is determined that the encryption of the data conforming to the preset encoding format is successful; wherein the pre-stored fourth preset return value represents that the format of the encrypted data is correct.
[0078] The storage module is used to store encrypted data.
[0079] In a third aspect, an embodiment of the present application provides a data processing device, including: a memory and a processor.
[0080] The memory stores computer-executable instructions.
[0081] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.
[0082] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.
[0083] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.
[0084] The data processing method, device and equipment provided by the embodiment of the present application, on the one hand, by comparing the values obtained by processing each field in the data query instruction with the values obtained by processing each field of the data stored in the electronic device, it is determined whether the stored data is consistent with the data to be read in the data query instruction, thereby avoiding reading wrong or tampered data, thereby ensuring the integrity of data reading; further, avoiding the propagation of erroneous data, and ensuring the security of computer software development and operation. On the other hand, through the design of this solution, developers only need to input the data query instruction containing the data index field, data encryption field, and data type field of the data to be read, and the electronic device can automatically locate, verify, decrypt and feedback the data to be read according to the data index field, data encryption field, and data type field, thereby realizing the automation of data reading of computer software. In addition, this solution is improved from the software, and the security of data can be guaranteed without adding additional hardware, thereby achieving the effect of automatic, fast and safe reading of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0085] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0086] Figure 1 Schematic diagram of the data processing method provided for this application Figure 1 ;
[0087] Figure 2 Schematic diagram of the data processing method provided for this application Figure 2 ;
[0088] Figure 3 Schematic diagram of the structure of the data processing device provided in this application Figure 1 ;
[0089] Figure 4 Schematic diagram of the structure of the data processing device provided in this application Figure 2 ;
[0090] Figure 5 A schematic diagram of the structure of the data processing device provided in this application.
[0091] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0092] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0093] After the data of the computer software is stored, the stored data needs to be read. During the operation of the computer software, a large amount of data will be generated, or developers need to store and read a large amount of data during the development of the computer software.
[0094] In order to ensure the normal operation of computer software or the normal progress of the development process, it is necessary to ensure the security of data reading.
[0095] In one example, a data tamper-proof mechanism is designed on the existing carrier that carries computer software, that is, from the hardware level; for example, a self-encrypting drive (SED) is set up. By avoiding tampering with the stored data, the security of reading the data is guaranteed.
[0096] However, the above-mentioned data tamper-proof mechanism designed from the hardware level will increase the cost of computer software development.
[0097] In another example, in order to ensure the security of data storage and reading, developers manually back up or encrypt data when developing computer software.
[0098] However, the above process of backing up or encrypting data increases the complexity of the development process, brings additional workload to developers, and reduces their work efficiency.
[0099] The present application provides a data processing method, device and equipment to solve the above technical problems.
[0100] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0101] Figure 1 Schematic diagram of the data processing method provided for this application Figure 1 ,like Figure 1 As shown, the method includes:
[0102] S101 . In response to a data query instruction, read the to-be-read data indicated by the data query instruction.
[0103] For example, the execution subject of the embodiment of the present application may be an electronic device, or a server, or a terminal device, or other devices or equipment that can execute the solution of the embodiment, and this is not limited. This embodiment is introduced with the execution subject being an electronic device.
[0104] During the development of computer software, for example, the computer software may be an in-vehicle application. In order to update the functions of the computer software, etc., the developer needs to read the data stored in the computer software.
[0105] When a developer needs to read data stored in computer software, the developer sends a data query instruction to the electronic device. The data query instruction is used to instruct the electronic device to read the data to be read. The data query instruction includes a data index field, a data encryption field, and a data type field of the data to be read.
[0106] The data index field represents the index information of the data. The data index field can be integer data or string data; the size of the data index field can be 128 bytes; for example, when the data index field is integer data, the data index field can be: vehicle identification code (for example, 12584313134), vehicle mileage (for example, 52690); when the data index field is string data, the data index field can be: user name (for example, Xiao Ming), vehicle color (for example, red), vehicle model (for example, AYHG), and last maintenance date (for example, January 1, 2024).
[0107] The data encryption field represents the encryption information of the data, wherein the data encryption field represents the designation of the encryption algorithm for the data to be read. For example, the encryption algorithm may be the fifth version of the message digest algorithm (Message Digest Algorithm 5, MD5) or the Advanced Encryption Standard (Advanced Encryption Standard, ASE) algorithm.
[0108] The data type field represents the type information of the data. For example, the data type field includes: numeric type, text type, and date type.
[0109] After receiving the data query instruction, the electronic device executes the command to read the data according to the data index field, the data encryption field, and the data type field in the data query instruction, so as to finally realize the data reading.
[0110] S102 . According to the data index field in the data query instruction, a determination process is performed on the data to be read based on the data index field.
[0111] Exemplarily, there is a one-to-one correspondence between the data index field and the data stored in the computer software, that is, each piece of stored data in the electronic device will only correspond to one data index field; therefore, after the electronic device identifies the data index field of the data to be read in the data query instruction, it can locate the data stored in the electronic device and obtain the data index field of the data stored in the electronic device.
[0112] The electronic device can determine whether the data to be queried indicated by the data query instruction exists in the electronic device by comparing the data index field of the data to be read in the data query instruction with the data index field of the stored data.
[0113] S103: If it is determined that the determination process of the data index field of the read data to be read is passed, then the read data to be read is verified according to each field in the data query instruction.
[0114] Exemplarily, the electronic device determines the data index field of the to-be-read data in the data query instruction, and after successfully comparing it with the data index field of the stored data, determines that the to-be-queried data indicated by the data query instruction exists in the electronic device.
[0115] After the electronic device determines the data to be queried, it further obtains the data index field, the data encryption field, and the data type field of the data stored in the electronic device corresponding to the data to be queried.
[0116] Next, the electronic device performs verification processing based on the data index field, data encryption field, and data type field in the data query instruction and the data index field, data encryption field, and data type field of the data stored in the electronic device. For example, the electronic device can combine the data index field and the data encryption field in the data query instruction to obtain a first combination value; then combine the data index field and the data encryption field of the data stored in the device to obtain a second combination value; the electronic device can determine whether the data in the data query instruction is consistent with the data stored in the electronic device by judging whether the first combination value and the second combination value are equal, thereby realizing verification processing of the read data to be read.
[0117] S104: If it is determined that the read data to be read has passed the verification process, the read data to be read is decrypted and deserialized in sequence to obtain processed data; and the processed data is fed back to the user.
[0118] Exemplarily, if the electronic device determines that the verification process of the data to be queried has passed, the read data to be read (that is, the data stored in the electronic device) is decrypted. For example, the electronic device identifies the data encryption field of the data to be read, determines the decryption algorithm corresponding to the data encryption field, and thus decrypts the data to be read.
[0119] After the decryption process is completed, the electronic device performs deserialization on the data to be read after the decryption is completed, wherein deserialization refers to processing the data to be read in a serialized state into data of the original structure, that is, a data format that can be recognized by developers.
[0120] After completing the deserialization of the data to be read, the electronic device feeds back the data of the original structure to the user (eg, developer). For example, the electronic device can feed back the processed data to the user through a graphical user interface (GUI), a desktop operating system or other visualization tools.
[0121] A data processing method provided in an embodiment of the present application compares the values obtained by processing each field (data index field, data encryption field, and data type field) in a data query instruction with the values obtained by processing each field (data index field, data encryption field, and data type field) of data stored in an electronic device, thereby determining whether the stored data is consistent with the data to be read in the data query instruction, thereby avoiding reading erroneous or tampered data, thereby ensuring the integrity of data reading; further, avoiding the spread of erroneous data and ensuring the security of computer software development and operation.
[0122] In addition, compared to the need for developers to manually store and back up data, in this embodiment, developers input data query instructions containing data index fields, data encryption fields, and data type fields containing the data to be read, and the electronic device can automatically locate, verify, decrypt and feedback the data to be read based on the data index fields, data encryption fields, and data type fields, thereby realizing the automation of data reading of computer software and improving the work efficiency of developers.
[0123] In addition, this embodiment ensures the security of data reading, that is, decryption is performed only after the verification of the data to be read is successful; by improving the data reading method from the software, existing hardware resources can be used without the need to purchase new hardware, thereby achieving the purpose of reducing costs.
[0124] Figure 2 Schematic diagram of the data processing method provided for this application Figure 2 ,like Figure 2 As shown, in this embodiment Figure 1 Based on the embodiment, a data processing method is described in detail, and the method includes:
[0125] S201. In response to a data storage instruction, determine a data index field of the data to be stored indicated by the data storage instruction; wherein the data storage instruction is used to instruct the storage of the data to be stored; the data to be stored carries a data type field and a data encryption field of the data to be stored.
[0126] For example, the execution subject of the embodiment of the present application may be an electronic device, or a server, or a terminal device, or other devices or equipment that can execute the solution of the embodiment, and this is not limited. This embodiment is introduced with the execution subject being an electronic device.
[0127] During the development of computer software, for example, the computer software may be an in-vehicle application. In order to record and update various data in the in-vehicle application, the developer needs to store the data in the in-vehicle application.
[0128] In this embodiment, the storage format of data is defined in the electronic device, that is, the storage format of data includes: a data index field, a data encryption field, a data type field and a data check field.
[0129] When the developer needs to store data in the in-vehicle application, the developer sends a data storage instruction to the electronic device, wherein the data storage instruction includes a data index field, a data type field, and a data encryption field of the data to be stored.
[0130] The electronic device receives the data storage instruction and analyzes the data index field in the data storage instruction. Figure 1 As mentioned in the embodiments, the data index field of each piece of data is unique. Therefore, the electronic device can determine whether the same data (i.e., the data stored last time) already exists in the electronic device by analyzing the data index field in the data storage instruction, for example, by traversing and comparing with the data index fields of each piece of data already stored in the electronic device, and then proceed to the subsequent data storage process.
[0131] In one example, in step S201, “determining the data index field of the data to be stored indicated by the data storage instruction” includes the following process:
[0132] If the data index field of the data to be stored is not stored, the data message format of the data to be stored is determined, key information of the data to be stored is determined according to the data message format of the data to be stored, and the data index field of the data to be stored is generated according to the key information of the data to be stored.
[0133] If the data index field of the data to be stored is stored, the stored data index field is determined to be the data index field of the data to be stored.
[0134] For example, in some cases, the electronic device cannot find the data index field in the data storage instruction; for such a situation, this embodiment proposes the following solution process:
[0135] First, the electronic device analyzes the data to be stored indicated by the data storage instruction, thereby obtaining the data message format of the data to be stored. For example, the data message format includes the storage format of the data to be stored, such as the field composition of the data to be stored, the meaning of each field, the content of each field, the encoding method, etc.
[0136] Next, the electronic device determines the key information of the data to be stored indicated in the data message format according to the data message format of the data to be stored. For example, the key information may be one of the contents included in the data message format.
[0137] Finally, the electronic device generates a data index field for the data to be stored according to the key information of the data to be stored.
[0138] For example, the electronic device analyzes the data to be stored and obtains its data message format including: the vehicle's unique identifier (vehicle_id, for example, "VH123"), the vehicle's location information (for example, represented by latitude and longitude information), the event type (event_type, for example, "speed_alert", representing a speed warning), and the timestamp of the event (timestamp, for example, "20240613082030").
[0139] By analyzing the data message format, the electronic device can determine the unique identifier of the vehicle, the event type, and the timestamp of the event in the data message format as key information in order to quickly retrieve a specific type of event that occurred at a specific time for the vehicle.
[0140] Next, the electronic device arranges the vehicle's unique identifier, event type, and timestamp of the event in the key information in a certain manner, for example, in the order of vehicle's unique identifier, event type, and timestamp of the event, and generates a data index field for the data to be stored.
[0141] S202. Based on a preset mapping relationship, determine the pre-stored data type field corresponding to the data to be stored according to the determined data index field of the data to be stored; wherein the preset mapping relationship represents the correspondence between the data index field and the data type field.
[0142] Exemplarily, the electronic device determines the data type field of the data to be stored according to a preset mapping relationship and a data index field of the data to be stored; wherein the preset mapping relationship may be pre-stored in the electronic device, or obtained by the electronic device by retrieving an external database.
[0143] For example, the preset mapping relationship can be: if the data index field is the vehicle identification code, the data type field is determined to be numeric; if the data index field is the user name, the data type field is determined to be text; if the data index field is the last maintenance date, the data type field is determined to be date.
[0144] S203: If it is determined that the pre-stored data type field corresponding to the data to be stored is consistent with the data type field carried in the data to be stored, serialization and encryption are performed on the data to be stored in sequence to obtain and store the encrypted data.
[0145] Exemplarily, the electronic device compares the data type field corresponding to the data to be stored with the data type field corresponding to the data stored last time; if the data type field corresponding to the data to be stored is consistent with the data type field corresponding to the data stored last time, it is determined that the judgment is passed and the subsequent process is entered.
[0146] After the data type is determined, the electronic device serializes the data to be stored; serialization refers to converting the data to be stored into a preset encoding format, wherein the preset encoding format may be: JSON, XML or binary format.
[0147] After the serialization is successful, the electronic device encrypts the serialized data to be stored. The electronic device reads the data encryption field of the data to be stored, identifies the encryption algorithm specified by the developer, and then encrypts the data to be stored according to the specified encryption algorithm.
[0148] In one example, in step S203, "serializing and encrypting the data to be stored in sequence, obtaining and storing the encrypted data" includes the following process:
[0149] The data to be stored is serialized to obtain data that conforms to the preset encoding format.
[0150] Data conforming to a preset encoding format is input into a preset third function for calculation and processing to obtain a third return value; wherein the third return value represents the calculation and processing result of the third function; in response to the third return value being consistent with a pre-stored third preset return value, it is determined that the serialization processing of the data to be stored is successful; wherein the pre-stored third preset return value represents that the input data conforms to the data format specification after serialization.
[0151] According to the data encryption field carried by the data to be stored, the encryption algorithm corresponding to the data to be stored is determined; and according to the encryption algorithm corresponding to the data to be stored, the data conforming to the preset encoding format is encrypted to obtain the encrypted data.
[0152] The encrypted data is processed by a preset fourth function for calculation to obtain a fourth return value; wherein the fourth return value represents the calculation result of the fourth function; in response to the fourth return value being consistent with a pre-stored fourth preset return value, it is determined that the encryption of the data conforming to the preset encoding format is successful; wherein the pre-stored fourth preset return value represents that the format of the encrypted data is correct.
[0153] Store encrypted data.
[0154] Exemplarily, this embodiment also includes determining whether serialization is successful and whether encryption is successful.
[0155] The determination of whether the serialization of the data to be stored is successful may include the following process:
[0156] First, the electronic device pre-stores the serialized data format specification, which may include the length of the serialized data to be stored and the format of the serialized data to be stored. For example, for integer data, the length after serialization is defined as 4 bytes; for string data, the length after serialization is defined as 8 bytes; the format of the serialized data is binary format.
[0157] Next, the serialized data (i.e., data that conforms to the preset encoding format) is input into the third function, and the third function checks the length and format of the serialized data. For example, the length of the serialized data can be checked by the validateSerializedBinaryData function, and the format of the serialized data can be verified by the parseFromBinary function.
[0158] After calculation and processing by the third function, a third return value is output. If the third return value is consistent with the pre-stored third preset return value, for example, the third return value and the pre-stored third preset return value are both 1, then it indicates that the input data complies with the data format specification after serialization, and thus indicates that the serialization is successful; conversely, if the third return value is not equal to the pre-stored third preset return value, for example, the third return value is 0, and the pre-stored third preset return value is 1, then it indicates that the input data does not comply with the data format specification after serialization, and thus indicates that the serialization has failed; the electronic device can generate and send a prompt message of serialization failure, and exit the data storage process.
[0159] The determination of whether the encryption of the data to be stored is successful may include the following process:
[0160] First, the electronic device uses the fourth function to verify the encrypted data according to the encryption format specification corresponding to the encryption algorithm, which may include checking whether there is specific verification information in the encrypted data. For example, taking the ASE algorithm as an example, the verification information can be a 16-byte initialization vector, which can be stored together with the encrypted data in the form of a prefix or suffix. For example, checking whether there is specific verification information in the encrypted data can be implemented by the verifyEncryptedFormat function.
[0161] Next, the fourth function outputs a fourth return value. If the fourth return value is equal to the pre-stored fourth preset return value, for example, both are 1, then it indicates that the format of the encrypted data is correct, and thus the data encryption is successful; conversely, if the fourth return value is not equal to the pre-stored fourth preset return value, for example, the fourth return value is 0, and the pre-stored fourth preset return value is 1, then it indicates that the format of the encrypted data is incorrect, and thus the data encryption has failed; the electronic device can generate and send a prompt message that the data encryption has failed, and exit the data storage process.
[0162] S204: Generate a first check value for the data to be stored according to the data type field carried in the data to be stored, the data encryption field carried in the data to be stored, and the determined data index field of the data to be stored.
[0163] Exemplarily, the electronic device generates a first check value for the data to be stored according to a data index field, a data type field, and a data encryption field corresponding to the data to be stored.
[0164] For example, the first check value of the data to be stored can be generated by adding the data index field, the data type field and the data encryption field. For example, the first check value = data index field + data type field + data encryption field. The addition here may be only a formal combination.
[0165] After generating the first verification value of the data to be stored, the electronic device stores the first verification value of the data to be stored and completes the data storage process.
[0166] S205 . In response to the data query instruction, read the to-be-read data indicated by the data query instruction.
[0167] The specific process of this step can refer to the process in step S101, which will not be repeated here.
[0168] S206 , according to the data index field in the data query instruction, perform determination processing on the data to be read.
[0169] The specific process of this step can refer to the process in step S102, which will not be repeated here.
[0170] In one example, step S206 includes the following process:
[0171] A comparison is performed between the data index field in the data query instruction and the data index field in the read data to be read.
[0172] If it is determined that the data index field in the data query instruction is consistent with the data index field in the read data to be read, it is determined that the determination process of the data index field of the read data to be read is passed.
[0173] If it is determined that the data index field in the data query instruction is inconsistent with the data index field in the read data to be read, it is determined that the determination process of the data index field of the read data to be read fails.
[0174] Exemplarily, the electronic device compares the data index field in the data query instruction with the data index field of the read data to be read. If the two are consistent, the data index field is determined and the subsequent data reading process is entered.
[0175] On the contrary, if the data index field in the data query instruction is inconsistent with the data index field of the data to be read, it means that the data index field in the data query instruction cannot locate the data stored in the electronic device, that is, the data to be queried by the data query instruction does not exist in the electronic device, and it is determined that the determination of the data index field fails. In this case, the electronic device terminates the data reading process and can generate a prompt message indicating that the data index field determination failed. After generation, the electronic device sends the prompt message to the developer.
[0176] S207: If it is determined that the determination process of the data index field of the read data to be read is passed, then the read data to be read is verified according to each field in the data query instruction.
[0177] The specific process of this step can refer to the process in step S103, which will not be repeated here.
[0178] In one example, in step S207, "verifying the read data to be read according to each field in the data query instruction" includes the following process:
[0179] A second check value is generated according to the data index field, the data encryption field, and the data type field in the data query instruction.
[0180] If it is determined that the second verification value is consistent with the first verification value, it is determined that the verification process for the read data to be read has passed.
[0181] If it is determined that the second verification value is inconsistent with the first verification value, it is determined that the verification process performed on the read data to be read fails.
[0182] Exemplarily, the data to be read includes a first check value, which is generated based on a data index field, a data encryption field, and a data type field acquired when the data to be read is stored.
[0183] Under the condition that the determination processing of the data index field of the data to be read has passed, the electronic device generates a second verification value according to each field in the data query instruction; compares the second verification value with the first verification value included in the data to be read, and if the comparison result is consistent, it is determined that the verification processing of the read data to be read has passed; otherwise, it is determined that the verification processing of the read data to be read has not passed, the data reading process is terminated, and the electronic device generates and sends a prompt message that the data verification processing has failed.
[0184] For example, when the first check value = data index field + data type field + data encryption field, the second check value is also calculated using the same logic, that is, the second check value is a combination of the data index field, data type field, and data encryption field in the data query instruction.
[0185] By comparing the first check value with the second check value, it can be determined whether the data index field, data type field, and data encryption field of the data to be read are completely consistent with the data index field, data encryption field, and data type field in the data query instruction, and then it can be determined whether the data to be read has been tampered with (for example, by an unauthorized user), thereby ensuring the integrity and consistency of the data; avoiding reading erroneous or tampered data, and thus avoiding the spread of erroneous data, ensuring the smooth progress of computer software development.
[0186] For example, a cyclic redundancy check (CRC) or a hash value check method may be used to compare the first check value with the second check value.
[0187] If CRC verification is used, first, the electronic device serializes the first verification value and the second verification value respectively (for example, converts the first verification value and the second verification value into binary format); next, the electronic device calculates the CRC verification code of the serialized first verification value and the CRC verification code of the second verification value according to the CRC algorithm selected by the developer (for example, CRC-16, CRC-32); then, the electronic device compares the CRC verification code of the first verification value with the CRC verification code of the second verification value; if the two are equal, the verification is determined to have passed, otherwise, the verification is determined to have failed.
[0188] If hash value verification is adopted, first, the electronic device serializes the first verification value and the second verification value respectively (for example, converts the first verification value and the second verification value into the format of a string); next, the electronic device calculates the hash value of the serialized first verification value and the hash value of the second verification value respectively according to the selected hash function (for example, SHA-256, SHA-512); then, the electronic device compares the hash value of the first verification value and the hash value of the second verification value; if the two are equal, it is determined that the verification has passed, otherwise, it is determined that the verification has failed.
[0189] S208: Compare the data type field in the data query instruction with the data type field in the data to be read.
[0190] If it is determined that the data type field in the data query instruction is consistent with the data type field in the data to be read, the steps of sequentially decrypting and deserializing the read data to be read are executed to obtain processed data.
[0191] Exemplarily, the electronic device compares the data type field in the data query instruction with the data type field in the data to be read, and determines whether the data type field in the data query instruction matches the data type field in the data to be read based on the comparison result.
[0192] If the data type field in the data query instruction is consistent with the data type field in the data to be read, it indicates that the data type field in the data query instruction is consistent with the data type field in the data to be read, and the subsequent data reading process continues.
[0193] On the contrary, if the data type field in the data query instruction is inconsistent with the data type field in the data to be read, the data reading process is terminated, and the electronic device generates and sends a prompt message to the developer that the data type field determination failed.
[0194] By comparing the data type field in the data query instruction with the data type field in the data to be read, it is determined whether the data type of the data the developer wants to query is consistent with the data type of the data to be obtained, thereby avoiding the problem of data type conversion errors during the data reading process and ensuring the security of the data reading process.
[0195] S209: If it is determined that the verification process of the read data to be read passes, the read data to be read is decrypted and deserialized in sequence to obtain processed data; and the processed data is fed back to the user.
[0196] The process of this step may refer to step S104 and will not be described in detail here.
[0197] In one example, step S209 includes the following process:
[0198] According to the data encryption field in the data query instruction, the decryption algorithm corresponding to the data to be read is determined; and according to the decryption algorithm corresponding to the data to be read, the data to be read is decrypted to obtain the decrypted data.
[0199] The decrypted data is input into a preset first function for calculation and processing to obtain a first return value; wherein the first return value represents the calculation and processing result of the first function; in response to the first return value being consistent with a pre-stored first preset return value, it is determined that the decryption of the data to be read is successful; wherein the pre-stored first preset return value represents that the format of the decrypted data is correct.
[0200] The decrypted data is deserialized to obtain processed data.
[0201] Exemplarily, the electronic device reads the data encryption field in the data query instruction, identifies the designation of the decryption algorithm contained in the data encryption field in the data query instruction; then, the electronic device decrypts the data to be read according to the designated decryption algorithm, and obtains the decrypted data after the decryption is completed.
[0202] This embodiment also includes determining whether data decryption is successful, which can be achieved through the following process:
[0203] First, the electronic device determines the format of the decrypted data according to a specified decryption algorithm, for example, the format may be binary.
[0204] The format of the decrypted data is checked using the first function. For example, the decrypted data is input into the first function, the first function verifies the format of the decrypted data, and then outputs a first return value. For example, when the format of the decrypted data is binary, the isValidBinaryFormat function can be used to check whether the format of the decrypted data is binary.
[0205] If the first return value output by the first function is 1, that is, the first return value is consistent with the pre-stored first preset return value (for example, equal to 1), it indicates that if the format of the decrypted data conforms to the format of the data corresponding to the specified decryption algorithm, it is determined that the decryption of the data to be read is successful; on the contrary, if the first return value output by the first function is 0, the first return value is inconsistent with the pre-stored first preset return value, it indicates that if the format of the decrypted data does not conform to the format of the data corresponding to the specified decryption algorithm, it is determined that the decryption of the data to be read fails. Subsequently, the electronic device terminates the data reading process, generates and sends a prompt message to the developer that the data decryption fails.
[0206] S210, inputting data conforming to a preset coding format into a preset second function for calculation processing to obtain a second return value; wherein the second return value represents a calculation processing result obtained after the data conforming to the preset coding format is input into the second function.
[0207] Exemplarily, this embodiment also includes determining whether the data deserialization is successful, which can be achieved through the following process:
[0208] In the data storage stage, which can be regarded as the process corresponding to steps S201 to S204, the electronic device inputs the data to be stored into the calculation function, and the calculation function calculates and processes the data to be stored and outputs the initial check value of the data to be stored. For example, the calculation function can be calculateSHA256.
[0209] During the data reading stage, data that conforms to the preset encoding format, that is, data in a deserialized state, is input into a calculation function, which performs calculations on the data that conforms to the preset encoding format and outputs a calculation verification value of the data that conforms to the preset encoding format.
[0210] The electronic device compares the initial check value with the calculated check value through a second function, and outputs a second return value; wherein the second function may be a verifyChecksums function.
[0211] S211. In response to the second return value being consistent with a pre-stored second preset return value, determine that the deserialization processing of the decrypted data is successful; wherein the pre-stored second preset return value represents a calculation processing result obtained after the data to be read is input into the second function.
[0212] Exemplarily, the electronic device compares the second return value output by the second function with the pre-stored second preset return value (for example, equal to 1). If the two are equal, it indicates that the data conforming to the preset encoding format after deserialization is consistent with the data to be stored in the storage stage, and the deserialization is determined to be successful; conversely, if the second return value output by the second function is 0, the second return value is inconsistent with the pre-stored second preset return value, which indicates that the data conforming to the preset encoding format after deserialization is inconsistent with the data to be stored in the storage stage, and the deserialization is determined to have failed. Subsequently, the electronic device terminates the data reading process, generates and sends a prompt message to the developer that the data deserialization has failed.
[0213] After successful deserialization, the electronic device feeds back the processed data to the developer.
[0214] A data processing method provided by an embodiment of the present application, in the data storage stage, the data index field, the data type field and the data encryption field of the data to be stored are added to obtain a first verification value; in the data reading stage, the data index field, the data type field and the data encryption field in the data query instruction are added to obtain a second verification value; by verifying whether the first verification value is equal to the second verification value, it is determined whether the data to be read in the electronic device has been tampered with by external force, thereby ensuring the consistency and integrity of the data; avoiding the developer from reading the wrong type of data and then using it in the development process, causing abnormal operation of the computer software, thereby ensuring the normal progress of computer software development.
[0215] In addition, in the data storage stage, this embodiment also analyzes the message format of the data to be stored, determines the key information indicated in the data message format, and generates the index field of the data to be stored based on the key information, in view of the situation that the data index field in the data storage instruction cannot be found in the electronic device. In this way, the developer does not need to manually create the corresponding data index field for each piece of data to be stored, which reduces the repetitive work of the developer, realizes the automation of data storage, and improves the development efficiency.
[0216] Figure 3 Schematic diagram of the structure of the data processing device provided in this application Figure 1 ,like Figure 3 As shown, the data processing device provided in this embodiment includes:
[0217] The reading unit 301 is used to read the to-be-read data indicated by the data query instruction in response to the data query instruction.
[0218] The determination unit 302 is used to perform data index field determination processing on the read data to be read according to the data index field in the data query instruction.
[0219] The first processing unit 303 is used to verify the read data to be read according to each field in the data query instruction if it is determined that the determination process of the data index field of the read data to be read is passed.
[0220] The second processing unit 304 is used to, if it is determined that the read data to be read has passed the verification process, perform decryption processing and deserialization processing on the read data to be read in sequence to obtain processed data; and feed back the processed data to the user.
[0221] The data processing device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.
[0222] Figure 4 Schematic diagram of the structure of the data processing device provided in this application Figure 2 ,like Figure 4 As shown, the data processing device provided in this embodiment includes:
[0223] The reading unit 401 is used to read the to-be-read data indicated by the data query instruction in response to the data query instruction.
[0224] The determination unit 402 is used to perform data index field determination processing on the read data to be read according to the data index field in the data query instruction.
[0225] The first processing unit 403 is configured to perform verification processing on the read data to be read according to each field in the data query instruction if it is determined that the determination processing on the data index field of the read data to be read passes.
[0226] The second processing unit 404 is used to, if it is determined that the read data to be read has passed the verification process, perform decryption processing and deserialization processing on the read data to be read in sequence to obtain processed data; and feed back the processed data to the user.
[0227] In a possible implementation, the data to be read includes a first verification value, and the first verification value is generated based on a data index field, a data encryption field, and a data type field acquired when storing the data to be read.
[0228] The first processing unit 403 includes:
[0229] The first generating module 4031 is used to generate a second check value according to the data index field, the data encryption field, and the data type field in the data query instruction.
[0230] The first determination module 4032 is used to determine that the verification process for the read data to be read has passed if it is determined that the second verification value is consistent with the first verification value.
[0231] The first determination module 4032 is further configured to determine that the verification process performed on the read data to be read fails if it is determined that the second verification value is inconsistent with the first verification value.
[0232] In a possible implementation, the determining unit 402 includes:
[0233] The comparison module 4021 is used to compare the data index field in the data query instruction with the data index field in the read data to be read.
[0234] The second determination module 4022 is used to determine that the determination process of the data index field of the read data to be read is passed if it is determined that the data index field in the data query instruction is consistent with the data index field in the read data to be read.
[0235] The second determination module 4022 is further used to determine that the determination processing of the data index field of the read data to be read fails if it is determined that the data index field in the data query instruction is inconsistent with the data index field in the read data to be read.
[0236] In a possible implementation manner, before the second processing unit 404, the method further includes:
[0237] The comparison unit 405 is used to compare the data type field in the data query instruction with the data type field in the data to be read.
[0238] The first determination unit 406 is used to perform a step of decrypting and deserializing the read data to be read in sequence to obtain processed data if it is determined that the data type field in the data query instruction is consistent with the data type field in the data to be read.
[0239] In a possible implementation, the second processing unit 404 includes:
[0240] The decryption module 4041 is used to determine the decryption algorithm corresponding to the data to be read according to the data encryption field in the data query instruction; and decrypt the data to be read according to the decryption algorithm corresponding to the data to be read to obtain the decrypted data.
[0241] The first calculation module 4042 is used to input the decrypted data into a preset first function for calculation processing to obtain a first return value; wherein the first return value represents the calculation processing result of the first function; in response to the first return value being consistent with a pre-stored first preset return value, it is determined that the decryption of the data to be read is successful; wherein the pre-stored first preset return value represents that the format of the decrypted data is correct.
[0242] The first processing module 4043 is used to perform deserialization processing on the decrypted data to obtain processed data.
[0243] In a possible implementation manner, after the second processing unit 404, the method further includes:
[0244] The calculation unit 407 is used to input the data conforming to the preset coding format into the preset second function for calculation processing to obtain a second return value; wherein the second return value represents the calculation processing result obtained after the data conforming to the preset coding format is input into the second function.
[0245] The second determination unit 408 is used to determine that the deserialization processing of the decrypted data is successful in response to the second return value being consistent with the pre-stored second preset return value; wherein the pre-stored second preset return value represents the calculation processing result obtained after the data to be read is input into the second function.
[0246] In a possible implementation, the device further includes:
[0247] The third determination unit 409 is used to determine the data index field of the data to be stored indicated by the data storage instruction in response to the data storage instruction; wherein the data storage instruction is used to indicate the storage of the data to be stored; the data to be stored carries the data type field and data encryption field of the data to be stored.
[0248] The fourth determination unit 410 is used to determine the pre-stored data type field corresponding to the data to be stored based on a preset mapping relationship and according to the determined data index field of the data to be stored; wherein the preset mapping relationship represents the correspondence between the data index field and the data type field.
[0249] The third processing unit 411 is used to serialize and encrypt the data to be stored in sequence to obtain and store the encrypted data if it is determined that the pre-stored data type field corresponding to the data to be stored is consistent with the data type field carried in the data to be stored.
[0250] The generating unit 412 is used to generate a first check value of the data to be stored according to the data type field carried in the data to be stored, the data encryption field carried in the data to be stored, and the determined data index field of the data to be stored.
[0251] In a possible implementation manner, the third determining unit 409 includes:
[0252] The third determination module 4091 is used to determine the data message format of the data to be stored if the data index field of the data to be stored is not stored, determine the key information of the data to be stored according to the data message format of the data to be stored, and generate the data index field of the data to be stored according to the key information of the data to be stored.
[0253] The fourth determining module 4092 is configured to determine, if a data index field of the data to be stored is stored, that the stored data index field is the data index field of the data to be stored.
[0254] In a possible implementation, the third processing unit 411 includes:
[0255] The second processing module 4111 is used to perform serialization processing on the data to be stored to obtain data that complies with a preset encoding format.
[0256] The second calculation module 4112 is used to input data that conforms to a preset encoding format into a preset third function for calculation processing to obtain a third return value; wherein the third return value represents the calculation processing result of the third function; in response to the third return value being consistent with a pre-stored third preset return value, it is determined that the serialization processing of the data to be stored is successful; wherein the pre-stored third preset return value represents that the input data conforms to the data format specification after serialization.
[0257] The encryption module 4113 is used to determine the encryption algorithm corresponding to the data to be stored according to the data encryption field carried by the data to be stored; and encrypt the data that conforms to the preset encoding format according to the encryption algorithm corresponding to the data to be stored to obtain the encrypted data.
[0258] The third calculation module 4114 is used to process the encrypted data in a preset fourth function for calculation to obtain a fourth return value; wherein the fourth return value represents the calculation result of the fourth function; in response to the fourth return value being consistent with a pre-stored fourth preset return value, it is determined that the encryption of the data conforming to the preset encoding format is successful; wherein the pre-stored fourth preset return value represents that the format of the encrypted data is correct.
[0259] The storage module 4115 is used to store encrypted data.
[0260] The data processing device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.
[0261] Figure 5 This is a schematic diagram of the structure of the data processing device provided in this application. Figure 5 As shown, the data processing device provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.
[0262] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.
[0263] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0264] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.
[0265] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.
[0266] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0267] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0268] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0269] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0270] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0271] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0272] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0273] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0274] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0275] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0276] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A data processing method, characterized in that: The method comprises: In response to the data query instruction, reading the to-be-read data indicated by the data query instruction; According to the data index field in the data query instruction, the data to be read is subjected to determination processing of the data index field; If it is determined that the determination process of the data index field of the read data to be read is passed, then the read data to be read is verified according to each field in the data query instruction; If it is determined that the verification process of the read data to be read has passed, the read data to be read is decrypted and deserialized in sequence to obtain processed data; and the processed data is fed back to the user.
2. The method according to claim 1, characterized in that The data to be read includes a first check value, which is generated based on a data index field, a data encryption field, and a data type field obtained when storing the data to be read; According to each field in the data query instruction, the read data to be read is verified, including: Generate a second check value according to the data index field, the data encryption field, and the data type field in the data query instruction; If it is determined that the second verification value is consistent with the first verification value, then it is determined that the verification process for the read data to be read passes; If it is determined that the second verification value is inconsistent with the first verification value, it is determined that the verification process performed on the read data to be read fails.
3. The method according to claim 1, characterized in that: According to the data index field in the data query instruction, the data index field is determined and processed for the read data to be read, including: Comparing the data index field in the data query instruction with the data index field in the read data to be read; If it is determined that the data index field in the data query instruction is consistent with the data index field in the read data to be read, it is determined that the determination process of the data index field of the read data to be read is passed; If it is determined that the data index field in the data query instruction is inconsistent with the data index field in the read data to be read, it is determined that the determination process of the data index field of the read data to be read fails.
4. The method according to claim 1, characterized in that: Before the read data to be read is decrypted and deserialized in sequence to obtain the processed data, the method further includes: Comparing the data type field in the data query instruction with the data type field in the data to be read; If it is determined that the data type field in the data query instruction is consistent with the data type field in the data to be read, the steps of sequentially decrypting and deserializing the read data to be read are executed to obtain processed data.
5. The method according to claim 1, characterized in that The read data to be read is decrypted and deserialized in turn to obtain processed data, including: Determine the decryption algorithm corresponding to the data to be read according to the data encryption field in the data query instruction; and decrypt the data to be read according to the decryption algorithm corresponding to the data to be read to obtain the decrypted data; Input the decrypted data into a preset first function for calculation processing to obtain a first return value; wherein the first return value represents the calculation processing result of the first function; in response to the first return value being consistent with a pre-stored first preset return value, determine that the decryption of the data to be read is successful; wherein the pre-stored first preset return value represents that the format of the decrypted data is correct; The decrypted data is deserialized to obtain processed data.
6. The method according to claim 5, characterized in that After deserializing the decrypted data to obtain processed data, the method further includes: Input the data conforming to the preset coding format into a preset second function for calculation processing to obtain a second return value; wherein the second return value represents the calculation processing result obtained after the data conforming to the preset coding format is input into the second function; In response to the second return value being consistent with a pre-stored second preset return value, it is determined that the deserialization processing of the decrypted data is successful; wherein the pre-stored second preset return value represents a calculation processing result obtained after the data to be read is input into the second function.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: In response to a data storage instruction, determining a data index field of the data to be stored indicated by the data storage instruction; wherein the data storage instruction is used to instruct the storage of the data to be stored; the data to be stored carries a data type field and a data encryption field of the data to be stored; Based on a preset mapping relationship, according to the determined data index field of the data to be stored, a pre-stored data type field corresponding to the data to be stored is determined; wherein the preset mapping relationship represents a correspondence between the data index field and the data type field; If it is determined that the pre-stored data type field corresponding to the data to be stored is consistent with the data type field carried in the data to be stored, serializing and encrypting the data to be stored in sequence to obtain and store the encrypted data; A first check value of the data to be stored is generated according to the data type field carried in the data to be stored, the data encryption field carried in the data to be stored, and the determined data index field of the data to be stored.
8. The method according to claim 7, characterized in that Determining a data index field of the data to be stored indicated by the data storage instruction includes: If the data index field of the data to be stored is not stored, determining the data message format of the data to be stored, determining key information of the data to be stored according to the data message format of the data to be stored, and generating the data index field of the data to be stored according to the key information of the data to be stored; If the data index field of the data to be stored is stored, the stored data index field is determined to be the data index field of the data to be stored.
9. The method according to claim 7, characterized in that: The data to be stored is serialized and encrypted in sequence to obtain and store the encrypted data, including: Serializing the data to be stored to obtain data that conforms to a preset encoding format; The data conforming to the preset encoding format is input into a preset third function for calculation processing to obtain a third return value; wherein the third return value represents the calculation processing result of the third function; in response to the third return value being consistent with the pre-stored third preset return value, it is determined that the serialization processing of the data to be stored is successful; wherein the pre-stored third preset return value represents that the input data conforms to the data format specification after serialization; Determine the encryption algorithm corresponding to the data to be stored according to the data encryption field carried by the data to be stored; and encrypt the data conforming to the preset encoding format according to the encryption algorithm corresponding to the data to be stored to obtain encrypted data; The encrypted data is processed by a preset fourth function to obtain a fourth return value; wherein the fourth return value represents a result of the calculation of the fourth function; in response to the fourth return value being consistent with a pre-stored fourth preset return value, it is determined that the encryption of the data conforming to the preset encoding format is successful; wherein the pre-stored fourth preset return value represents that the format of the encrypted data is correct; The encrypted data is stored.
10. A data processing device, characterized in that: include: A reading unit, configured to read the to-be-read data indicated by the data query instruction in response to the data query instruction; A determination unit, configured to perform determination processing on the data index field of the read data to be read according to the data index field in the data query instruction; A first processing unit is used to verify the read data to be read according to each field in the data query instruction if it is determined that the determination process of the data index field of the read data to be read is passed; The second processing unit is used to, if it is determined that the read data to be read has passed the verification process, perform decryption processing and deserialization processing on the read data to be read in sequence to obtain processed data; and feed back the processed data to the user.
11. A data processing device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 9 when executed by a processor.
13. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 9 when being executed by a processor.
Citation Information
Patent Citations
Query method and device for UTXO
CN106503053A
Asynchronous multiparty data interaction method based on block chain system and storage medium
CN107622096A
Database data verification method and device, equipment and storage medium
CN115794862A
Method, device and system based on Graphql request mode
CN115982258A
Window queries for large unstructured data sets
US10387466B1
Cited By
Communication method and related device
WO2026175176A1