[go: up one dir, main page]

CN116028486A - Method and device for data storage and data query - Google Patents

Method and device for data storage and data query Download PDF

Info

Publication number
CN116028486A
CN116028486A CN202211300523.9A CN202211300523A CN116028486A CN 116028486 A CN116028486 A CN 116028486A CN 202211300523 A CN202211300523 A CN 202211300523A CN 116028486 A CN116028486 A CN 116028486A
Authority
CN
China
Prior art keywords
data
identifier
query
storage
timeliness
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211300523.9A
Other languages
Chinese (zh)
Inventor
张娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202211300523.9A priority Critical patent/CN116028486A/en
Publication of CN116028486A publication Critical patent/CN116028486A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention discloses a method and a device for data storage and data query, and relates to the technical field of Internet medical treatment and information security. One embodiment of the method comprises the following steps: responding to a first data storage request sent by a service front end, storing data to be stored in a first database, generating a storage aging identifier according to a data identifier of the data to be stored, and sending the storage aging identifier to the service front end; and responding to a second data storage request containing the storage aging identifier sent by the service front end, and storing the data identifier into a second database under the condition that the storage aging identifier is not expired. According to the embodiment, the data security is effectively improved, the personal privacy is maintained, and the security of the platform data information is ensured.

Description

一种数据存储和数据查询的方法和装置Method and device for data storage and data query

技术领域technical field

本发明涉及互联网医疗及信息安全技术领域,尤其涉及一种数据存储和数据查询的方法和装置。The invention relates to the technical fields of Internet medical care and information security, in particular to a method and device for data storage and data query.

背景技术Background technique

随着互联网、大数据技术的发展和应用,数据信息作为一种重要资产其安全性也受到越来越多的关注,尤其是个人信息安全。在用户通过平台进行个人信息的录入及查询的场景下,现有技术通常通过用户权限控制、加密处理等技术手段实现对个人数据信息的安全管理。With the development and application of Internet and big data technology, the security of data information as an important asset has also received more and more attention, especially the security of personal information. In the scenario where the user enters and inquires personal information through the platform, the existing technology usually realizes the security management of personal data information through technical means such as user authority control and encryption processing.

在实现本发明过程中,发明人发现对于数据量较大的个人文件数据,在获取到数据访问请求时,通常由后端解密后返回对应的文件链接给业务前端,文件链接的安全性没有进行有效的保障,致使数据存在泄漏、篡改等风险,不仅个人隐私得不到有效保护,平台的信誉度也会受到影响。In the process of implementing the present invention, the inventor found that for personal file data with a large amount of data, when the data access request is obtained, the backend usually decrypts and returns the corresponding file link to the business front end, and the security of the file link is not guaranteed. Effective protection will lead to risks such as data leakage and tampering. Not only will personal privacy not be effectively protected, but the credibility of the platform will also be affected.

发明内容Contents of the invention

有鉴于此,本发明实施例提供一种数据存储和数据查询的方法和装置,在对数据进行存储时,根据待存储数据的数据标识生成存储时效标识,在存储时效标识未过期的情况下完成数据存储;在对数据进行查询时,根据用户标识获取数据标识,以生成查询时效标识,在查询时效标识未过期的情况下获取待查询数据。通过本发明实施例基于访问时效的数据存储和查询,有效提升了数据的安全性,维护了个人隐私,保障了平台数据信息的安全。In view of this, the embodiments of the present invention provide a method and device for data storage and data query. When storing data, a storage aging identifier is generated according to the data identifier of the data to be stored, and the storage aging identifier is completed when the storage aging identifier has not expired. Data storage; when querying data, the data identifier is obtained according to the user identifier to generate a query aging identifier, and the data to be queried is obtained when the query aging identifier has not expired. Through the data storage and query based on access timeliness in the embodiment of the present invention, data security is effectively improved, personal privacy is maintained, and the security of platform data information is guaranteed.

为实现所述目的,根据本发明实施例的一个方面,提供了一种数据存储的方法,包括:To achieve the above purpose, according to an aspect of the embodiments of the present invention, a data storage method is provided, including:

响应于接收到业务前端发来的第一数据存储请求,将待存储数据保存到第一数据库,并根据所述待存储数据的数据标识生成存储时效标识,将所述存储时效标识发送给所述业务前端;In response to receiving the first data storage request from the service front end, save the data to be stored in the first database, generate a storage timeliness identifier according to the data identifier of the data to be stored, and send the storage timeliness identifier to the business front end;

响应于接收到所述业务前端发来的含有所述存储时效标识的第二数据存储请求,在所述存储时效标识未过期的情况下,将所述数据标识保存到第二数据库。In response to receiving a second data storage request from the service front end that includes the storage timeliness identifier, if the storage timeliness identifier has not expired, save the data identifier to the second database.

可选地,在将待存储数据保存到第一数据库之前,还包括:对所述待存储数据进行加密处理;在将所述数据标识保存到第二数据库之前,还包括:对所述数据标识进行加密处理。Optionally, before saving the data to be stored in the first database, it also includes: encrypting the data to be stored; before saving the data identification in the second database, it also includes: identifying the data Perform encryption processing.

可选地,在根据所述待存储数据的数据标识生成存储时效标识之后,还包括:建立并存储所述存储时效标识和所述数据标识的映射关系;在将所述数据标识保存到第二数据库之前,还包括:根据所述存储时效标识,从存储的所述存储时效标识和所述数据标识的映射关系中查找与所述存储时效标识对应的所述数据标识。Optionally, after generating the storage aging identifier according to the data identifier of the data to be stored, it further includes: establishing and storing a mapping relationship between the storage aging identifier and the data identifier; saving the data identifier to the second Before the database, the method further includes: searching for the data identifier corresponding to the storage expiration identifier from the stored mapping relationship between the storage expiration identifier and the data identifier according to the storage expiration identifier.

可选地,所述第二数据存储请求包括用户标识,所述存储时效标识具有有效时间;在所述存储时效标识未过期的情况下,将所述数据标识保存到第二数据库,包括:记录接收到所述第二数据存储请求的接收时间,并从所述第二数据存储请求中获取所述存储时效标识;根据所述存储时效标识的有效时间和所述接收时间判断所述存储时效标识是否过期;在所述接收时间位于所述存储时效标识的有效时间之前的情况下,判定所述存储时效标识未过期,将所述数据标识和所述用户标识关联保存到所述第二数据库。Optionally, the second data storage request includes a user ID, and the storage aging ID has an effective time; if the storage aging ID has not expired, saving the data ID to the second database includes: recording receiving the receiving time of the second data storage request, and obtaining the storage aging identifier from the second data storage request; judging the storage aging identifier according to the valid time of the storage expiration identifier and the receiving time whether it has expired; if the receiving time is before the valid time of the stored aging identifier, it is determined that the stored aging identifier has not expired, and the data identifier and the user identifier are associated and stored in the second database.

可选地,在接收到业务前端发来的第一数据存储请求之前,还包括:响应于所述业务前端发来的注册请求,为用户分配访问权限,所述访问权限用于响应于接收到业务前端发来的第一数据存储请求,根据所述访问权限对用户进行权限校验。Optionally, before receiving the first data storage request sent by the service front end, it also includes: in response to the registration request sent by the service front end, assigning access rights to users, and the access rights are used to respond to receiving In the first data storage request sent by the business front-end, authority verification is performed on the user according to the access authority.

根据本发明实施例的第二个方面,提供了一种数据查询的方法,包括:According to a second aspect of the embodiments of the present invention, a method for data query is provided, including:

响应于接收到业务前端发来的第一数据查询请求,根据所述第一数据查询请求中的用户标识,从第二数据库中查找与所述用户标识对应的数据标识,并根据所述数据标识生成查询时效标识,将所述查询时效标识发送给所述业务前端;In response to receiving the first data query request from the service front end, according to the user ID in the first data query request, look up the data ID corresponding to the user ID from the second database, and according to the data ID Generate a query timeliness identifier, and send the query timeliness identifier to the service front end;

响应于接收到所述业务前端发来的含有所述查询时效标识的第二数据查询请求,在所述查询时效标识未过期的情况下,根据所述查询时效标识从第一数据库中获取数据。In response to receiving a second data query request from the service front end that includes the query timeliness identifier, if the query timeliness identifier has not expired, acquire data from the first database according to the query timeliness identifier.

可选地,根据所述第一数据查询请求中的用户标识,从第二数据库中查找与所述用户标识对应的数据标识,包括:根据所述第一数据查询请求中的用户标识,从第二数据库中查找与所述用户标识对应的加密数据标识;对所述加密数据标识进行解密以得到所述数据标识;根据所述查询时效标识从第一数据库中获取数据,包括:根据所述查询时效标识从第一数据库中获取加密数据;对所述加密数据进行解密以得到所述数据。Optionally, searching the second database for the data identifier corresponding to the user identifier according to the user identifier in the first data query request includes: according to the user identifier in the first data query request, searching from the second Searching the encrypted data identifier corresponding to the user identifier in the second database; decrypting the encrypted data identifier to obtain the data identifier; obtaining data from the first database according to the query timeliness identifier, including: according to the query The aging identification acquires encrypted data from the first database; decrypts the encrypted data to obtain the data.

可选地,所述查询时效标识具有有效时间,所述查询时效标识与所述数据标识具有映射关系;在根据所述数据标识生成查询时效标识之后,还包括:建立并存储所述数据标识和所述查询时效标识的映射关系;在所述查询时效标识未过期的情况下,根据所述查询时效标识从第一数据库中获取数据,包括:记录接收到所述第二数据查询请求的接收时间,并从所述第二数据查询请求中获取所述查询时效标识;根据所述查询时效标识的有效时间和所述接收时间判断所述查询时效标识是否过期;在所述接收时间位于所述查询时效标识的有效时间之前的情况下,判定所述查询时效标识未过期,根据所述查询时效标识,从存储的所述查询时效标识和所述数据标识的映射关系中,得到所述数据标识;根据所述数据标识从第一数据库中获取所述数据。Optionally, the query aging identifier has a valid time, and the query aging identifier has a mapping relationship with the data identifier; after the query aging identifier is generated according to the data identifier, it further includes: establishing and storing the data identifier and The mapping relationship of the query timeliness identifier; in the case that the query timeliness indicator has not expired, obtaining data from the first database according to the query timeliness indicator, including: recording the receiving time of receiving the second data query request , and obtain the query aging identifier from the second data query request; judge whether the query aging identifier is expired according to the valid time of the query aging identifier and the receiving time; In the case of before the effective time of the timeliness mark, it is determined that the query timeliness mark has not expired, and according to the query timeliness mark, the data mark is obtained from the stored mapping relationship between the query timeliness mark and the data mark; The data is acquired from the first database according to the data identifier.

根据本发明实施例的第三方面,提供一种数据存储的装置,包括:According to a third aspect of the embodiments of the present invention, a data storage device is provided, including:

