Data storage method and device and storage medium

By converting human resource data into object data and encrypting storage, the problems of data security and inefficiency in traditional data storage solutions are solved, efficient encryption and storage are achieved, and the security needs of human resource data are met.

CN119203216APending Publication Date: 2024-12-27BEIJING 58 INFORMATION TTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411237741.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In traditional data storage solutions, human resource data storage in relational databases is at risk of being acquired by administrators or illegal users, and the encryption operation efficiency is low, affecting data storage and query efficiency.

Method used

Convert multiple data items in the pending data set into object data, and determine the key index and encryption key based on the object identification, encrypt and store the object data, improve encryption and storage efficiency, and enhance data security.

Benefits of technology

It improves data encryption processing and storage efficiency, enhances the security of data in the database, and meets the high security needs of human resource data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119203216A_ABST
    Figure CN119203216A_ABST
Patent Text Reader

Abstract

The invention provides a data storage method and device and a storage medium, and the method comprises the steps: obtaining a to-be-processed data set corresponding to a target person, the to-be-processed data set comprising a plurality of data items; performing format conversion on the plurality of data items to obtain first object data corresponding to the to-be-processed data set; determining a key index corresponding to the first object data according to the object identifier of the first object data; determining an encryption key corresponding to the first object data according to the key index; encrypting the first object data by using the encryption key to obtain encrypted data; and according to the encrypted data and the object identifier corresponding to the first object data, generating the first object corresponding to the to-be-processed data set, and storing the first object to the preset database, so that data encryption can be completed only by encrypting the object data once, and the data storage efficiency and the data storage security are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data storage method, device and storage medium. Background Art

[0002] With the continuous expansion of modern enterprise scale and the rapid development of information technology, the secure storage of human resources data has become an indispensable part of enterprise management. In practical applications, human resources data usually includes basic information of employees, employment information, performance information, etc. These data are often sensitive, and any leakage of information will affect the vital interests of users and the development of enterprises.

[0003] In traditional data storage solutions, human resource data is stored directly or after simple encryption in relational databases, which poses a risk of sensitive information being obtained by database administrators or other illegal users. Therefore, a more secure data storage solution is needed to meet the needs of human resource data storage. Summary of the invention

[0004] The embodiments of the present invention provide a data storage method, a device and a storage medium, which are used to improve the security of data storage and meet the security requirements of human resources data storage.

[0005] In a first aspect, an embodiment of the present invention provides a data storage method, the method comprising:

[0006] Obtaining a data set to be processed corresponding to a target person, wherein the data set to be processed includes multiple data items;

[0007] Performing format conversion on the multiple data items to obtain first object data corresponding to the data set to be processed, where the first object data is an abstract representation of the data set to be processed;

[0008] Determining a key index corresponding to the first object data according to the object identifier of the first object data;

[0009] Determining, according to the key index, an encryption key corresponding to the first object data;

[0010] Using the encryption key, encrypting the first object data to obtain encrypted data;

[0011] A first object corresponding to the data set to be processed is generated according to the encrypted data and the object identifier corresponding to the first object data, and the first object is stored in a preset database.

[0012] In a second aspect, an embodiment of the present invention provides a data storage device, the device comprising:

[0013] An acquisition module is used to acquire a data set to be processed corresponding to a target person, wherein the data set to be processed includes multiple data items;

[0014] A conversion module, configured to perform format conversion on the plurality of data items to obtain first object data corresponding to the data set to be processed, wherein the first object data is an abstract representation of the data set to be processed;

[0015] A first determining module, configured to determine a key index corresponding to the first object data according to an object identifier of the first object data;

[0016] A second determining module, configured to determine an encryption key corresponding to the first object data according to the key index;

[0017] An encryption module, used to encrypt the first object data using the encryption key to obtain encrypted data;

[0018] A generating module is used to generate a first object corresponding to the data set to be processed according to the encrypted data and the object identifier corresponding to the first object data, and store the first object in a preset database.

[0019] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the data storage method as described in the first aspect.

[0020] In a fourth aspect, an embodiment of the present invention provides a non-temporary machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor can at least implement the data storage method described in the first aspect.

[0021] In the data storage solution provided in the embodiment of the present invention, a data storage service can be provided for human resource management, and the human resource data of each person is converted into object data, and then the object data is encrypted and stored in a preset database, thereby improving the security of data storage. Specifically, first, a data set to be processed corresponding to the target person is obtained, and the data set to be processed includes multiple data items. And multiple data items in the data set to be processed are format converted to obtain the first object data corresponding to the data set to be processed. Among them, the first object data is an abstract representation of the data set to be processed. Then, according to the object identifier of the first object data, the key index corresponding to the first object data is determined. Furthermore, according to the key index corresponding to the first object data, the encryption key corresponding to the first object data is determined, and the first object data is encrypted using the encryption key to obtain encrypted data. Finally, according to the encrypted data and the object identifier corresponding to the first object data, the first object corresponding to the data set to be processed is generated, and the first object is uploaded to the preset database to store the first object in the preset database.

[0022] In the above scheme, by converting the format of multiple data items in the data set to be processed, the first object data corresponding to the data set to be processed is obtained, so that the multiple data items are integrated into one object data, and then the first object data is encrypted, so that there is no need to encrypt each data item separately, and only the object data needs to be encrypted once, which can improve the data encryption processing efficiency and thus improve the data storage efficiency. In addition, when encrypting the first object data, the key index corresponding to the first object data is first determined according to the object identifier of the first object data, and then the encryption key corresponding to the first object data is determined according to the key index, which can improve the security of the encryption key, and then the encryption key is used to encrypt the first object data, and the encryption result of the first object data is stored in a preset database, which improves the security of the data stored in the preset database to meet the security requirements of human resources data storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 A flowchart of a data storage method provided by an embodiment of the present invention;

[0025] Figure 2 A flowchart of determining an encryption key corresponding to first object data provided by an embodiment of the present invention;

[0026] Figure 3 A flowchart of generating a second object corresponding to a target person provided by an embodiment of the present invention;

[0027] Figure 4 A flowchart of another data storage method provided by an embodiment of the present invention;

[0028] Figure 5 A flowchart of another data storage method provided by an embodiment of the present invention;

[0029] Figure 6 A schematic diagram of the structure of a data storage device provided by an embodiment of the present invention;

[0030] Figure 7 A schematic diagram of the structure of an electronic device provided in this embodiment. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. In addition, the step timing in the following method embodiments is only an example, not a strict limitation.

[0032] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0033] In order to facilitate those skilled in the art to understand the technical solutions provided by the embodiments of the present invention, the following briefly describes the relevant technologies:

[0034] When conducting human resource management for corporate employees, it is usually necessary to store a large amount of human resource data, such as basic employee information, employment information, performance information, etc. These data are often sensitive, and any information leakage will affect the vital interests of users and corporate development. In traditional data storage solutions, human resource data is stored directly or after simple encryption in relational databases, which poses a risk of sensitive information being obtained by database administrators or other illegal users.

[0035] In addition, when using a relational database to store this data, it is necessary to first create multiple tables in the relational database, and each table defines fixed fields for storing specific data items. When new human resources data needs to be stored, the data corresponding to each field is encrypted, and then the encrypted data is inserted into the corresponding field of the corresponding table. That is, when human resources data is encrypted and stored in a relational database, each field in each row of data in the table needs to be encrypted.

[0036] However, as the scale of enterprises gradually increases, the amount of human resources data is also growing rapidly. If traditional data storage solutions are used to handle such a large amount of data, the encryption operation task will be very heavy, which will affect the data storage efficiency. In addition, if this method is used for data storage, when a certain data in the database needs to be queried, each field of each row of data needs to be decrypted, and the data query efficiency is low.

[0037] Therefore, in order to solve the above technical problems, an embodiment of the present invention provides a new data storage solution. Before storing the data set to be processed corresponding to the target person in a preset database, multiple data items in the data set to be processed are first encapsulated into an object data, and then the object data encapsulated with multiple data items is encrypted, and the encrypted data is stored in the preset database. In this way, the object data only needs to be encrypted once, which improves the data encryption processing efficiency and data storage efficiency. In addition, if a user wants to obtain multiple data items, he needs to obtain the data structure corresponding to the object data and the encryption key corresponding to the object data at the same time, thereby improving the security of data storage.

[0038] In addition, when encrypting object data, the encryption key corresponding to the object data is determined based on the object identifier of the object data and the key index corresponding to the object data. The encryption key has a high security, which can improve the security of the data stored in the preset database to meet the security requirements of human resources data storage.

[0039] In the following, some embodiments of the present invention are described in detail in conjunction with the accompanying drawings. In the case where there is no conflict between the embodiments, the following embodiments and features in the embodiments can be combined with each other.

[0040] Figure 1 A flowchart of a data storage method provided by an embodiment of the present invention is as follows Figure 1 As shown, the execution subject of the method can be a data storage device. It can be understood that the device can be implemented as software, or a combination of software and hardware. Specifically, the method includes the following steps:

[0041] 101. Obtain a data set to be processed corresponding to a target person, where the data set to be processed includes multiple data items.

[0042] 102. Perform format conversion on multiple data items to obtain first object data corresponding to the data set to be processed, where the first object data is an abstract representation of the data set to be processed.

[0043] 103. Determine a key index corresponding to the first object data according to the object identifier of the first object data.

[0044] 104. Determine an encryption key corresponding to the first object data according to the key index.

[0045] 105. Encrypt the first object data using the encryption key to obtain encrypted data.

[0046] 106. Generate a first object corresponding to the data set to be processed according to the object identifier corresponding to the encrypted data and the first object data, and store the first object in a preset database.

[0047] The data storage solution provided in the embodiment of the present invention can be applied to human resource management, providing human resource data storage services for it, so as to store human resource data in a preset database. The preset database can be any type of database. For example, the preset database can be a relational database, a document database, etc.

[0048] In specific applications, if a user wants to store the human resources data corresponding to a target person in a preset database, the user can initiate a data storage request to the data storage device, and the data storage request includes a data set to be processed corresponding to the target person, and the data set to be processed includes multiple data items. The data storage device can obtain the data set to be processed corresponding to the target person based on the data storage request triggered by the user, process the data set to be processed, and store the processed data in the preset database.

[0049] In addition, the embodiment of the present invention does not limit the specific implementation method for obtaining the to-be-processed data set corresponding to the target person, and those skilled in the art can set it according to specific application requirements. For example, the to-be-processed data set corresponding to the target person can be generated based on the user's execution operation. In this case, the data storage device can be configured with an interactive interface, which displays the interactive interface for implementing human-computer interaction operations, obtains the execution operation input by the user in the interactive interface, and obtains the to-be-processed data set corresponding to the target person based on the execution operation. Alternatively, the to-be-processed data set corresponding to the target person is stored in a preset area, and the data storage device can obtain the to-be-processed data set corresponding to the target person by accessing the preset area.

[0050] Of course, those skilled in the art may also adopt other methods to obtain the data set to be processed corresponding to the target person, as long as the accuracy and reliability of obtaining the data set to be processed can be guaranteed, which will not be elaborated here.