第一数据存储模块,用于响应于接收到业务前端发来的第一数据存储请求,将待存储数据保存到第一数据库,并根据所述待存储数据的数据标识生成存储时效标识,将所述存储时效标识发送给所述业务前端;The first data storage module is configured to save the data to be stored in the first database in response to receiving the first data storage request sent by the service front end, and generate a storage timeliness identifier according to the data identifier of the data to be stored, and store the stored data The storage timeliness identifier is sent to the service front end;

第二数据存储模块,用于响应于接收到所述业务前端发来的含有所述存储时效标识的第二数据存储请求,在所述存储时效标识未过期的情况下,将所述数据标识保存到第二数据库。The second data storage module is configured to save the data identifier when the storage expiration identifier has not expired in response to receiving the second data storage request containing the storage aging identifier sent by the service front end to the second database.

根据本发明实施例的第四方面,提供一种数据查询的装置,包括:According to a fourth aspect of the embodiments of the present invention, a data query device is provided, including:

第一数据查询模块,用于响应于接收到业务前端发来的第一数据查询请求,根据所述第一数据查询请求中的用户标识,从第二数据库中查找与所述用户标识对应的数据标识,并根据所述数据标识生成查询时效标识,将所述查询时效标识发送给所述业务前端;The first data query module is configured to, in response to receiving the first data query request sent by the service front end, search for data corresponding to the user ID from the second database according to the user ID in the first data query request ID, and generate a query timeliness ID according to the data ID, and send the query timeliness ID to the service front end;

第二数据查询模块,用于响应于接收到所述业务前端发来的含有所述查询时效标识的第二数据查询请求,在所述查询时效标识未过期的情况下,根据所述查询时效标识从第一数据库中获取数据。The second data query module is configured to, in response to receiving the second data query request containing the query timeliness identifier sent by the service front end, in the case that the query timeliness identifier has not expired, according to the query timeliness identifier Get data from the first database.

根据本发明实施例的第五方面,提供一种数据存储和数据查询的电子设备,其特征在于,包括:According to a fifth aspect of the embodiments of the present invention, there is provided an electronic device for data storage and data query, which is characterized in that it includes:

一个或多个处理器;one or more processors;

存储装置,用于存储一个或多个程序,storage means for storing one or more programs,

当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现本发明实施例第一方面和/或第二方面提供的方法。When the one or more programs are executed by the one or more processors, the one or more processors are made to implement the method provided by the first aspect and/or the second aspect of the embodiment of the present invention.

根据本发明实施例的第六方面,提供一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现本发明实施例第一方面和/或第二方面提供的方法。According to a sixth aspect of the embodiments of the present invention, there is provided a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect and/or the second aspect of the embodiments of the present invention is implemented .

所述发明中的一个实施例具有如下优点或有益效果:通过响应于接收到业务前端发来的第一数据存储请求,将待存储数据保存到第一数据库,并根据待存储数据的数据标识生成存储时效标识,将存储时效标识发送给业务前端;响应于接收到业务前端发来的含有存储时效标识的第二数据存储请求,在存储时效标识未过期的情况下,将数据标识保存到第二数据库的技术方案,实现了在对数据进行存储时,根据待存储数据的数据标识生成存储时效标识,在存储时效标识未过期的情况下完成数据存储,基于时效标识的数据存储,有效提升了数据的安全性,维护了个人隐私,保障了平台数据信息的安全。另外,本发明通过响应于接收到业务前端发来的第一数据查询请求,根据第一数据查询请求中的用户标识,从第二数据库中查找与用户标识对应的数据标识,并根据数据标识生成查询时效标识,将查询时效标识发送给业务前端;响应于接收到业务前端发来的含有查询时效标识的第二数据查询请求,在查询时效标识未过期的情况下,根据查询时效标识从第一数据库中获取数据的技术方案,在对数据进行查询时,根据用户标识获取数据标识,以生成查询时效标识,在查询时效标识未过期的情况下获取待查询数据,基于时效标识进行数据查询,有效提升了数据的安全性,维护了个人隐私,保障了平台数据信息的安全。An embodiment of the invention has the following advantages or beneficial effects: in response to receiving the first data storage request sent by the service front end, the data to be stored is stored in the first database, and the data to be stored is generated according to the data identification of the data to be stored Store the aging identifier, and send the storage aging identifier to the business front end; in response to receiving the second data storage request containing the storage aging identifier sent by the business front end, save the data identifier to the second data store if the storage aging identifier has not expired. The technical solution of the database realizes that when storing data, a storage aging identifier is generated according to the data identifier of the data to be stored, and the data storage is completed when the storage aging identifier has not expired. The data storage based on the aging identifier effectively improves the data quality. The security of personal privacy is maintained, and the security of platform data information is guaranteed. In addition, the present invention searches the second database for the data identifier corresponding to the user identifier according to the user identifier in the first data query request in response to receiving the first data query request sent by the service front end, and generates Query the timeliness identifier, and send the query timeliness identifier to the service front end; in response to receiving the second data query request containing the query timeliness identifier sent by the business front end, in the case that the query timeliness identifier has not expired, according to the query timeliness identifier from the first The technical solution for obtaining data in the database, when querying data, obtains the data identifier according to the user identifier to generate the query aging identifier, obtains the data to be queried when the query aging identifier has not expired, and performs data query based on the aging identifier, which is effective Improve data security, maintain personal privacy, and ensure the security of platform data information.

附图说明Description of drawings

附图用于更好地理解本发明,不构成对本发明的不当限定。其中:The accompanying drawings are used to better understand the present invention, and do not constitute improper limitations to the present invention. in:

图1是根据本发明实施例的数据存储的方法的主要流程的示意图;Fig. 1 is a schematic diagram of the main flow of a method for data storage according to an embodiment of the present invention;

图2是本发明实施例用户访问权限的校验示意图;Fig. 2 is a schematic diagram of verification of user access rights in an embodiment of the present invention;

图3是本发明实施例的数据存储的方法的整体流程示意图;FIG. 3 is a schematic overall flowchart of a data storage method according to an embodiment of the present invention;

图4是根据本发明实施例的数据查询的方法的主要流程的示意图;FIG. 4 is a schematic diagram of a main flow of a data query method according to an embodiment of the present invention;

图5是本发明实施例的文件数据查询的方法的整体流程的示意图;FIG. 5 is a schematic diagram of an overall flow of a method for querying file data according to an embodiment of the present invention;

图6是本发明实施例的数据存储和数据查询的方法的整体架构示意图;6 is a schematic diagram of the overall architecture of the method for data storage and data query according to an embodiment of the present invention;

图7是根据本发明实施例的数据存储的装置的主要模块示意图;7 is a schematic diagram of main modules of a data storage device according to an embodiment of the present invention;

图8是根据本发明实施例的数据查询的装置的主要模块示意图;Fig. 8 is a schematic diagram of main modules of a device for data query according to an embodiment of the present invention;

图9是本发明实施例可以应用于其中的示例性系统架构图;FIG. 9 is an exemplary system architecture diagram to which the embodiment of the present invention can be applied;

图10是适于用来实现本发明实施例的终端设备或服务器的计算机系统的结构示意图。Fig. 10 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.

具体实施方式Detailed ways

本发明技术方案中对数据的获取、存储、使用、处理等均符合国家法律法规的相关规定。The acquisition, storage, use, and processing of data in the technical solution of the present invention all comply with the relevant provisions of national laws and regulations.

以下结合附图对本发明的示范性实施例做出说明,其中包括本发明实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本发明的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present invention to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

本发明设想负责采集、分析、公开、传输、存储或其他使用此类个人信息数据的实体将遵守既定的隐私政策和/或隐私实践。具体地,此类实体应当实行并坚持使用被公认为满足或超出对维护个人信息数据的隐私性和安全性的行业或政府要求的隐私政策和实践。此类政策应该能被用户方便地访问,并应随着数据的采集和/或使用变化而被更新。来自用户的个人信息应当被收集用于实体的合法且合理的用途,并且不在这些合法使用之外共享或出售。此外,应在收到用户知情同意后进行此类采集/共享。此外,此类实体应考虑采取任何必要步骤,保卫和保障对此类个人信息数据的访问,并确保有权访问个人信息数据的其他人遵守其隐私政策和流程。另外,这种实体可使其本身经受第三方评估以证明其遵守广泛接受的隐私政策和实践。此外,应当调整政策和实践,以便采集和/或访问的特定类型的个人信息数据,并适用于包括管辖范围的具体考虑的适用法律和标准。例如,在美国,对某些健康数据的收集或获取可能受联邦和/或州法律的管辖,诸如健康保险流通和责任法案(HIPAA);而其他国家的健康数据可能受到其他法规和政策的约束并应相应处理。因此,在每个国家应为不同的个人数据类型保持不同的隐私实践。The present invention contemplates that entities responsible for collecting, analyzing, disclosing, transmitting, storing or otherwise using such Personal Information data will adhere to established privacy policies and/or privacy practices. Specifically, such entities shall implement and adhere to privacy policies and practices that are recognized as meeting or exceeding industry or government requirements for maintaining the privacy and security of personal information data. Such policies should be easily accessible to users and should be updated as data collection and/or use changes. Personal information from users should be collected for the entity's lawful and reasonable uses and not shared or sold outside of those lawful uses. In addition, such collection/sharing should be done after receiving informed consent from users. In addition, such entities should consider taking any necessary steps to safeguard and secure access to such Personal Information Data and to ensure that others who have access to Personal Information Data comply with their privacy policies and procedures. In addition, such entities may subject themselves to third-party assessments to demonstrate compliance with widely accepted privacy policies and practices. In addition, policies and practices should be tailored to the specific types of personal information data collected and/or accessed, and to applicable laws and standards including jurisdiction-specific considerations. For example, in the United States, the collection or acquisition of certain health data may be governed by federal and/or state laws, such as the Health Insurance Portability and Accountability Act (HIPAA); while health data in other countries may be subject to other regulations and policies and should be dealt with accordingly. Therefore, different privacy practices should be maintained in each country for different types of personal data.

不管前述情况如何,本发明还预期用户选择性地阻止使用或访问个人信息数据的实施方案。即本发明预期可提供硬件元件和/或软件元件,以防止或阻止对此类个人信息数据的访问。例如,就访问或存储健康信息而言,本发明的技术可被配置为在注册服务期间或其后的任何时间允许用户选择“选择加入”或“选择退出”参与对个人信息数据的收集。在另一个示例中,用户可以选择不提供特定类型的健康相关信息。在又一个示例中,用户可以选择限制维持健康相关信息的时间长度或者完全禁止健康相关信息的存储。除了提供“选择加入”和“选择退出”选项外,本发明设想提供与访问或使用个人信息相关的通知。例如,可在下载应用时向用户通知其个人信息数据将被访问,然后就在个人信息数据被应用访问之前再次提醒用户。Notwithstanding the foregoing, the present invention also contemplates embodiments in which a user selectively blocks the use or access of personal information data. That is, the present invention contemplates that hardware elements and/or software elements may be provided to prevent or prevent access to such personal information data. For example, with respect to accessing or storing health information, the technology of the present invention may be configured to allow users to choose to "opt in" or "opt out" of the collection of personal information data during registration for the service or at any time thereafter. In another example, a user may choose not to provide certain types of health-related information. In yet another example, the user may choose to limit the length of time the health-related information is maintained or disable storage of the health-related information altogether. In addition to providing "opt-in" and "opt-out" options, the present invention contemplates providing notices related to access or use of personal information. For example, users can be notified that their personal information data will be accessed when downloading an application, and then reminded again just before personal information data is accessed by the application.

此外,本发明的目的是应管理和处理个人信息数据以最小化无意或未经授权访问或使用的风险。一旦不再需要数据,通过限制数据收集和删除数据可最小化风险。此外,并且当适用时,包括在某些健康相关应用程序中,数据去标识可用于保护用户的隐私。可在适当时通过移除特定标识符(例如,出生日期等)、控制所存储数据的量或特异性(例如,在城市级别而不是在地址级别收集位置数据)、控制数据如何被存储(例如,在用户之间聚合数据)、和/或其他方法来促进去标识。Furthermore, it is an object of the present invention that personal information data should be managed and processed to minimize the risk of unintentional or unauthorized access or use. Risk is minimized by limiting data collection and deleting data once it is no longer needed. Additionally, and when applicable, including in certain health-related applications, data de-identification may be used to protect user privacy. By removing specific identifiers (e.g., date of birth, etc.), controlling the amount or specificity of data stored (e.g., collecting location data at the city level rather than at the address level), controlling how data is stored (e.g., , aggregate data across users), and/or other methods to facilitate de-identification.

目前在用户通过平台进行个人信息的录入和查询的场景下,对于数据量较大的个人文件信息,在获取到数据访问请求时,通常由后端解密后返回对应的文件链接给业务前端,文件链接的安全性没有进行有效的保障,致使数据存在泄漏、篡改等风险,不仅个人隐私得不到有效保护,平台的信誉度也会受到影响,不能很好的满足实际应用。At present, in the scenario where users enter and query personal information through the platform, for personal file information with a large amount of data, when the data access request is obtained, the backend usually decrypts and returns the corresponding file link to the business front end. The security of the link is not effectively guaranteed, resulting in risks such as data leakage and tampering. Not only is personal privacy not effectively protected, but the credibility of the platform will also be affected, which cannot well meet practical applications.

为了解决现有技术中存在的上述问题,本发明提出一种数据存储和数据查询的方法,在对数据进行存储时,根据待存储数据的数据标识生成存储时效标识,在存储时效标识未过期的情况下完成数据存储;在对数据进行查询时,根据用户标识获取数据标识,以生成查询时效标识,在查询时效标识未过期的情况下获取待查询数据。通过本发明实施例基于时效标识的数据存储和查询,有效提升了数据的安全性,维护了个人隐私,保障了平台数据信息的安全。In order to solve the above-mentioned problems existing in the prior art, the present invention proposes a method for data storage and data query. When storing data, a storage aging identifier is generated according to the data identifier of the data to be stored. Complete data storage under certain circumstances; when querying data, obtain the data identifier according to the user identifier to generate the query aging identifier, and obtain the data to be queried when the query aging identifier has not expired. Through the data storage and query based on the aging label in the embodiment of the present invention, data security is effectively improved, personal privacy is maintained, and the security of platform data information is guaranteed.

在本发明的实施例介绍中,所涉及的名词及其含义如下:In the introduction of the embodiments of the present invention, involved nouns and their meanings are as follows:

AES:密码学中的高级加密标准(Advanced Encryption Standard,AES),又称Rijndael加密法,是一种区块加密标准;AES: Advanced Encryption Standard (AES) in cryptography, also known as Rijndael encryption, is a block encryption standard;

RSA:一种非对称加密算法,在公开密钥加密和电子商业中被广泛使用;RSA: an asymmetric encryption algorithm widely used in public key encryption and electronic commerce;

CRC:循环冗余校验码,是数据通信领域中最常用的一种查错校验码;CRC: Cyclic redundancy check code, which is the most commonly used error checking code in the field of data communication;

MD5:信息摘要算法,一种被广泛使用的密码散列函数;MD5: Information Digest Algorithm, a widely used cryptographic hash function;

token:在计算机身份认证中是令牌(临时)的意思,一般作为邀请、登录系统使用;token: It means a token (temporary) in computer identity authentication, and is generally used as an invitation and login system;

文件系统:内部文件存储中间件,提供文件数据存储基础服务。File system: Internal file storage middleware, providing basic services for file data storage.

图1是根据本发明实施例的数据存储的方法的主要流程的示意图,如图1所示,本发明实施例的数据存储的方法包括如下的步骤S101至步骤S102。FIG. 1 is a schematic diagram of a main flow of a data storage method according to an embodiment of the present invention. As shown in FIG. 1 , the data storage method of the embodiment of the present invention includes the following steps S101 to S102.

步骤S101、响应于接收到业务前端发来的第一数据存储请求,将待存储数据保存到第一数据库,并根据所述待存储数据的数据标识生成存储时效标识,将所述存储时效标识发送给所述业务前端。Step S101: In response to receiving the first data storage request from the service front end, save the data to be stored in the first database, generate a storage timeliness identifier according to the data identifier of the data to be stored, and send the storage timeliness to the business front end.

具体地,在互联网医院场景下,依据国家的诊疗技术规范和操作规程,各地的医生都可以提交个人信息进行电子实名认证,并在通过互联网医院平台审核后成为入驻医生,其中个人信息包括医生的姓名、年龄、性别、民族、籍贯等个人身份信息,以及医生的证件图片等资质文件信息。对于个人身份信息这类数据量较小的信息,在访问权限校验通过后,经过互联网医院平台对其进行加密处理,再由互联网医院平台的医生主数据服务保存到MySQL,并在查询数据时,由业务前端从MySQL获取加密数据,对加密数据进行解密处理后展示给用户即可。本发明实施例主要针对数据量较大的文件数据,对文件数据的存储和查询的方法和装置进行说明。Specifically, in the Internet hospital scenario, according to the national diagnosis and treatment technical specifications and operating procedures, doctors from all over the country can submit personal information for electronic real-name authentication, and become a resident doctor after passing the review of the Internet hospital platform. Personally identifiable information such as name, age, gender, ethnicity, and place of origin, as well as qualification document information such as a doctor's ID picture. For information with a small amount of data such as personal identity information, after the access authority verification is passed, it will be encrypted by the Internet hospital platform, and then saved to MySQL by the doctor master data service of the Internet hospital platform, and when the data is queried , the business front end obtains the encrypted data from MySQL, decrypts the encrypted data and displays it to the user. The embodiments of the present invention mainly focus on the file data with a large amount of data, and describe the method and device for storing and querying the file data.

根据本发明的一个实施例,在接收到业务前端发来的第一数据存储请求之前,还包括:响应于所述业务前端发来的注册请求,为用户分配访问权限,所述访问权限用于响应于接收到业务前端发来的第一数据存储请求,根据所述访问权限对用户进行权限校验。According to an embodiment of the present invention, before receiving the first data storage request sent by the service front end, it also includes: in response to the registration request sent by the service front end, assigning access rights to users, and the access rights are used for In response to receiving the first data storage request sent by the service front end, an authorization check is performed on the user according to the access authorization.

具体地,在接收到业务前端发来的第一数据存储请求之前,医生用户需要通过业务前端向互联网医院平台发送注册请求,互联网医院平台在接收到注册请求后,为医生分配符合医生业务范围内的访问权限,例如医生个人信息的上传、修改、查询等权限,以在医生后续登录互联网医院平台对个人信息进行访问处理前进行权限校验,提升了数据的安全性。Specifically, before receiving the first data storage request from the business front-end, the doctor user needs to send a registration request to the Internet hospital platform through the business front-end. For example, permission to upload, modify, and query doctors' personal information, to verify permissions before doctors log in to the Internet hospital platform to access and process personal information, which improves data security.

图2是本发明实施例用户访问权限的校验示意图,图中注册中心给业务前端的用户分配访问权限token,用户通过业务前端向互联网医院平台的文件服务发送具有该访问权限token的访问请求时,由注册中心对该访问权限进行校验,并在校验通过后,允许用户访问。Figure 2 is a schematic diagram of verification of user access rights in the embodiment of the present invention. In the figure, the registration center assigns access rights tokens to users at the front end of the business, and when the user sends an access request with the token of the access rights to the file service of the Internet hospital platform through the front end of the business , the access right is verified by the registration center, and the user is allowed to access after the verification is passed.

根据本发明的另一个实施例,在将待存储数据保存到第一数据库之前,还包括:对所述待存储数据进行加密处理。According to another embodiment of the present invention, before saving the data to be stored in the first database, the method further includes: encrypting the data to be stored.

具体地,基于个人信息的安全性,互联网医院平台对医生待存储的文件数据进行加密处理,包括个人身份信息的加密处理和文件数据的加密处理。现有的加密算法有AES、RSA、CRC、MD5,其中CRC和MD5算法主要用来文件校验,对加密后的内容不可逆;AES为可解密的对称加密算法,加解密使用同一秘钥,速度快,效率高,但存在秘钥交换问题;RSA为非对称加密,有128位、192位、256位秘钥长度可选,秘钥长度越高加密级别越高,但性能更差。考虑到本发明实施例的互联网医院场景,文件的加密解密都由平台的文件服务完成,属于统一服务系统,不必考虑秘钥交换问题,所以采用AES对称加密,约定使用秘钥内容。Specifically, based on the security of personal information, the Internet hospital platform encrypts the file data to be stored by doctors, including the encryption of personal identity information and the encryption of file data. The existing encryption algorithms include AES, RSA, CRC, and MD5. Among them, CRC and MD5 algorithms are mainly used for file verification, and the encrypted content is irreversible; AES is a decryptable symmetric encryption algorithm, which uses the same secret key for encryption and decryption. Fast and efficient, but there is a problem of key exchange; RSA is asymmetric encryption, with optional key lengths of 128 bits, 192 bits, and 256 bits. The higher the key length, the higher the encryption level, but the performance is worse. Considering the Internet hospital scene of the embodiment of the present invention, the encryption and decryption of files are all completed by the file service of the platform, which belongs to the unified service system, and there is no need to consider the issue of key exchange, so AES symmetric encryption is adopted, and the content of the key is agreed to be used.

根据本发明的再一个实施例,在根据所述待存储数据的数据标识生成存储时效标识之后,还包括:建立并存储所述存储时效标识和所述数据标识的映射关系。According to yet another embodiment of the present invention, after generating the storage aging identifier according to the data identifier of the data to be stored, the method further includes: establishing and storing a mapping relationship between the storage aging identifier and the data identifier.