[0051] Each data set to be processed may include multiple data items. For example, the multiple data items may be the name, gender, ethnicity, address, and other data of the target employee. In order to efficiently and securely store the multiple data items in a preset database and facilitate the subsequent management of the stored data in the database, in an embodiment of the present invention, the multiple data items are stored in the preset database in the form of objects, and the data structure in the preset database is no longer used to store the data. The preset database here is only used as a storage device.

[0052] That is, before storing multiple data items in the data set to be processed into a preset database, the multiple data items can be converted into an object, and the multiple data items can be stored as a whole in a field of the preset database. That is, in the embodiment of the present invention, the object is used as the basic unit of storage and access, and no longer relies on the two-dimensional table structure in the preset database or the hierarchical structure of the file system.

[0053] In specific implementation, after obtaining the to-be-processed data set corresponding to the target person, the format of multiple data items in the to-be-processed data set can be converted to obtain the first object data corresponding to the to-be-processed data set, where the first object data is an abstract representation of the to-be-processed data set. Then, the first object corresponding to the to-be-processed data set is generated according to the first object data.

[0054] The first object data may be data in various formats, such as unstructured data, structured data, semi-structured data, arbitrary binary data, etc.

[0055] In practical applications, the data structure corresponding to the object data can be predefined according to actual needs, and the multiple data items in the processing data set can be converted into the corresponding format according to the predefined data structure corresponding to the object data to obtain the first object data corresponding to the processing data.

[0056] Specifically, assuming that the first object data is JSON data, a data structure corresponding to the JSON data can be predefined, and according to the data structure corresponding to the JSON data, multiple data items are encapsulated as a first JSON string in the form of key-value pairs, and the first JSON string is determined as the first object data corresponding to the data set to be processed. For example, in the JSON data structure, the field name corresponding to each data item is determined as a JSON key, and the JSON key value is determined for each data item, and a serialization operation is performed on the multiple data items to obtain multiple JSON strings.

[0057] In an optional embodiment, the object structure corresponding to the generated first object may be predefined, and an object instance corresponding to the data set to be processed may be created according to the preset object structure and multiple data items in the data set to be processed to obtain the first object data corresponding to the data set to be processed.

[0058] The object structure specifies the data format corresponding to each data item. In specific implementation, a preset object structure can be predefined according to the characteristics of the data and actual needs. For example, the object structure can include data attributes (ie, data fields).

[0059] Furthermore, the preset object structure may be an object structure common to multiple data sets. In practical applications, the preset object structure may be represented by an abstract class. Specifically, in an optional embodiment, the implementation method for obtaining the first object data corresponding to the data set to be processed may be: determining constructors corresponding to multiple data sets, wherein the parameters passed into the constructor are specified in the constructor as variable strings; based on the constructor, creating abstract classes corresponding to multiple data sets. Passing multiple data items in the data set to be processed into the constructor in the abstract class, creating an object instance corresponding to the data set to be processed, so as to obtain a JSON string corresponding to the data set to be processed; determining the JSON string corresponding to the data set to be processed as the first object data corresponding to the data set to be processed.

[0060] In addition, after generating the first object data corresponding to the data set to be processed, an object identifier corresponding to the first object data may also be generated simultaneously. An object identifier generator may be used to randomly generate corresponding object identifiers for the first objects corresponding to each data set. The object identifier may be a random number or a random binary number, etc.

[0061] In order to improve the security of data storage, the first object data corresponding to multiple data items is first generated, and then the first object data is encrypted using the encryption key corresponding to the first object data, and the encrypted result of the first object data is uploaded to a preset database. In this way, the user needs to obtain the data structure corresponding to the first object data and the encryption key corresponding to the first object data at the same time to obtain the multiple data items in the data set to be processed corresponding to the target person, thereby improving the security of data storage.

[0062] Among them, the data structure corresponding to the first object data not only affects the security of the target person's data in the preset database, but the encryption key corresponding to the first object data also affects and determines the security of the target person's data in the preset database. In order to ensure the security of the target person's data stored in the preset database, the key index corresponding to the first object data can be determined based on the object identifier of the first object data, and then the encryption key corresponding to the first object data can be determined based on the key index. In this way, even if the user obtains the object identifier corresponding to the first object data, he cannot directly obtain the encryption key corresponding to the first object data, which increases the security of the encryption key corresponding to the first object data.

[0063] Among them, the key index refers to a parameter, which is mainly used as an input parameter in the algorithm of converting plaintext to ciphertext or converting ciphertext to plaintext, and can be used to specify which key should be used for encryption or decryption operations during the encryption process or decryption process.

[0064] Since each first object data corresponds to a unique object identifier, the object identifier of the first object data can be used to determine the key index corresponding to the first object data. After the key index corresponding to the first object data is determined, the encryption key corresponding to the first object data can be obtained from the key library according to the key index, which can improve the security of the encryption key, so that the user cannot directly determine the encryption key corresponding to the first object data according to the object identifier of the first object data, and then use the encryption key to decrypt the data stored in the database to obtain the corresponding first object data.

[0065] Next, the first object data is encrypted using the encryption key corresponding to the first object data to obtain encrypted data. The first object data may be encrypted using a symmetric encryption algorithm, an AEAD algorithm or other algorithms.

[0066] Then, according to the encrypted data and the object identifier corresponding to the first object data, the first object corresponding to the data set to be processed is generated. Each object not only contains multiple data items themselves, but also may include data attribute information, object identifier, data version information, etc. Then, when generating the first object corresponding to the data set to be processed, the object type of the first object data and the version information corresponding to the first object data can be determined according to the data type corresponding to the data set to be processed, and the first object data, object type, version information, and object identifier corresponding to the first object data corresponding to the data set to be processed are encapsulated into the first object corresponding to the data set to be processed.