具体地,医生在业务前端进行资质文件数据的上传操作,向互联网医院平台发出文件数据的存储请求,互联网医院平台接收到来自业务前端的文件数据存储请求,文件数据通过互联网医院平台的文件服务保存到第一数据库文件系统,考虑到文件数据一般为资质文件图片,其数据量较大,在将文件保存到文件系统时,文件系统会返回数据标识,通过该数据标识可以从文件系统中获取到对应的文件数据,可以当作文件链接进行理解。互联网医院平台的文件服务根据接收到的数据标识生成对应的存储时效标识,建立存储时效标识和数据标识之间的映射关系,保存到Redis数据库,再将生成的存储时效标识发送给业务前端。Specifically, the doctor uploads the qualification file data at the front end of the business, sends a file data storage request to the Internet hospital platform, and the Internet hospital platform receives the file data storage request from the business front end, and the file data is saved through the file service of the Internet hospital platform To the first database file system, considering that the file data is generally a picture of a qualification file, and its data volume is relatively large, when saving the file to the file system, the file system will return the data ID, through which the data ID can be obtained from the file system. The corresponding file data can be understood as a file link. The file service of the Internet hospital platform generates the corresponding storage aging identifier according to the received data identifier, establishes the mapping relationship between the storage aging identifier and the data identifier, saves it in the Redis database, and then sends the generated storage aging identifier to the business front end.

步骤S102、响应于接收到所述业务前端发来的含有所述存储时效标识的第二数据存储请求,在所述存储时效标识未过期的情况下,将所述数据标识保存到第二数据库。Step S102, in response to receiving the second data storage request from the service front end that includes the storage timeliness identifier, if the storage timeliness identifier has not expired, save the data identifier to the second database.

具体地,业务前端接收到互联网平台发送的存储时效标识,此存储时效标识用于控制访问时效,一般情况下,对于资质文件的存储需要在业务前端的界面中进行回显,例如上传的文件扫描图片会以图片缩略图的形式填充在录入位置。考虑到文件数据的安全性,文件数据对应的数据标识不向业务前端展示,而且文件数据需要与医生个人身份信息联合存储,所以需要将文件数据对应的数据标识通过互联网医院平台的医生主数据服务保存到第二数据库MySQL。Specifically, the business front end receives the storage timeliness identifier sent by the Internet platform, which is used to control the access timeliness. In general, the storage of qualification files needs to be echoed in the interface of the business frontend, such as uploaded file scanning The picture will be filled in the entry position in the form of a picture thumbnail. Considering the security of the file data, the data identification corresponding to the file data is not displayed to the front end of the business, and the file data needs to be stored jointly with the personal identity information of the doctor, so it is necessary to pass the data identification corresponding to the file data through the doctor master data service of the Internet hospital platform Save to the second database MySQL.

根据本发明的一个实施例,所述第二数据存储请求包括用户标识,所述存储时效标识具有有效时间;在所述存储时效标识未过期的情况下,将所述数据标识保存到第二数据库,包括:记录接收到所述第二数据存储请求的接收时间,并从所述第二数据存储请求中获取所述存储时效标识;根据所述存储时效标识的有效时间和所述接收时间判断所述存储时效标识是否过期;在所述接收时间位于所述存储时效标识的有效时间之前的情况下,判定所述存储时效标识未过期,将所述数据标识和所述用户标识关联保存到所述第二数据库。According to an embodiment of the present invention, the second data storage request includes a user ID, and the storage aging ID has a valid time; if the storage aging ID has not expired, save the data ID to the second database , including: recording the receiving time of receiving the second data storage request, and obtaining the storage aging identifier from the second data storage request; Whether the storage timeliness ID has expired; if the receiving time is before the valid time of the storage timeliness ID, it is determined that the storage timeliness ID has not expired, and the data ID and the user ID are associated and stored in the Second database.

根据本发明的另一个实施例,在将所述数据标识保存到第二数据库之前,还包括:根据所述存储时效标识,从存储的所述存储时效标识和所述数据标识的映射关系中查找与所述存储时效标识对应的所述数据标识。According to another embodiment of the present invention, before saving the data identifier to the second database, it further includes: according to the storage expiration identifier, searching for the stored mapping relationship between the storage expiration identifier and the data identifier The data identifier corresponding to the storage timeliness identifier.

根据本发明的再一个实施例,在将所述数据标识保存到第二数据库之前,还包括:对所述数据标识进行加密处理。According to yet another embodiment of the present invention, before saving the data identifier into the second database, the method further includes: encrypting the data identifier.

具体地,业务前端向互联网医院平台发送具有用户标识、存储时效标识的第二数据存储请求,互联网医院平台的医生主数据服务根据存储时效标识,调用文件服务,记录接收到第二数据存储请求的接收时间,根据存储时效标识中的有效时间,判断接收时间是否在有效时间之前。如果接收时间在有效时间之前,说明该存储时效标识未过期,允许业务前端访问,互联网医院平台将保存到第一数据库的文件以图片缩略图的形式返回给业务前端,另外从Redis存储的存储时效标识和数据标识的映射关系中查找与存储时效标识对应的文件的数据标识,对数据标识进行加密处理后,将加密的数据标识与用户标识进行关联并通过互联网医院平台的医生主数据服务保存到MySQL,完成医生文件数据的存储。Specifically, the business front-end sends a second data storage request with a user ID and a storage timeliness ID to the Internet hospital platform, and the doctor master data service of the Internet hospital platform invokes the file service according to the storage timeliness ID, and records the time when the second data storage request is received. The receiving time is to determine whether the receiving time is before the valid time according to the valid time stored in the aging identifier. If the receiving time is before the valid time, it means that the storage timeliness mark has not expired, and the business front-end is allowed to access. The Internet hospital platform will return the files saved in the first database to the business front-end in the form of picture thumbnails. In addition, the storage timeliness stored from Redis Find the data identifier of the file corresponding to the storage time-sensitive identifier in the mapping relationship between the identifier and the data identifier, and after encrypting the data identifier, associate the encrypted data identifier with the user identifier and save it to MySQL, to complete the storage of doctor file data.

医生主数据服务对应的数据库MySQL的具体数据结构示例见下表1。其中医生姓名、生日、性别、头像链接这类数据量较小的信息直直接保存到MySQL,对于医生资质证书文件需要通过文件服务保存到文件系统,MySQL仅保存医生资质证书文件的数据标识,这样既保证了数据的安全,又优化了平台的数据存储结构,更利于效率的提升。The specific data structure example of the database MySQL corresponding to the doctor master data service is shown in Table 1 below. Among them, information such as doctor's name, birthday, gender, and avatar link with a small amount of data is directly saved in MySQL. For the doctor's qualification certificate file, it needs to be saved to the file system through the file service. MySQL only saves the data identification of the doctor's qualification certificate file. It not only ensures the security of data, but also optimizes the data storage structure of the platform, which is more conducive to the improvement of efficiency.

表1:Table 1:

字段定义field definition 数据类型type of data 字段描述field description doctorNamedoctorName StringString 医生姓名doctor name doctorBrithdaydoctor Brithday Datedate 医生生日doctor birthday doctorSexdoctorSex IntegerInteger 医生性别doctor sex doctorHeadUrldoctorHeadUrl StringString 医生头像链接Doctor Avatar Link doctorCertificateKeydoctorCertificateKey StringString 医生资质证书文件的数据标识Data identification of doctor qualification certificate file

图3是本发明实施例的数据存储的方法的整体流程示意图。医生在业务前端进行文件数据的上传操作,向互联网医院平台发出文件数据的存储请求;互联网医院平台的文件服务接收到来自业务前端的文件数据存储请求,对文件数据进行加密处理后,保存到第一数据库文件系统;文件服务根据文件系统返回的与文件数据对应的数据标识设定有效时间生成存储时效标识,建立存储时效标识和数据标识的映射关系,保存到Redis,并把存储时效标识返回给业务前端。业务前端向互联网医院平台发送包括用户标识、存储时效标识的第二数据存储请求,互联网医院平台的医生主数据服务根据存储时效标识,调用文件服务来对存储时效标识进行过期判断;如果已过期,则向业务前端的发出存储失败,需要重新上传的消息;如果未过期,从Redis存储的存储时效标识和数据标识的映射关系中查找与存储时效标识对应的文件的数据标识,将得到的数据标识与用户标识进行关联并保存到MySQL,完成数据存储。FIG. 3 is a schematic flowchart of the overall data storage method according to the embodiment of the present invention. The doctor uploads the file data at the business front end, and sends a file data storage request to the Internet hospital platform; the file service of the Internet hospital platform receives the file data storage request from the business front end, encrypts the file data, and saves it to the A database file system; the file service sets the effective time according to the data identifier corresponding to the file data returned by the file system to generate a storage aging identifier, establishes a mapping relationship between the storage aging identifier and the data identifier, saves it to Redis, and returns the storage aging identifier to Business front. The business front-end sends the second data storage request including the user ID and the storage aging ID to the Internet hospital platform, and the doctor master data service of the Internet hospital platform calls the file service to judge the expiration of the storage aging ID according to the storage aging ID; if it has expired, Then send a message to the business front-end that the storage has failed and needs to be re-uploaded; if it has not expired, search for the data identifier of the file corresponding to the storage expiration identifier from the mapping relationship between the storage expiration identifier and the data identifier stored in Redis, and obtain the data identifier Associate with the user ID and save it to MySQL to complete data storage.

通过上述用户权限校验、个人信息加密处理以及文件的数据标识的映射与时效控制,最大程度上保证了个人信息的安全性,维护了个人隐私,保障了平台数据信息的安全。Through the above-mentioned user authority verification, personal information encryption processing, and file data identification mapping and timeliness control, the security of personal information is guaranteed to the greatest extent, personal privacy is maintained, and the security of platform data information is guaranteed.

图4是根据本发明实施例的数据查询的方法的主要流程的示意图,如图4所示,本发明实施例的数据存储的方法包括如下的步骤S401至步骤S402。FIG. 4 is a schematic diagram of a main flow of a data query method according to an embodiment of the present invention. As shown in FIG. 4 , the data storage method of the embodiment of the present invention includes the following steps S401 to S402.

步骤S401、响应于接收到业务前端发来的第一数据查询请求,根据所述第一数据查询请求中的用户标识,从第二数据库中查找与所述用户标识对应的数据标识,并根据所述数据标识生成查询时效标识,将所述查询时效标识发送给所述业务前端。Step S401, in response to receiving the first data query request sent by the service front end, according to the user ID in the first data query request, look up the data ID corresponding to the user ID from the second database, and according to the The data identifier generates a query timeliness identifier, and sends the query timeliness identifier to the service front end.

根据本发明的一个实施例,根据所述第一数据查询请求中的用户标识,从第二数据库中查找与所述用户标识对应的数据标识,包括:根据所述第一数据查询请求中的用户标识,从第二数据库中查找与所述用户标识对应的加密数据标识;对所述加密数据标识进行解密以得到所述数据标识。According to an embodiment of the present invention, searching the second database for the data identifier corresponding to the user identifier according to the user identifier in the first data query request includes: according to the user identifier in the first data query request An identifier, searching the second database for an encrypted data identifier corresponding to the user identifier; decrypting the encrypted data identifier to obtain the data identifier.

根据本发明的另一个实施例,所述查询时效标识与所述数据标识具有映射关系;在根据所述数据标识生成查询时效标识之后,还包括:建立并存储所述数据标识和所述查询时效标识的映射关系。According to another embodiment of the present invention, the query aging identifier has a mapping relationship with the data identifier; after generating the query aging identifier according to the data identifier, it further includes: establishing and storing the data identifier and the query aging Identified mapping relationship.

具体地,在用户通过业务前端向互联网医院平台发送第一数据查询请求后,互联网医院平台对用户访问权限进行校验,在校验通过后,根据第一数据查询请求中的用户标识,从互联网医院平台的医生主数据服务对应的MySQL数据库中的加密数据标识和用户标识的关联关系中获取加密的数据标识;加密的数据标识通过互联网医院平台的文件服务对其进行解密处理得到数据标识,根据数据标识生成查询时效标识。互联网医院平台的文件服务建立数据标识和查询时效标识之间的映射关系,存储在Redis数据库中,再将查询时效标识发送给业务前端。Specifically, after the user sends the first data query request to the Internet hospital platform through the business front end, the Internet hospital platform verifies the user's access authority, and after the verification is passed, according to the user ID in the first data query request, the The encrypted data identifier is obtained from the relationship between the encrypted data identifier and the user identifier in the MySQL database corresponding to the doctor master data service of the hospital platform; the encrypted data identifier is decrypted by the file service of the Internet hospital platform to obtain the data identifier, according to The data identifier generates the query aging identifier. The file service of the Internet hospital platform establishes the mapping relationship between the data identifier and the query aging identifier, stores it in the Redis database, and then sends the query aging identifier to the business front end.

步骤S402、响应于接收到所述业务前端发来的含有所述查询时效标识的第二数据查询请求,在所述查询时效标识未过期的情况下,根据所述查询时效标识从第一数据库中获取数据。Step S402, in response to receiving the second data query request containing the query timeliness identifier sent by the service front end, in the case that the query timeliness identifier has not expired, from the first database according to the query timeliness identifier retrieve data.

根据本发明的一个实施例,所述查询时效标识具有有效时间,在所述查询时效标识未过期的情况下,根据所述查询时效标识从第一数据库中获取数据,包括:记录接收到所述第二数据查询请求的接收时间,并从所述第二数据查询请求中获取所述查询时效标识;根据所述查询时效标识的有效时间和所述接收时间判断所述查询时效标识是否过期;在所述接收时间位于所述查询时效标识的有效时间之前的情况下,判定所述查询时效标识未过期,根据所述查询时效标识,从存储的所述查询时效标识和所述数据标识的映射关系中,得到所述数据标识;根据所述数据标识从第一数据库中获取所述数据。According to an embodiment of the present invention, the query timeliness ID has a valid time, and in the case that the query timeliness ID has not expired, obtaining data from the first database according to the query timeliness ID includes: recording the receipt of the The receiving time of the second data query request, and obtaining the query aging identifier from the second data query request; judging whether the query aging identifier has expired according to the valid time of the query aging identifier and the receiving time; When the receiving time is before the effective time of the query timeliness ID, it is determined that the query timeliness ID has not expired, and according to the query timeliness ID, from the stored mapping relationship between the query timeliness ID and the data ID In the process, the data identifier is obtained; and the data is acquired from the first database according to the data identifier.

根据本发明的另一个实施例,根据所述查询时效标识从第一数据库中获取数据,包括:根据所述查询时效标识从第一数据库中获取加密数据;对所述加密数据进行解密以得到所述数据。According to another embodiment of the present invention, obtaining data from the first database according to the query aging identifier includes: acquiring encrypted data from the first database according to the query aging identifier; decrypting the encrypted data to obtain the the above data.

具体地,业务前端向互联网医院平台发送具有查询时效标识的第二数据查询请求,互联网医院平台的文件服务记录接收到第二数据查询请求的接收时间,根据查询时效标识中的有效时间,判断接收时间是否在有效时间之前。如果接收时间在有效时间之前,说明该查询时效标识未过期,允许业务前端访问,从Redis存储的查询时效标识和数据标识的映射关系中查找与查询时效标识对应的数据标识,根据数据标识从文件系统中获取加密的文件数据,由互联网医院平台的文件服务对其进行解密得到文件数据,最后将文件数据返回给业务前端,完成文件数据的查询。Specifically, the business front-end sends a second data query request with a query timeliness identifier to the Internet hospital platform, and the file service of the Internet hospital platform records the receiving time of the second data query request, and judges the receipt according to the valid time in the query timeliness identifier. Whether the time is before the effective time. If the receiving time is before the effective time, it means that the query timeliness ID has not expired, and the business front-end is allowed to access it. Find the data ID corresponding to the query timeliness ID from the mapping relationship between the query timeliness ID and the data ID stored in Redis, and use the data ID from the file The encrypted file data is obtained in the system, and the file service of the Internet hospital platform decrypts it to obtain the file data, and finally returns the file data to the business front end to complete the query of the file data.

图5是本发明实施例的文件数据查询的方法的整体流程的示意图。医生用户通过业务前端向互联网医院平台发送第一数据查询请求;互联网医院平台的医生主数据服务根据第一数据查询请求中的用户标识,从第二数据库MySQL中获取对应的数据标识;互联网医院平台的文件服务根据数据标识生成对应的查询时效标识并设置有效时间,建立数据标识和查询时效标识的映射关系,并保存到Redis,再将查询时效标识通过参数替换进行组装后返回给业务前端;业务前端根据接收到的查询时效标识向互联网医院平台发送第二数据查询请求;文件服务记录接收时间,根据查询时效标识中的有效时间判断接收到的时效标识是否过期;如果已过期向业务前端返回文件不可访问的消息;如果未过期,根据Redis中的数据标识和查询时效标识的映射关系得到数据标识,根据数据标识从第一数据库文件系统中加载加密的文件数据;最后对加密的文件数据进行解密,得到文件并展示给业务前端。FIG. 5 is a schematic diagram of an overall flow of a method for querying file data according to an embodiment of the present invention. The doctor user sends the first data query request to the Internet hospital platform through the business front end; the doctor master data service of the Internet hospital platform obtains the corresponding data identification from the second database MySQL according to the user identification in the first data query request; the Internet hospital platform The file service generates the corresponding query aging identifier based on the data identifier and sets the valid time, establishes the mapping relationship between the data identifier and the query aging identifier, and saves it to Redis, then assembles the query aging identifier through parameter replacement and returns it to the front end of the business; business The front end sends a second data query request to the Internet hospital platform according to the received query timeliness; the file service records the receiving time, and judges whether the received timeliness has expired according to the valid time in the query timeliness; if it has expired, return the file to the business front end Inaccessible message; if it has not expired, obtain the data identifier according to the mapping relationship between the data identifier in Redis and the query aging identifier, and load the encrypted file data from the first database file system according to the data identifier; finally decrypt the encrypted file data , get the file and show it to the business front end.

图6是本发明实施例的数据存储和数据查询的方法的整体架构示意图。医生APP和医生资质审核平台属于业务前端,医生主数据服务和文件服务属于互联网医院平台的后端服务。医生APP支持医生用户的个人信息录入,上传,查询,以及个人身份信息的解密处理。医生资质审核平台支持运营人员查询医生的个人信息,包括个人身份信息和资质文件。医生主数据服务支持用户访问权限的校验,医生个人身份信息的加密存储,根据存储时效标识或者查询时效标识从文件服务中获取对应的数据标识,以及将获取的数据标识存储到第二数据库MySQL。文件服务支持根据数据标识生成存储时效标识或者查询时效标识,建立并存储数据标识和存储时效标识的映射关系,以及数据标识和查询时效标识的映射关系,文件数据的加密和解密处理。Fig. 6 is a schematic diagram of the overall architecture of the method for data storage and data query according to the embodiment of the present invention. The doctor APP and the doctor qualification review platform belong to the front-end business, and the doctor master data service and file service belong to the back-end service of the Internet hospital platform. The doctor APP supports the personal information entry, upload, query, and decryption of personal identity information for doctor users. The doctor qualification review platform supports operators to query doctors' personal information, including personal identity information and qualification documents. The doctor master data service supports verification of user access rights, encrypted storage of doctors' personal identity information, obtaining corresponding data identifiers from file services according to storage aging identifiers or query aging identifiers, and storing the obtained data identifiers in the second database MySQL . The file service supports generating storage or query aging identifiers based on data identifiers, establishing and storing the mapping relationship between data identifiers and storage aging identifiers, as well as the mapping relationship between data identifiers and query aging identifiers, and encrypting and decrypting file data.

对于数据存储,医生用户通过医生APP进行个人信息录入,并将资质文件上传提交到互联网医院平台的文件服务(图中①);文件服务调用医生主数据服务中的访问权限校验对用户权限进行校验,在校验通过后,对资质文件进行加密处理后,保存到第一数据库文件系统中;根据文件系统返回的与资质文件对应的数据标识生成存储时效标识,建立并存储数据标识和存储时效标识的映射关系;再将存储时效标识返回给业务前端医生APP(图中②);医生APP向医生主数据服务发送包括医生个人身份信息和存储时效标识的第二数据存储请求(图中③),医生主数据服务将个人身份信息加密存储,根据存储时效标识,调用文件服务判断存储时效标识的时效,在存储时效标识未过期的情况下,将存储时效标识对应的数据标识返回给医生主数据服务,医生主数据服务将获得的数据标识存储到第二数据库MySQL。For data storage, the doctor user enters personal information through the doctor APP, and uploads the qualification file to the file service of the Internet hospital platform (① in the figure); Verification, after the verification is passed, the qualification file is encrypted and stored in the first database file system; the storage aging identifier is generated according to the data identifier corresponding to the qualification file returned by the file system, and the data identifier and storage are established and stored. The mapping relationship of the aging identifier; then return the stored aging identifier to the front-end doctor APP (② in the figure); the doctor APP sends a second data storage request including the doctor’s personal identity information and the stored aging identifier to the doctor’s master data service (③ in the figure ), the doctor master data service encrypts and stores the personal identity information, calls the file service to judge the timeliness of the storage timeliness according to the storage timeliness mark, and returns the data mark corresponding to the storage timeliness mark to the doctor master In the data service, the doctor master data service stores the obtained data identification in the second database MySQL.

对于数据查询,医生通过医生APP或者运营人员通过医生资源审核平台向互联网医院平台的医生主数据服务发送第一数据查询请求(图中④或者⑥);在访问权限校验通过的情况下,从第二数据库MySQL中获取待查询文件的数据标识;文件服务根据数据标识生成查询时效标识,建立并存储数据标识和查询时效标识的映射关系;医生通过医生APP或者运营人员通过医生资源审核平台向互联网医院平台的文件服务发送第二数据查询请求(图中⑤或者⑦),在查询时效标识未过期的情况下,根据查询时效标识,从第一数据库文件系统中获取加密的文件数据;文件服务对加密的文件数据进行解密,得到文件数据,返回给业务前端。For data query, the doctor sends the first data query request (④ or ⑥ in the figure) to the doctor master data service of the Internet hospital platform through the doctor APP or the operator through the doctor resource review platform; The data identification of the file to be queried is obtained in the second database MySQL; the file service generates the query timeliness label according to the data label, and establishes and stores the mapping relationship between the data label and the query timeliness label; the doctor uses the doctor APP or the operator through the doctor resource review platform to send data to the Internet The file service of the hospital platform sends the second data query request (⑤ or ⑦ in the figure), and if the query timeliness mark has not expired, the encrypted file data is obtained from the first database file system according to the query timeliness mark; The encrypted file data is decrypted, the file data is obtained, and returned to the business front end.