[0067] Finally, the first object corresponding to the data set to be processed is uploaded to a preset database, so that the encryption results corresponding to the multiple data items in the data set to be processed are encapsulated as the first object and stored in the preset database in the form of an object.

[0068] That is to say, when storing data of the processed data set, the object can be used as the storage unit, and the encryption results corresponding to multiple data items in the processed data set can be encapsulated in a small object for storage. This can not only reduce the waste of storage space, but also improve data storage efficiency.

[0069] In addition, the above method is used to store and process the data set to be processed corresponding to the target person, which no longer depends on the structure corresponding to the data table in the preset database. The data structure definition corresponding to the stored data is more flexible. When a new data item is added, the data structure corresponding to the object data can be flexibly adjusted. There is no need for technical personnel to intervene and conduct secondary development. A data item can be quickly added to the data structure corresponding to the object data.

[0070] In the embodiment of the present invention, the first object data corresponding to the data set to be processed is obtained by format conversion of multiple data items in the data set to be processed, so as to integrate multiple data items into one object data, and then encrypt the first object data. In this way, it is no longer necessary to encrypt each data item separately, and only the object data needs to be encrypted once, which can improve the data encryption processing efficiency and thus improve the data storage efficiency. In addition, when encrypting the first object data, the key index corresponding to the first object data is first determined according to the object identifier of the first object data, and then the encryption key corresponding to the first object data is determined according to the key index, which can improve the security of the encryption key, and then the encryption key is used to encrypt the first object data, and the encryption result of the first object data is stored in a preset database, which improves the security of the data stored in the preset database to meet the security requirements of human resources data storage.

[0071] The above embodiment describes that before storing data of the data set to be processed corresponding to the target person, multiple data items in the data set to be processed are first encapsulated into the first object data, and then the encryption key corresponding to the first object data is determined, and the first object data is encrypted using the encryption key to obtain encrypted data. The encrypted data corresponding to the first object data is encapsulated as a first object and stored in a preset database, which can prevent the database administrator from obtaining the sensitive data corresponding to the target person, or other attackers from directly reading the sensitive data corresponding to the target person from the database.

[0072] Human resource data is often sensitive, and any information leakage will affect the vital interests of users and corporate development. Therefore, human resource management has high security requirements for data storage. However, if the technical developer knows the key index corresponding to the first object data, then the technical developer can directly obtain the encryption key corresponding to the first object data from the key library, and then obtain the sensitive data corresponding to the target person according to the encryption key. In order to meet the security requirements of human resource management, a key acquisition rule can be set, and the encryption key corresponding to the first object data can be determined in combination with the key acquisition rule and the key index. In this way, when the technical developer obtains the key index corresponding to the first object data, he cannot determine the encryption key corresponding to the first object data, which improves the security of the encryption key, and then can improve the security of the sensitive data corresponding to the target person stored in the preset database. The process of determining the encryption key is exemplified in conjunction with the following embodiments.

[0073] Figure 2 A flowchart of determining an encryption key corresponding to first object data provided by an embodiment of the present invention, such as Figure 2 As shown, an embodiment of the present invention provides an implementation method for determining an encryption key corresponding to first object data. Specifically, the method includes the following steps:

[0074] 201. Determine a key index corresponding to the first object data according to an object identifier of the first object data.

[0075] 202. Obtain key acquisition rules.

[0076] 203. Select a target key from a preset key library according to the key index and the key acquisition rule.

[0077] 204. Determine the target key as the encryption key corresponding to the first object data.

[0078] When determining the encryption key corresponding to the first object data, the object identifier of the first object data may be obtained first. In practical applications, when the first object data is generated, the object identifier of the first object data is generated, and the object identifier of the first object data is stored in an identification data table. Then, when the object identifier of the first object data needs to be obtained, the object identifier of the first object data may be obtained from the identification data table. The identification data table stores the correspondence between a plurality of first object data and corresponding object identifiers.

[0079] In addition, the object identifier of the first object data is generated by using an identifier generator. Therefore, when acquiring the object identifier of the first object data, the identifier generator can also be used to determine the object identifier of the first object data.

[0080] After obtaining the object identifier of the first object data, the key index corresponding to the first object data can be determined according to the object identifier of the first object data. The key index is equivalent to a position index or pointer, and the index start position can be determined according to the key index.

[0081] The key index corresponding to the first object data can be determined by using a HASH algorithm according to the object identifier of the first object data. For example, a hash function based on the object identifier is predefined, and the key index corresponding to the first object data is determined according to the preset hash function and the object identifier of the first object data.

[0082] In specific implementation, in order to prevent technical developers, human resource managers, and database managers from inferring the key index corresponding to the first object data based on the preset hash function and the object identifier of the first object data, the preset hash function can be set by the backend operation and maintenance personnel providing the data storage service.

[0083] Next, a key acquisition rule is obtained, and then a target key is selected from a preset key library according to the key index and the key acquisition rule, and the target key is determined as the encryption key corresponding to the first object data. A large number of keys can be generated in advance, and the large number of pre-generated keys can be stored in the preset key library, so that the corresponding encryption key can be directly obtained from the preset key library later.

[0084] The key acquisition rule describes the rules for acquiring the encryption key from the preset key library, that is, the key acquisition rule is equivalent to a key access rule. For example, the set key acquisition rule is to take one out of every 10 keys. When selecting the encryption key corresponding to the first object data from the preset key library, the key index and the key acquisition rule can be combined to select the target key from the preset key library, and the selected target key is used as the encryption key corresponding to the first object data, so that the encryption key determined is safer.