通过本发明实施例基于时效标识的数据存储和数据查询,有效提升了数据的安全性,维护了个人隐私,保障了平台数据信息的安全。Through the data storage and data query based on the aging label in the embodiment of the present invention, the security of data is effectively improved, personal privacy is maintained, and the security of platform data information is guaranteed.

图7是根据本发明实施例的数据存储的装置的主要模块示意图。如图7所示,数据存储的装置700主要包括第一数据存储模块701和第二数据存储模块702。Fig. 7 is a schematic diagram of main modules of a data storage device according to an embodiment of the present invention. As shown in FIG. 7 , the data storage device 700 mainly includes a first data storage module 701 and a second data storage module 702 .

第一数据存储模块701,用于响应于接收到业务前端发来的第一数据存储请求,将待存储数据保存到第一数据库,并根据所述待存储数据的数据标识生成存储时效标识,将所述存储时效标识发送给所述业务前端;The first data storage module 701 is configured to store the data to be stored in the first database in response to receiving the first data storage request sent by the service front end, and generate a storage timeliness identifier according to the data identifier of the data to be stored, and store The storage aging identifier is sent to the service front end;

第二数据存储模块702,用于响应于接收到所述业务前端发来的含有所述存储时效标识的第二数据存储请求,在所述存储时效标识未过期的情况下,将所述数据标识保存到第二数据库。The second data storage module 702 is configured to, in response to receiving a second data storage request containing the storage timeliness identifier sent by the service front end, store the data identifier in the case that the storage timeliness has not expired. Save to the second database.

根据本发明的一个实施例,所述数据存储的装置700还可以包括加密模块(图中未示出),用于:在将待存储数据保存到第一数据库之前,对所述待存储数据进行加密处理;以及在将所述数据标识保存到第二数据库之前,对所述数据标识进行加密处理。According to an embodiment of the present invention, the data storage device 700 may also include an encryption module (not shown in the figure), configured to: perform encryption on the data to be stored before saving the data to be stored in the first database encryption processing; and performing encryption processing on the data identifier before storing the data identifier in the second database.

根据本发明的另一个实施例,所述数据存储的装置700还可以包括映射关系模块(图中未示出),用于:在根据所述待存储数据的数据标识生成存储时效标识之后,建立并存储所述存储时效标识和所述数据标识的映射关系;以及在将所述数据标识保存到第二数据库之前,根据所述存储时效标识,从存储的所述存储时效标识和所述数据标识的映射关系中查找与所述存储时效标识对应的所述数据标识。According to another embodiment of the present invention, the data storage device 700 may also include a mapping relationship module (not shown in the figure), configured to: after generating a storage timeliness identifier according to the data identifier of the data to be stored, establish And storing the mapping relationship between the storage timeliness identifier and the data identifier; and before saving the data identifier into the second database, according to the storage timeliness identifier, from the stored storage timeliness identifier and the data identifier Find the data identifier corresponding to the storage aging identifier in the mapping relationship.

根据本发明的再一个实施例,所述第二数据存储请求包括用户标识,所述存储时效标识具有有效时间;所述第二数据存储模块702,还可以用于:记录接收到所述第二数据存储请求的接收时间,并从所述第二数据存储请求中获取所述存储时效标识;根据所述存储时效标识的有效时间和所述接收时间判断所述存储时效标识是否过期;在所述接收时间位于所述存储时效标识的有效时间之前的情况下,判定所述存储时效标识未过期,将所述数据标识和所述用户标识关联保存到所述第二数据库。According to yet another embodiment of the present invention, the second data storage request includes a user identifier, and the storage aging identifier has a valid time; the second data storage module 702 can also be used to: record the receipt of the second The receiving time of the data storage request, and obtaining the storage aging identifier from the second data storage request; judging whether the storage aging identifier has expired according to the valid time of the storage aging identifier and the receiving time; in the If the receiving time is before the valid time of the stored aging identifier, it is determined that the stored aging identifier has not expired, and the data identifier and the user identifier are associated and stored in the second database.

根据本发明的又一个实施例,所述数据存储的装置700还可以包括权限校验模块(图中未示出),用于:在接收到业务前端发来的第一数据存储请求之前,响应于所述业务前端发来的注册请求,为用户分配访问权限,所述访问权限用于响应于接收到业务前端发来的第一数据存储请求,根据所述访问权限对用户进行权限校验。According to yet another embodiment of the present invention, the data storage device 700 may also include a permission verification module (not shown in the figure), configured to: before receiving the first data storage request from the service front end, respond to Assigning access rights to the user based on the registration request sent by the service front end, and the access rights are used to perform permission verification on the user according to the access rights in response to receiving the first data storage request sent by the service front end.

图8是根据本发明实施例的数据查询的装置的主要模块示意图。如图8所示,数据查询的装置800主要包括第一数据查询模块801和第二数据查询模块802。Fig. 8 is a schematic diagram of main modules of a device for data query according to an embodiment of the present invention. As shown in FIG. 8 , the data query device 800 mainly includes a first data query module 801 and a second data query module 802 .

第一数据查询模块801,用于响应于接收到业务前端发来的第一数据查询请求,根据所述第一数据查询请求中的用户标识,从第二数据库中查找与所述用户标识对应的数据标识,并根据所述数据标识生成查询时效标识,将所述查询时效标识发送给所述业务前端;The first data query module 801 is configured to, in response to receiving the first data query request sent by the service front end, search for the user ID corresponding to the user ID from the second database according to the user ID in the first data query request A data identifier, and generate a query timeliness identifier according to the data identifier, and send the query timeliness identifier to the service front end;

第二数据查询模块802,用于响应于接收到所述业务前端发来的含有所述查询时效标识的第二数据查询请求,在所述查询时效标识未过期的情况下,根据所述查询时效标识从第一数据库中获取数据。The second data query module 802 is configured to, in response to receiving the second data query request containing the query timeliness identifier sent by the service front end, in the case that the query timeliness identifier has not expired, according to the query timeliness Identifies that the data is acquired from the first database.

根据本发明的一个实施例,所述第一数据查询模块801,还可以用于:根据所述第一数据查询请求中的用户标识,从第二数据库中查找与所述用户标识对应的加密数据标识;对所述加密数据标识进行解密以得到所述数据标识;所述第二数据查询模块802,还可以用于:根据所述查询时效标识从第一数据库中获取加密数据;对所述加密数据进行解密以得到所述数据。According to an embodiment of the present invention, the first data query module 801 may also be configured to: search the encrypted data corresponding to the user ID from the second database according to the user ID in the first data query request identification; decrypt the encrypted data identification to obtain the data identification; the second data query module 802 can also be used to: obtain encrypted data from the first database according to the query timeliness identification; The data is decrypted to obtain said data.

根据本发明的另一个实施例,所述查询时效标识具有有效时间,所述查询时效标识与所述数据标识具有映射关系;所述数据查询的装置800还可以包括映射关系模块(图中未示出),用于:在根据所述数据标识生成查询时效标识之后,建立并存储所述数据标识和所述查询时效标识的映射关系;所述第二数据查询模块802,还可以用于:记录接收到所述第二数据查询请求的接收时间,并从所述第二数据查询请求中获取所述查询时效标识;根据所述查询时效标识的有效时间和所述接收时间判断所述查询时效标识是否过期;在所述接收时间位于所述查询时效标识的有效时间之前的情况下,判定所述查询时效标识未过期,根据所述查询时效标识,从存储的所述查询时效标识和所述数据标识的映射关系中,得到所述数据标识;根据所述数据标识从第一数据库中获取所述数据。According to another embodiment of the present invention, the query aging identifier has a valid time, and the query aging identifier has a mapping relationship with the data identifier; the data query device 800 may also include a mapping relationship module (not shown in the figure out), used to: after generating the query timeliness identifier according to the data identifier, establish and store the mapping relationship between the data identifier and the query timeliness identifier; the second data query module 802 can also be used to: record receiving the receiving time of the second data query request, and obtaining the query aging identifier from the second data query request; judging the query aging identifier according to the valid time of the query aging identifier and the receiving time expired; in the case that the receiving time is before the effective time of the query aging identifier, it is determined that the query aging identifier has not expired, and according to the query aging identifier, from the stored query aging identifier and the data In the mapping relationship of the identification, the data identification is obtained; and the data is obtained from the first database according to the data identification.

图9是本发明实施例可以应用于其中的示例性系统架构图。Fig. 9 is an exemplary system architecture diagram to which the embodiment of the present invention can be applied.

如图9所示,系统架构900可以包括终端设备901、902、903,网络904和服务器905。网络904用以在终端设备901、902、903和服务器905之间提供通信链路的介质。网络904可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 9 , a system architecture 900 may include terminal devices 901 , 902 , and 903 , a network 904 and a server 905 . The network 904 is used as a medium for providing communication links between the terminal devices 901 , 902 , 903 and the server 905 . Network 904 may include various connection types, such as wires, wireless communication links, or fiber optic cables, among others.

用户可以使用终端设备901、902、903通过网络904与服务器905交互,以接收或发送消息等。终端设备901、902、903上可以安装有各种通讯客户端应用,例如数据查询应用、数据存储应用等(仅为示例)。Users can use terminal devices 901, 902, 903 to interact with server 905 through network 904 to receive or send messages and the like. Various communication client applications may be installed on the terminal devices 901, 902, and 903, such as data query applications, data storage applications, etc. (just examples).

终端设备901、902、903可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。The terminal devices 901, 902, and 903 may be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

服务器905可以是提供各种服务的服务器,例如对用户利用终端设备901、902、903所进行的数据存储和数据查询提供支持的后台管理服务器(仅为示例)。后台管理服务器可以响应于接收到业务前端发来的第一数据存储请求,将待存储数据保存到第一数据库,并根据所述待存储数据的数据标识生成存储时效标识,将所述存储时效标识发送给所述业务前端;响应于接收到所述业务前端发来的含有所述存储时效标识的第二数据存储请求,在所述存储时效标识未过期的情况下,将所述数据标识保存到第二数据库等处理,并将处理结果(例如存储结果等--仅为示例)反馈给终端设备。The server 905 may be a server that provides various services, such as a background management server that provides support for data storage and data query performed by users using the terminal devices 901 , 902 , and 903 (just an example). The background management server may store the data to be stored in the first database in response to receiving the first data storage request sent by the business front end, and generate a storage aging identifier according to the data identifier of the data to be stored, and store the storage aging identifier Send it to the service front end; in response to receiving the second data storage request containing the storage timeliness identifier from the service frontend, if the storage timeliness identifier has not expired, save the data identifier to The second database and the like process, and feed back the processing results (for example, storage results, etc.—just an example) to the terminal device.