[0085] In addition, key acquisition rules can be set by human resource managers, which ensures that only properly authorized personnel can obtain keys, thereby reducing potential security risks. And human resource managers can set key acquisition rules to the distributed configuration system through specific interfaces or tools, and can also set rules through specific interfaces or tools to allow human resource managers to quickly adjust key acquisition strategies according to needs, improving operational efficiency and management flexibility. Among them, the distributed configuration system can be WCONFIG or other open source software, such as ZOOKEEPER, ETCD.

[0086] In an embodiment of the present invention, a key index corresponding to the first object data is determined based on an object identifier of the first object data, and a target key is selected from a preset key library based on the key index and a key acquisition rule, and the target key is determined as the encryption key corresponding to the first object data. Only personnel who have access to the key index determination strategy, access to the key acquisition rule, and access to the key library can obtain the encryption key corresponding to the first object data, thereby improving the security of the encryption key, and further improving the security of sensitive data corresponding to the target person stored in a preset database.

[0087] Based on the above method, the encryption key corresponding to the first object data is determined, and then the encryption key corresponding to the first object data is used to encrypt the first object data to obtain encrypted data, and the encrypted data is encapsulated as a first object and stored in a preset database. With this encryption method, only users who have access to the database, the distributed configuration system, and the back-end server providing data storage can obtain the data corresponding to the target person, otherwise they will not be able to obtain valid plaintext data, thereby ensuring the security of the data corresponding to the target person and effectively protecting the privacy information of the target person.

[0088] In addition, in actual applications, a target person may correspond to a large number of data items. In order to facilitate the management and storage of these data items, in an optional embodiment, after obtaining the data set to be processed corresponding to the target person, the number of data items contained in the data set to be processed and the data types corresponding to the multiple data items can be determined first. If the preset conditions are met, the multiple data items in the data set to be processed corresponding to the target person can be classified first to obtain multiple sub-data sets, and then the format of each sub-data set is converted using the method of processing the data set to be processed in the above embodiment to obtain the first object data corresponding to each of the multiple sub-data sets, and then the encryption keys corresponding to the multiple first object data are respectively determined, and the encryption keys corresponding to the multiple first object data are respectively used to encrypt the multiple first object data to obtain the encrypted data corresponding to the multiple first object data, and based on the encrypted data corresponding to the multiple first object data, multiple first objects are generated and stored in a preset database.

[0089] It should be noted that the data set to be processed corresponding to the target person obtained by the data storage device may be a sub-data set, so there is no need to split the data set to be processed, and the method in the above embodiment can be used directly to process the data set to process the encryption result of the first object data corresponding to the data set to be processed to the preset database.

[0090] Usually, a target person corresponds to a large number of data items, so a target person may correspond to multiple first objects stored, and each object is stored in a field of a preset database. That is to say, every time a target person adds a first object, a new storage record will be added to the preset database. The multiple first objects in the database are not classified and stored according to the target person to which the first object belongs, but the first objects are stored in the database in sequence according to the storage time. In order to better manage the target person or analyze the data, a second object (a large object) corresponding to the target person can be established to associate the multiple first objects corresponding to the target person in the second object. Through the object identifiers corresponding to the various first objects in the second object, the corresponding first objects can be quickly obtained from the preset database. In combination with the following embodiments, multiple first objects corresponding to the target person are associated in the second object to generate a specific process of the second object.

[0091] Figure 3 A flowchart of generating a second object corresponding to a target person provided by an embodiment of the present invention, such as Figure 3 As shown, the embodiment of the present invention provides an implementation method for generating a second object corresponding to a target person according to multiple first object identifiers corresponding to the target person. Specifically, the method includes the following steps:

[0092] 301. Obtain object identifiers of a plurality of first object data corresponding to a target person and object types corresponding to the plurality of first object data.

[0093] 302. According to the object types corresponding to the plurality of first object data, encapsulate the object identifiers of the plurality of first object data in the form of key-value pairs into a second JSON string.

[0094] 303. Determine the second JSON string as second object data corresponding to the target person.

[0095] 304. Generate a second object corresponding to the target person according to the second object data and the object identifier corresponding to the second object data, where the second object is associated with a plurality of first object data.

[0096] When generating the second object corresponding to the target person, first obtain the object identifiers of the multiple first object data corresponding to the target person and the object types corresponding to the multiple first object data. And according to the object types corresponding to the multiple first object data, encapsulate the object identifiers of the multiple first object data in the form of key-value pairs as a second JSON string. Specifically, the object types corresponding to the multiple first object data can be determined as JSON keys, and the object identifiers of the multiple first object data can be determined as JSON key values, so as to serialize the multiple first objects and obtain the second JSON string.

[0097] After obtaining the second JSON string, the second JSON string is determined as the second object data corresponding to the target person. Then, according to the second object data and the object identifier corresponding to the second object data, a second object corresponding to the target person is generated, and the second object is associated with a plurality of first object data. Among them, the second object data and the object identifier corresponding to the second object data can be directly encapsulated as the second object corresponding to the target person.

[0098] In addition, in actual applications, it is also possible to determine whether to perform encryption processing operations on the second object data stored in the preset database according to actual needs. If it is determined that the second object data stored in the preset database is encrypted to protect the security of the second object data. Then in an optional embodiment, the specific implementation process of generating the second object corresponding to the target person according to the second object data and the object identifier corresponding to the second object data may include: obtaining the object identifier corresponding to the second object data and the key acquisition rule; determining the key index corresponding to the second object data according to the preset hash function and the object identifier corresponding to the second object data; selecting the second target key from the preset key library according to the key index and the key acquisition rule; determining the second target key as the encryption key corresponding to the second object; using the encryption key corresponding to the second object, encrypting the second object data to obtain the second encrypted data; generating the second object corresponding to the target person according to the second encrypted data and the object identifier corresponding to the second object data.

[0099] After obtaining the second object corresponding to the target person, the second object can also be uploaded to a preset database and stored in the preset database. In this way, after reading the second object from the preset database, multiple first objects associated with the target person can be obtained from the second object, and multiple data items corresponding to the target person can be obtained through multiple first objects.

[0100] In the embodiment of the present invention, the object identifiers of the plurality of first object data are encapsulated as a second JSON string in the form of a key-value pair according to the object types corresponding to the plurality of first object data, and the second JSON string is determined as the second object data corresponding to the target person. Then, according to the second object data and the object identifier corresponding to the second object data, a second object corresponding to the target person is generated, and the second object is associated with the plurality of first object data, so that the plurality of first object data related to the target person can be quickly obtained according to the second object, so as to facilitate the management of each data item corresponding to the target person.

[0101] In actual applications, human resource management involves not only storing multiple data items corresponding to each target person, but also obtaining a data item from a preset database to view the information of the target person, or changing a data item and storing the changed data in the preset database, so as to update and synchronize it to various relevant departments in a timely manner. Figure 4-5 An example is given to illustrate the process.

[0102] Figure 4 A flowchart of another data storage method provided by an embodiment of the present invention, such as Figure 4 As shown, based on the above embodiment, the method may further include the following steps:

[0103] 401. Receive a data acquisition request triggered by a user in a data management interface, where the data acquisition request includes a person identifier corresponding to the data to be acquired.

[0104] 402. Determine the object identifier corresponding to the data to be obtained according to the personnel identifier.

[0105] 403. According to the object identifier corresponding to the data to be obtained, the data to be obtained corresponding to the object identifier is read from the local memory, and a plurality of objects stored in a preset database are cached in the local memory.

[0106] 404. Display the data to be obtained on the data management interface.

[0107] The data storage solution provided by the embodiment of the present invention can display a data management interface through an electronic device, so that the user can trigger various management operations in the data management interface. Specifically, when the user has a data acquisition requirement, a data acquisition request can be triggered in the data management interface. The data storage device receives the data acquisition request triggered by the user in the data management interface, and the data acquisition request includes a personnel identification corresponding to the data to be acquired. And according to the personnel identification, the object identification corresponding to the data to be acquired is determined.

[0108] Among them, each target person has a unique personnel identification. According to the personnel identification, the second object corresponding to the target person can be obtained, and the object identification of the first object corresponding to the target person can be obtained through the second object. According to the configuration information of multiple first objects, multiple data items encapsulated in the first object data of multiple first objects can be obtained, and then according to the multiple data items encapsulated in the first object data, the first object corresponding to the data to be obtained and the object identification of the first object can be determined.

[0109] After determining the object identifier corresponding to the data to be acquired, the data to be acquired corresponding to the object identifier can be read from the local memory according to the object identifier corresponding to the data to be acquired, and the local memory caches multiple objects stored in the preset database. Finally, the data to be acquired is displayed on the data management interface so that the user can quickly acquire the data to be acquired.

[0110] The local memory stores the decrypted object data and the object identifier corresponding to the object data. In order to enable users to quickly obtain the required data to be obtained, after the data storage service is turned on, the backend server providing the data storage service can load each object stored in the preset database into the local memory.

[0111] Since the stored data in the preset database is encrypted data corresponding to an object data (for example, the stored data is the encrypted result of a JSON string), if the stored data in the preset database is directly loaded into the local memory, then when the user obtains the data to be obtained, it is necessary to first decrypt the encrypted data corresponding to each object data in the local memory, and then determine the object identifier corresponding to the data to be obtained, so as to obtain the data to be obtained from the local memory according to the object identifier corresponding to the data to be obtained. In this way, the data acquisition time is long, and the user experience is poor. Therefore, in an embodiment of the present invention, the data stored in the database can be decrypted first to obtain multiple object data.

[0112] Specifically, before reading the data to be obtained corresponding to the object identifier from the local memory, it can also include: reading multiple objects stored in a preset database, obtaining the object identifier corresponding to the target object, and the target object is any one of the multiple objects. According to the object identifier corresponding to the target object, the encryption key corresponding to the target object is determined. The encrypted data in the target object is decrypted using the encryption key corresponding to the target object to obtain the target object data corresponding to the target object. According to the configuration information corresponding to the object data, the target object data is formatted and the original data (multiple data items) corresponding to the target object is obtained, and the original data corresponding to the target object is cached to the local memory.

[0113] In addition, in order to better provide data storage services for users, multiple backend servers can be used to provide data storage services for users at the same time to avoid the situation where a backend server fails and can still provide data storage services to users stably. Since multiple backend server architectures are used to provide data storage services for users, and the application scenario corresponding to human resource management is more reading than writing, when data changes, the data change information needs to be broadcasted to each backend server in the backend service cluster in a timely manner.

[0114] In an optional embodiment, data change messages can be broadcast through a message system to notify multiple backend servers to refresh memory data, thereby ensuring near real-time data updates and ensuring the consistency of data stored in local memories corresponding to multiple backend servers.

[0115] The embodiment of the present invention determines the object identifier corresponding to the data to be acquired according to the personnel identifier, and reads the data to be acquired corresponding to the object identifier from the local memory according to the object identifier corresponding to the data to be acquired, thereby providing a smooth access experience for the user.

[0116] Among them, the specific implementation process involved in the embodiments of the present invention can refer to the contents in the above embodiments, and will not be repeated here.