需要说明的是,本发明实施例所提供的数据存储和数据查询的方法一般由服务器905执行,相应地,数据存储和数据查询的装置一般设置于服务器905中。It should be noted that the data storage and data query methods provided by the embodiments of the present invention are generally executed by the server 905 , and correspondingly, the data storage and data query devices are generally set in the server 905 .

应该理解,图9中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the numbers of terminal devices, networks and servers in FIG. 9 are only illustrative. According to the implementation needs, there can be any number of terminal devices, networks and servers.

下面参考图10,其示出了适于用来实现本发明实施例的终端设备或服务器的计算机系统1000的结构示意图。图10示出的终端设备或服务器仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。Referring now to FIG. 10 , it shows a schematic structural diagram of a computer system 1000 suitable for implementing a terminal device or a server according to an embodiment of the present invention. The terminal device or server shown in FIG. 10 is just an example, and should not limit the functions and application scope of this embodiment of the present invention.

如图10所示,计算机系统1000包括中央处理单元(CPU)1001,其可以根据存储在只读存储器(ROM)1002中的程序或者从存储部分1008加载到随机访问存储器(RAM)1003中的程序而执行各种适当的动作和处理。在RAM 1003中,还存储有系统1000操作所需的各种程序和数据。CPU1001、ROM 1002以及RAM 1003通过总线1004彼此相连。输入/输出(I/O)接口1005也连接至总线1004。As shown in FIG. 10 , a computer system 1000 includes a central processing unit (CPU) 1001, which can operate according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage section 1008 into a random-access memory (RAM) 1003 Instead, various appropriate actions and processes are performed. In the RAM 1003, various programs and data necessary for the operation of the system 1000 are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other via a bus 1004. An input/output (I/O) interface 1005 is also connected to the bus 1004 .

以下部件连接至I/O接口1005:包括键盘、鼠标等的输入部分1006;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分1007;包括硬盘等的存储部分1008;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分1009。通信部分1009经由诸如因特网的网络执行通信处理。驱动器1010也根据需要连接至I/O接口1005。可拆卸介质1011,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1010上,以便于从其上读出的计算机程序根据需要被安装入存储部分1008。The following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 1008 including a hard disk, etc. and a communication section 1009 including a network interface card such as a LAN card, a modem, or the like. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I/O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 1010 as necessary so that a computer program read therefrom is installed into the storage section 1008 as necessary.

特别地,根据本发明公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本发明公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分1009从网络上被下载和安装,和/或从可拆卸介质1011被安装。在该计算机程序被中央处理单元(CPU)1001执行时,执行本发明的系统中限定的上述功能。In particular, according to the disclosed embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the disclosed embodiments of the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication portion 1009 and/or installed from removable media 1011 . When this computer program is executed by a central processing unit (CPU) 1001, the above-described functions defined in the system of the present invention are performed.

需要说明的是,本发明所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是所述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者所述的任意合适的组合。在本发明中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本发明中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或所述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者所述的任意合适的组合。It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the described. In the present invention, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, in which computer-readable program codes are carried. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the described. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. . Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the described.

附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,所述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logic devices for implementing the specified Executable instructions for a function. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block in the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a A combination of dedicated hardware and computer instructions.

描述于本发明实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括:第一数据存储模块和第二数据存储模块。The units involved in the description in the embodiments of the present invention may be implemented by means of software or by means of hardware. The described unit may also be set in a processor, for example, it may be described as: a processor includes: a first data storage module and a second data storage module.

其中,这些模块的名称在某种情况下并不构成对该模块本身的限定,例如,第一数据存储模块还可以被描述为“用于响应于接收到业务前端发来的第一数据存储请求,将待存储数据保存到第一数据库,并根据所述待存储数据的数据标识生成存储时效标识,将所述存储时效标识发送给所述业务前端的模块”。Among them, the names of these modules do not constitute a limitation on the module itself under certain circumstances. For example, the first data storage module can also be described as "responsive to receiving the first data storage request from the front end of the business. , saving the data to be stored in the first database, generating a storage timeliness identifier according to the data identifier of the data to be stored, and sending the storage timeliness identifier to the front-end module of the service”.

另一方面,本发明还提供了一种计算机可读介质,该计算机可读介质可以是所述实施例中描述的设备中所包含的;也可以是单独存在,而未装配入该设备中。所述计算机可读介质承载有一个或者多个程序,当所述一个或者多个程序被一个该设备执行时,使得该设备包括:响应于接收到业务前端发来的第一数据存储请求,将待存储数据保存到第一数据库,并根据所述待存储数据的数据标识生成存储时效标识,将所述存储时效标识发送给所述业务前端;响应于接收到所述业务前端发来的含有所述存储时效标识的第二数据存储请求,在所述存储时效标识未过期的情况下,将所述数据标识保存到第二数据库。On the other hand, the present invention also provides a computer-readable medium. The computer-readable medium may be included in the device described in the embodiments, or it may exist independently without being assembled into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device includes: in response to receiving the first data storage request sent by the service front end, storing the saving the data to be stored in the first database, generating a storage aging identifier according to the data identifier of the data to be stored, and sending the storage aging identifier to the service front end; The second data storage request for storing the timeliness identifier, if the storage timeliness indicator has not expired, save the data identifier to the second database.

根据本发明实施例的技术方案,具有如下优点或有益效果:通过响应于接收到业务前端发来的第一数据存储请求,将待存储数据保存到第一数据库,并根据待存储数据的数据标识生成存储时效标识,将存储时效标识发送给业务前端;响应于接收到业务前端发来的含有存储时效标识的第二数据存储请求,在存储时效标识未过期的情况下,将数据标识保存到第二数据库的技术方案,实现了在对数据进行存储时,根据待存储数据的数据标识生成存储时效标识,在存储时效标识未过期的情况下完成数据存储,基于时效标识的数据存储,有效提升了数据的安全性,维护了个人隐私,保障了平台数据信息的安全。另外,本发明通过响应于接收到业务前端发来的第一数据查询请求,根据第一数据查询请求中的用户标识,从第二数据库中查找与用户标识对应的数据标识,并根据数据标识生成查询时效标识,将查询时效标识发送给业务前端;响应于接收到业务前端发来的含有查询时效标识的第二数据查询请求,在查询时效标识未过期的情况下,根据查询时效标识从第一数据库中获取数据的技术方案,在对数据进行查询时,根据用户标识获取数据标识,以生成查询时效标识,在查询时效标识未过期的情况下获取待查询数据,基于时效标识进行数据查询,有效提升了数据的安全性,维护了个人隐私,保障了平台数据信息的安全。According to the technical solution of the embodiment of the present invention, it has the following advantages or beneficial effects: in response to receiving the first data storage request sent by the service front end, the data to be stored is stored in the first database, and according to the data identification of the data to be stored Generate a storage aging identifier, and send the storage aging identifier to the business front end; in response to receiving the second data storage request containing the storage aging identifier sent by the business front end, if the storage aging identifier has not expired, save the data identifier to the first The technical solution of the second database realizes that when storing data, a storage aging identifier is generated according to the data identifier of the data to be stored, and the data storage is completed when the storage aging identifier has not expired. The data storage based on the aging identifier effectively improves the Data security maintains personal privacy and ensures the security of platform data information. In addition, the present invention searches the second database for the data identifier corresponding to the user identifier according to the user identifier in the first data query request in response to receiving the first data query request sent by the service front end, and generates Query the timeliness identifier, and send the query timeliness identifier to the service front end; in response to receiving the second data query request containing the query timeliness identifier sent by the business front end, in the case that the query timeliness identifier has not expired, according to the query timeliness identifier from the first The technical solution for obtaining data in the database, when querying data, obtains the data identifier according to the user identifier to generate the query aging identifier, obtains the data to be queried when the query aging identifier has not expired, and performs data query based on the aging identifier, which is effective Improve data security, maintain personal privacy, and ensure the security of platform data information.

所述具体实施方式,并不构成对本发明保护范围的限制。本领域技术人员应该明白的是,取决于设计要求和其他因素,可以发生各种各样的修改、组合、子组合和替代。任何在本发明的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明保护范围之内。The specific implementation methods are not intended to limit the protection scope of the present invention. It should be apparent to those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (12)