[0117] As the scale of enterprises continues to expand, human resource management needs are often changeable. In order to better meet the management needs of human resource managers, the embodiments of the present invention can also customize corresponding target calculation fields for human resource managers according to their management needs. According to the customized target calculation fields, data corresponding to the target calculation fields corresponding to each target person is obtained, so as to understand the target person more quickly and manage the target person.

[0118] Figure 5 A flowchart of another data storage method provided by an embodiment of the present invention is as follows: Figure 5 As shown, based on the above embodiment, the method may further include the following steps:

[0119] 501. In response to a data configuration operation triggered by a user in a data management interface, a data configuration interface is displayed, where the data configuration interface includes a data configuration operation area.

[0120] 502. Respond to data configuration information input by the user in the data configuration operation area.

[0121] 503. Determine a target calculation field and an expression corresponding to the target calculation field according to the data configuration information.

[0122] In order to enable the user to configure the target calculation field required by the user more quickly and conveniently, a data management interface can be provided for the user, and the corresponding target calculation field can be configured in the data management interface. Specifically, firstly, in response to the data configuration operation triggered by the user in the data management interface, the data configuration interface is displayed, and the data configuration interface includes a data configuration operation area. The user can enter data configuration information in the data configuration operation area included in the data configuration interface. In response to the data configuration information entered by the user in the data configuration operation area, and based on the data configuration information, the target calculation field and the expression corresponding to the target calculation field are determined.

[0123] Among them, by utilizing the reference relationship between objects, custom reprocessing logic is set between the data fields corresponding to the object data of the same object and different objects. That is, the data configuration information can be the reprocessing logic between the various data items within the object. According to the data configuration information, the target calculation field and the expression corresponding to the target calculation field can be determined. For example, the target calculation field is length of service, and the expression corresponding to the target calculation field is current time-entry time. Generally, the local memory stores the basic information such as the entry time corresponding to each target person. According to the basic information stored in the local memory, the target person corresponding to each target person can be obtained.

[0124] With the above method, human resource managers can customize target calculation fields according to management needs. Human resource managers can respond to changes in management needs in real time without waiting for long-term technical personnel to intervene in secondary development. Then, when human resource management needs change, the corresponding target calculation fields can be flexibly generated, configured in real time, and effective in real time. There is no need for technical personnel to intervene in secondary development, and users' human resource management needs can be quickly met.

[0125] In addition, multiple data items corresponding to the target personnel are stored in a field of the relational database in the form of encrypted objects, and SQL cannot be used for data query. In order to solve this problem, in an embodiment of the present invention, a report is used instead of an SQL statement for query. Specifically, an index table is established for different types of objects, and some index conditions are stored in the index table in addition to the object ID. Through the index conditions, a list of object IDs can be quickly located. If the index table cannot cover the scenario, the object instance table can be used to traverse the entire table to obtain the ID list of the target object. Combined with the target calculation field set by the human resources manager, very flexible report data can be output.

[0126] The specific execution process and technical effects of the above steps in this embodiment are similar to the specific execution process and technical effects in the above embodiments. Please refer to the above statements for details, and no further details will be given here.

[0127] In addition, the data storage method provided by the embodiment of the present invention can be executed in the cloud or on the server side of the target application. In the cloud, several computing nodes (cloud servers) can be deployed, and each computing node has computing, storage and other processing resources. In the cloud, multiple computing nodes can be organized to provide the data storage service.

[0128] The data storage device of one or more embodiments of the present invention will be described in detail below. Those skilled in the art will appreciate that these devices can be configured using commercially available hardware components through the steps taught in this solution.

[0129] Figure 6 A schematic diagram of a data storage device according to an embodiment of the present invention is shown in FIG. Figure 6 As shown, the device includes: an acquisition module 11, a conversion module 12, a first determination module 13, a second determination module 14, an encryption module 15, and a generation module 16.

[0130] The acquisition module 11 is used to acquire a data set to be processed corresponding to a target person, wherein the data set to be processed includes multiple data items.

[0131] The conversion module 12 is used to perform format conversion on the multiple data items to obtain first object data corresponding to the data set to be processed, where the first object data is an abstract representation of the data set to be processed.

[0132] The first determining module 13 is configured to determine a key index corresponding to the first object data according to the object identifier of the first object data.

[0133] The second determining module 14 is configured to determine an encryption key corresponding to the first object data according to the key index.

[0134] The encryption module 15 is used to encrypt the first object data using the encryption key to obtain encrypted data.

[0135] The generating module 16 is configured to generate a first object corresponding to the data set to be processed according to the encrypted data and the object identifier corresponding to the first object data, and store the first object in a preset database.

[0136] In an optional embodiment, the conversion module 12 is specifically used to: encapsulate the multiple data items into a first JSON string in the form of key-value pairs; and determine the first JSON string as the first object data corresponding to the data set to be processed.

[0137] In an optional embodiment, the first determination module 13 is specifically used to: determine the object identifier of the first object data using an identifier generator; and determine the key index corresponding to the first object data according to a preset hash function and the object identifier.

[0138] In an optional embodiment, the second determination module 14 is specifically used to: obtain a key acquisition rule; select a target key from a preset key library according to the key index and the key acquisition rule; and determine the target key as the encryption key corresponding to the first object data.

[0139] In an optional embodiment, the conversion module 12 can also be used to: obtain object identifiers of multiple first object data corresponding to the target person and object types corresponding to the multiple first object data; encapsulate the object identifiers of the multiple first object data in the form of key-value pairs as a second JSON string according to the object types corresponding to the multiple first object data; determine the second JSON string as the second object data corresponding to the target person; generate a second object corresponding to the target person according to the second object data and the object identifier corresponding to the second object data, the second object being associated with multiple first object data; and store the second object in a preset database.

[0140] In an optional embodiment, the first generation module 16 can also be used to: receive a data acquisition request triggered by a user in a data management interface, the data acquisition request including a personnel identifier corresponding to the data to be acquired; determine an object identifier corresponding to the data to be acquired based on the personnel identifier; read the data to be acquired corresponding to the object identifier from a local memory based on the object identifier corresponding to the data to be acquired, wherein the local memory caches multiple objects stored in the preset database; and display the data to be acquired on the data management interface.

[0141] In an optional embodiment, the generation module 16 can also be used to: read multiple objects stored in the preset database; obtain an object identifier corresponding to a target object, where the target object is any one of the multiple objects; determine an encryption key corresponding to the target object based on the object identifier corresponding to the target object; use the encryption key corresponding to the target object to decrypt the encrypted data in the target object to obtain target object data corresponding to the target object; format-convert the target object data based on configuration information corresponding to the object data to obtain original data corresponding to the target object; and cache the original data corresponding to the target object to the local memory.

[0142] In an optional embodiment, the generation module 16 can also be used to: in response to a data configuration operation triggered by a user in the data management interface, display a data configuration interface, the data configuration interface including a data configuration operation area; in response to data configuration information input by the user in the data configuration operation area; determine a target calculation field and an expression corresponding to the target calculation field based on the data configuration information.

[0143] Figure 6 The device shown can execute the steps in the data storage method in the aforementioned embodiment. The detailed execution process and technical effects can be found in the description of the aforementioned embodiment, which will not be repeated here.

[0144] The embodiment of the present invention also provides an electronic device, such as Figure 7 As shown, the electronic device may include: a processor 21, a memory 22, and a communication interface 23. The memory 22 stores executable codes, and when the executable codes are executed by the processor 21, the processor 21 implements the data storage method in the above-mentioned embodiment.

[0145] In addition, an embodiment of the present invention provides a non-temporary machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor can at least implement the data storage method provided in the aforementioned embodiment.

[0146] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.

[0147] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data storage method, characterized in that: include: Obtaining a data set to be processed corresponding to a target person, wherein the data set to be processed includes multiple data items; Performing format conversion on the multiple data items to obtain first object data corresponding to the data set to be processed, where the first object data is an abstract representation of the data set to be processed; Determining a key index corresponding to the first object data according to the object identifier of the first object data; Determining, according to the key index, an encryption key corresponding to the first object data; Using the encryption key, encrypting the first object data to obtain encrypted data; A first object corresponding to the data set to be processed is generated according to the encrypted data and the object identifier corresponding to the first object data, and the first object is stored in a preset database.

2. The method according to claim 1, characterized in that: The step of converting the format of the plurality of data items to obtain first object data corresponding to the data set to be processed includes: Encapsulate the multiple data items into a first JSON string in the form of key-value pairs; The first JSON string is determined as first object data corresponding to the data set to be processed.

3. The method according to claim 1, characterized in that The determining, according to the object identifier of the first object data, a key index corresponding to the first object data includes: Determining, using an identifier generator, an object identifier of the first object data; A key index corresponding to the first object data is determined according to a preset hash function and the object identifier.

4. The method according to claim 1, characterized in that: The determining, according to the key index, an encryption key corresponding to the first object data includes: Get the key acquisition rules; Selecting a target key from a preset key library according to the key index and the key acquisition rule; The target key is determined as an encryption key corresponding to the first object data.

5. The method according to claim 1, characterized in that The method further comprises: Acquire object identifiers of a plurality of first object data corresponding to a target person and object types corresponding to the plurality of first object data; According to the object types corresponding to the plurality of first object data, encapsulate the object identifiers of the plurality of first object data in the form of key-value pairs into a second JSON string; Determine the second JSON string as the second object data corresponding to the target person; generating a second object corresponding to the target person according to the second object data and an object identifier corresponding to the second object data, wherein the second object is associated with a plurality of first object data; The second object is stored in a preset database.

6. The method according to claim 1, characterized in that The method further comprises: Receiving a data acquisition request triggered by a user in a data management interface, wherein the data acquisition request includes a person identification corresponding to the data to be acquired; Determine, according to the personnel identifier, the object identifier corresponding to the data to be acquired; According to the object identifier corresponding to the data to be acquired, the data to be acquired corresponding to the object identifier is read from the local memory, wherein the local memory caches a plurality of objects stored in the preset database; The data to be acquired are displayed on the data management interface.

7. The method according to claim 6, characterized in that Before reading the to-be-acquired data corresponding to the object identifier from the local memory, the method further includes: Reading multiple objects stored in the preset database; Obtaining an object identifier corresponding to a target object, where the target object is any one of the multiple objects; Determining an encryption key corresponding to the target object according to an object identifier corresponding to the target object; Decrypting the encrypted data in the target object using the encryption key corresponding to the target object to obtain the target object data corresponding to the target object; According to the configuration information corresponding to the object data, the target object data is formatted to obtain the original data corresponding to the target object; The original data corresponding to the target object is cached in the local memory.

8. The method according to claim 7, characterized in that The method further comprises: In response to a data configuration operation triggered by a user in the data management interface, displaying a data configuration interface, wherein the data configuration interface includes a data configuration operation area; responding to data configuration information input by the user in the data configuration operation area; According to the data configuration information, a target calculation field and an expression corresponding to the target calculation field are determined.

9. An electronic device, characterized in that: include: A memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the data storage method as described in any one of claims 1 to 8.

10. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the data storage method according to any one of claims 1 to 8.