1.一种数据存储的方法,其特征在于,包括:1. A method for data storage, comprising: 响应于接收到业务前端发来的第一数据存储请求,将待存储数据保存到第一数据库,并根据所述待存储数据的数据标识生成存储时效标识,将所述存储时效标识发送给所述业务前端;In response to receiving the first data storage request from the service front end, save the data to be stored in the first database, generate a storage timeliness identifier according to the data identifier of the data to be stored, and send the storage timeliness identifier to the business front end; 响应于接收到所述业务前端发来的含有所述存储时效标识的第二数据存储请求,在所述存储时效标识未过期的情况下,将所述数据标识保存到第二数据库。In response to receiving a second data storage request from the service front end that includes the storage timeliness identifier, if the storage timeliness identifier has not expired, save the data identifier to the second database. 2.根据权利要求1所述的方法,其特征在于,在将待存储数据保存到第一数据库之前,还包括:2. The method according to claim 1, further comprising: before storing the data to be stored in the first database: 对所述待存储数据进行加密处理;Encrypting the data to be stored; 在将所述数据标识保存到第二数据库之前,还包括:Before saving the data identifier into the second database, it also includes: 对所述数据标识进行加密处理。Perform encryption processing on the data identifier. 3.根据权利要求1所述的方法,其特征在于,在根据所述待存储数据的数据标识生成存储时效标识之后,还包括:3. The method according to claim 1, further comprising: after generating the storage aging identifier according to the data identifier of the data to be stored: 建立并存储所述存储时效标识和所述数据标识的映射关系;Establishing and storing the mapping relationship between the storage timeliness identifier and the data identifier; 在将所述数据标识保存到第二数据库之前,还包括:Before saving the data identifier into the second database, it also includes: 根据所述存储时效标识,从存储的所述存储时效标识和所述数据标识的映射关系中查找与所述存储时效标识对应的所述数据标识。Searching for the data identifier corresponding to the storage expiration identifier from the stored mapping relationship between the storage expiration identifier and the data identifier according to the storage expiration identifier. 4.根据权利要求3所述的方法,其特征在于,所述第二数据存储请求包括用户标识,所述存储时效标识具有有效时间;4. The method according to claim 3, wherein the second data storage request includes a user ID, and the storage aging ID has an effective time; 在所述存储时效标识未过期的情况下,将所述数据标识保存到第二数据库,包括:In the case that the storage timeliness identifier has not expired, saving the data identifier to the second database includes: 记录接收到所述第二数据存储请求的接收时间,并从所述第二数据存储请求中获取所述存储时效标识;Recording the receiving time of receiving the second data storage request, and obtaining the storage aging identifier from the second data storage request; 根据所述存储时效标识的有效时间和所述接收时间判断所述存储时效标识是否过期;judging whether the storage timeliness has expired according to the valid time of the storage timeliness and the receiving time; 在所述接收时间位于所述存储时效标识的有效时间之前的情况下,判定所述存储时效标识未过期,将所述数据标识和所述用户标识关联保存到所述第二数据库。If the receiving time is before the valid time of the stored aging identifier, it is determined that the stored aging identifier has not expired, and the data identifier and the user identifier are associated and stored in the second database. 5.根据权利要求1所述的方法,其特征在于,在接收到业务前端发来的第一数据存储请求之前,还包括:5. The method according to claim 1, characterized in that, before receiving the first data storage request from the service front end, further comprising: 响应于所述业务前端发来的注册请求,为用户分配访问权限,所述访问权限用于响应于接收到业务前端发来的第一数据存储请求,根据所述访问权限对用户进行权限校验。In response to the registration request sent by the service front end, assign access rights to the user, and the access rights are used to verify the user's rights according to the access rights in response to receiving the first data storage request sent by the service front end . 6.一种数据查询的方法,其特征在于,包括:6. A method for data query, comprising: 响应于接收到业务前端发来的第一数据查询请求,根据所述第一数据查询请求中的用户标识,从第二数据库中查找与所述用户标识对应的数据标识,并根据所述数据标识生成查询时效标识,将所述查询时效标识发送给所述业务前端;In response to receiving the first data query request from the service front end, according to the user ID in the first data query request, look up the data ID corresponding to the user ID from the second database, and according to the data ID Generate a query timeliness identifier, and send the query timeliness identifier to the service front end; 响应于接收到所述业务前端发来的含有所述查询时效标识的第二数据查询请求,在所述查询时效标识未过期的情况下,根据所述查询时效标识从第一数据库中获取数据。In response to receiving a second data query request from the service front end that includes the query timeliness identifier, if the query timeliness identifier has not expired, acquire data from the first database according to the query timeliness identifier. 7.根据权利要求6所述的方法,其特征在于,根据所述第一数据查询请求中的用户标识,从第二数据库中查找与所述用户标识对应的数据标识,包括:7. The method according to claim 6, wherein, according to the user identifier in the first data query request, searching the second database for the data identifier corresponding to the user identifier comprises: 根据所述第一数据查询请求中的用户标识,从第二数据库中查找与所述用户标识对应的加密数据标识;Searching for an encrypted data identifier corresponding to the user identifier from the second database according to the user identifier in the first data query request; 对所述加密数据标识进行解密以得到所述数据标识;decrypting the encrypted data identifier to obtain the data identifier; 根据所述查询时效标识从第一数据库中获取数据,包括:Acquiring data from the first database according to the query timeliness identifier, including: 根据所述查询时效标识从第一数据库中获取加密数据;Acquiring encrypted data from the first database according to the query aging identifier; 对所述加密数据进行解密以得到所述数据。The encrypted data is decrypted to obtain the data. 8.根据权利要求6所述的方法,其特征在于,所述查询时效标识具有有效时间,所述查询时效标识与所述数据标识具有映射关系;8. The method according to claim 6, wherein the query aging identifier has a valid time, and the query aging identifier has a mapping relationship with the data identifier; 在根据所述数据标识生成查询时效标识之后,还包括:After generating the query timeliness identifier according to the data identifier, it also includes: 建立并存储所述数据标识和所述查询时效标识的映射关系;Establishing and storing the mapping relationship between the data identifier and the query timeliness identifier; 在所述查询时效标识未过期的情况下,根据所述查询时效标识从第一数据库中获取数据,包括:In the case that the query aging identifier has not expired, acquiring data from the first database according to the query aging identifier includes: 记录接收到所述第二数据查询请求的接收时间,并从所述第二数据查询请求中获取所述查询时效标识;Recording the receiving time of receiving the second data query request, and obtaining the query timeliness identifier from the second data query request; 根据所述查询时效标识的有效时间和所述接收时间判断所述查询时效标识是否过期;judging whether the query timeliness has expired according to the valid time of the query timeliness and the receiving time; 在所述接收时间位于所述查询时效标识的有效时间之前的情况下,判定所述查询时效标识未过期,根据所述查询时效标识,从存储的所述查询时效标识和所述数据标识的映射关系中,得到所述数据标识;In the case where the receiving time is before the effective time of the query aging identifier, it is determined that the query aging identifier has not expired, and according to the query aging identifier, from the stored mapping between the query aging identifier and the data identifier In the relationship, the data identifier is obtained; 根据所述数据标识从第一数据库中获取所述数据。The data is acquired from the first database according to the data identifier. 9.一种数据存储的装置,其特征在于,包括:9. A device for data storage, comprising: 第一数据存储模块,用于响应于接收到业务前端发来的第一数据存储请求,将待存储数据保存到第一数据库,并根据所述待存储数据的数据标识生成存储时效标识,将所述存储时效标识发送给所述业务前端;The first data storage module is configured to save the data to be stored in the first database in response to receiving the first data storage request sent by the service front end, and generate a storage timeliness identifier according to the data identifier of the data to be stored, and store the stored data The storage timeliness identifier is sent to the service front end; 第二数据存储模块,用于响应于接收到所述业务前端发来的含有所述存储时效标识的第二数据存储请求,在所述存储时效标识未过期的情况下,将所述数据标识保存到第二数据库。The second data storage module is configured to save the data identifier when the storage expiration identifier has not expired in response to receiving the second data storage request containing the storage aging identifier sent by the service front end to the second database. 10.一种数据查询的装置,其特征在于,包括:10. A device for data query, characterized in that it comprises: 第一数据查询模块,用于响应于接收到业务前端发来的第一数据查询请求,根据所述第一数据查询请求中的用户标识,从第二数据库中查找与所述用户标识对应的数据标识,并根据所述数据标识生成查询时效标识,将所述查询时效标识发送给所述业务前端;The first data query module is configured to, in response to receiving the first data query request sent by the service front end, search for data corresponding to the user ID from the second database according to the user ID in the first data query request ID, and generate a query timeliness ID according to the data ID, and send the query timeliness ID to the service front end; 第二数据查询模块,用于响应于接收到所述业务前端发来的含有所述查询时效标识的第二数据查询请求,在所述查询时效标识未过期的情况下,根据所述查询时效标识从第一数据库中获取数据。The second data query module is configured to, in response to receiving the second data query request containing the query timeliness identifier sent by the service front end, in the case that the query timeliness identifier has not expired, according to the query timeliness identifier Get data from the first database. 11.一种移动电子设备终端,其特征在于,包括:11. A mobile electronic device terminal, characterized in that it comprises: 一个或多个处理器;one or more processors; 存储装置,用于存储一个或多个程序,storage means for storing one or more programs, 当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-8中任一所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors are made to implement the method according to any one of claims 1-8. 12.一种计算机可读介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1-8中任一所述的方法。12. A computer-readable medium, on which a computer program is stored, wherein, when the program is executed by a processor, the method according to any one of claims 1-8 is realized.
CN202211300523.9A 2022-10-24 2022-10-24 Method and device for data storage and data query Pending CN116028486A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211300523.9A CN116028486A (en) 2022-10-24 2022-10-24 Method and device for data storage and data query

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211300523.9A CN116028486A (en) 2022-10-24 2022-10-24 Method and device for data storage and data query

Publications (1)

Publication Number Publication Date
CN116028486A true CN116028486A (en) 2023-04-28

Family

ID=86071512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211300523.9A Pending CN116028486A (en) 2022-10-24 2022-10-24 Method and device for data storage and data query

Country Status (1)

Country Link
CN (1) CN116028486A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116932847A (en) * 2023-09-15 2023-10-24 江苏海王健康生物科技有限公司 Medical health data management platform operation method and system
CN117172609A (en) * 2023-09-18 2023-12-05 北汽蓝谷信息技术有限公司 Management method and system based on value chain management and business management fusion

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020135612A1 (en) * 2001-01-12 2002-09-26 Siemens Medical Solutions Health Services Corporation System and user interface supporting concurrent application operation and interoperability
CN112560102A (en) * 2020-12-25 2021-03-26 南方电网深圳数字电网研究院有限公司 Resource sharing method, resource accessing method, resource sharing equipment and computer readable storage medium
CN115146302A (en) * 2021-03-31 2022-10-04 北京有竹居网络技术有限公司 File processing method, device, storage medium and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020135612A1 (en) * 2001-01-12 2002-09-26 Siemens Medical Solutions Health Services Corporation System and user interface supporting concurrent application operation and interoperability
CN112560102A (en) * 2020-12-25 2021-03-26 南方电网深圳数字电网研究院有限公司 Resource sharing method, resource accessing method, resource sharing equipment and computer readable storage medium
CN115146302A (en) * 2021-03-31 2022-10-04 北京有竹居网络技术有限公司 File processing method, device, storage medium and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116932847A (en) * 2023-09-15 2023-10-24 江苏海王健康生物科技有限公司 Medical health data management platform operation method and system
CN116932847B (en) * 2023-09-15 2023-11-24 江苏海王健康生物科技有限公司 Medical health data management platform operation method and system
CN117172609A (en) * 2023-09-18 2023-12-05 北汽蓝谷信息技术有限公司 Management method and system based on value chain management and business management fusion

Similar Documents

Publication Publication Date Title
US11196561B2 (en) Authorized data sharing using smart contracts
WO2021003980A1 (en) Blacklist sharing method and apparatus, computer device and storage medium
US11829502B2 (en) Data sharing via distributed ledgers
US11509709B1 (en) Providing access to encrypted insights using anonymous insight records
CN104798081B (en) Control the access to the clinical data analyzed by remote computing resource
US20130006865A1 (en) Systems, methods, apparatuses, and computer program products for providing network-accessible patient health records
WO2021003977A1 (en) Default information query method and apparatus, and computer device and storage medium
CN107590396B (en) Data processing method and device, storage medium and electronic equipment
TW201330577A (en) Data protection system and method based on cloud storage
JP2020519097A (en) Creating a matching cohort and exchanging protected data using blockchain
CN104601325A (en) Data encryption method, device, equipment and system and data decryption method, device, equipment and system
CN116028486A (en) Method and device for data storage and data query
CN112307515A (en) Database-based data processing method and device, electronic equipment and medium
CN101714227B (en) Personal-information managing apparatus and personal-information handling apparatus
CN112489742B (en) Prescription circulation processing method and device
CN103078960B (en) Concerning security matters electronic document data exchanges and shared system
CN115146302A (en) File processing method, device, storage medium and system
CN116011023A (en) Data desensitization processing method and device, terminal equipment and storage medium
CN114861144A (en) Blockchain-based data rights processing method
CN118199992A (en) Data encryption method, device, electronic device and storage medium
CN107707528B (en) Method and device for isolating user information
US20220391534A1 (en) Privacy preserving logging
CN116346486A (en) Joint login method, device, equipment and storage medium
CN116346822A (en) Data sharing method, device and storage medium
US20240403456A1 (en) Secure document transfer

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination