Data management method, device, system and readable storage medium
Through the unified data management system, multiple subsystems are authenticated and data synchronized, which solves the problem in the existing technology that each subsystem requires an independent management system, and achieves efficient resource utilization and access control.
Patent Information
- Application Number
- CN201910494610.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-06
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2039-06-06
AI Technical Summary
In the existing technology, enterprises need to set up access control management systems for multiple data resources for each subsystem, resulting in a waste of computer resources and human resources.
Provide a data management method that controls access to data resources for multiple subsystems through a unified data management system, uses tokens and signatures in authentication requests for authentication, and generates feedback tokens to achieve data synchronization, avoiding the need for Set up a separate management system for each subsystem.
It achieves unified management of multiple subsystems, reduces the waste of computer resources and human resources, and improves the efficiency of access control of data resources.
Smart Images

Figure CN110263574B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of financial technology (Fintech), and in particular to a data management method, device, system and readable storage medium. Background Art
[0002] With the continuous development of Fintech, especially Internet technology finance, more and more technologies are applied in the financial field. Among them, data management in the financial field involves many technologies, including access control management of subsystem data resources. In the prior art, a management system is set up for access control of each subsystem data resource. For enterprises, there are generally multiple subsystems, and each subsystem needs to establish a management system for access control of data resources, which obviously wastes computer resources. Moreover, since each management system needs to be configured with at least one operation administrator, it will cause a waste of human resources. Summary of the invention
[0003] The main purpose of the present invention is to provide a data management method, device, system and readable storage medium, aiming to solve the technical problem of excessive consumption of access control management of enterprise data resources in the prior art.
[0004] To achieve the above object, an embodiment of the present invention provides a data management method, which is applied to a data management system for managing multiple subsystems. The data management method includes:
[0005] When detecting an authentication request sent by the subsystem, obtaining authentication parameters in the authentication request;
[0006] Generate a first signature associated with the authentication request according to the first token in the authentication parameter and a preset first generation algorithm, and determine whether the first signature is consistent with the second signature in the authentication parameter;
[0007] If the first signature is consistent with the second signature in the authentication parameter, generating a second token according to a preset second generation algorithm;
[0008] The first feedback data including the second token is fed back to the subsystem, so that the subsystem can achieve data synchronization with the data management system based on the first feedback data.
[0009] Optionally, when the authentication request sent by the subsystem is detected, before the step of obtaining the authentication parameters in the authentication request, the step includes:
[0010] If an access request from the subsystem to access the data management system is received, the role authority data and the user role data in the access request are obtained to associate the role authority data and the user role data with a preset user mapping in the data management system to obtain mapping data;
[0011] An application ID and the first token are allocated to the subsystem, and the application ID, the first token and the mapping data are associated and stored.
[0012] Optionally, the step of feeding back first feedback data including the second token to the subsystem so that the subsystem can synchronize data with the data management system based on the first feedback data includes:
[0013] Feedback first feedback data including the second token to the subsystem;
[0014] receiving a first full synchronization request sent by the subsystem based on the first feedback data, and performing a second verification on the second token in the first full synchronization request;
[0015] If it is detected that the second token passes the second verification, the full data of the subsystem is obtained based on the query request, and the full data is returned to the subsystem, wherein the full data includes full role permission data and full user role data.
[0016] Optionally, the step of feeding back first feedback data including the second token to the subsystem so that the subsystem can synchronize data with the data management system based on the first feedback data includes:
[0017] Feedback first feedback data including the second token to the subsystem;
[0018] If a query request from the subsystem is received to inquire whether incremental synchronization is required, determining whether there is incremental data of the subsystem from the last synchronization time to the current time based on the query request;
[0019] If there is incremental data of the subsystem, returning a second feedback result of the incremental data of the subsystem to the subsystem;
[0020] receiving a first incremental synchronization request sent by the subsystem based on the second feedback result, and performing a first verification on the second token in the first incremental synchronization request;
[0021] If it is detected that the second token passes the first verification, the incremental data is returned to the subsystem, wherein the incremental data includes incremental role permission data and incremental user role data.
[0022] Optionally, the receiving a first incremental synchronization request sent by the subsystem based on the second feedback result, and performing a first verification step on the second token in the first incremental synchronization request includes:
[0023] receiving a first incremental synchronization request sent by the subsystem based on the second feedback result, and obtaining a validity period of the second token in the first incremental synchronization request;
[0024] Determine whether the second token is within the validity period, and when the second token is within the validity period, determine that the second token in the synchronization request passes the first verification.
[0025] Optionally, the step of feeding back the first feedback data including the second token to the subsystem includes:
[0026] Calling a preset redis-based distributed lock mechanism to perform a locking operation on the first incremental synchronization request or the first full synchronization request to obtain the first incremental synchronization request or the first full synchronization request in a locked state;
[0027] If a second incremental synchronization request is detected that is consistent with the first incremental synchronization request in a locked state, or if a second full synchronization request is detected that is consistent with the first full synchronization request in a locked state, the second incremental synchronization request or the second full synchronization request is ignored and a prompt message is sent to the subsystem.
[0028] Optionally, the step of feeding back the first feedback data including the second token to the subsystem so that the subsystem can synchronize data with the data management system based on the first feedback data includes:
[0029] Determine whether feedback information of successful synchronization of the subsystem data is received;
[0030] If no feedback information indicating successful data synchronization of the subsystem is received, the first incremental synchronization request or the first full synchronization request is unlocked, and the preset redis-based distributed lock mechanism is called to perform a locking operation on the second incremental synchronization request or the second full synchronization request to obtain the incremental data and provide feedback.
[0031] The present invention also provides a data management device, the data management device comprising:
[0032] A detection module, configured to obtain authentication parameters in the authentication request when detecting the authentication request sent by the subsystem;
[0033] A first generating module, configured to generate a first signature associated with the authentication request according to a first token in the authentication parameters and a preset first generating algorithm, and determine whether the first signature is consistent with a second signature in the authentication parameters;
[0034] A second generating module, configured to generate a second token according to a preset second generating algorithm if the first signature is consistent with the second signature in the authentication parameter;
[0035] A synchronization module is used to feed back first feedback data including the second token to the subsystem, so that the subsystem can achieve data synchronization with the data management system based on the first feedback data.
[0036] Optionally, the data management device further includes:
[0037] an acquisition module, configured to, upon receiving an access request from the subsystem requesting access to the data management system, acquire role authority data and user role data in the access request, so as to associate the role authority data and the user role data with a preset user mapping in the data management system to obtain mapping data;
[0038] A storage module is used to allocate an application ID and the first token to the subsystem, and store the application ID, the first token and the mapping data in association with each other.
[0039] Optionally, the synchronization module includes:
[0040] A first feedback unit, configured to feed back first feedback data including the second token to the subsystem;
[0041] A first receiving unit, configured to receive a first full synchronization request sent by the subsystem based on the first feedback data, and perform a second verification on the second token in the first full synchronization request;
[0042] The second feedback unit is used to obtain the full data of the subsystem based on the query request if it is detected that the second token passes the second verification, and return the full data to the subsystem, wherein the full data includes full role permission data and full user role data.
[0043] Optionally, the synchronization module includes:
[0044] A third feedback unit, configured to feed back first feedback data including the second token to the subsystem;
[0045] A judging unit, configured to, upon receiving a query request from the subsystem asking whether incremental synchronization is required, judge whether there is incremental data of the subsystem from the last synchronization time to the current time based on the query request;
[0046] A fourth feedback unit, configured to return a second feedback result indicating that there is incremental data of the subsystem to the subsystem if there is incremental data of the subsystem;
[0047] A second receiving unit, configured to receive a first incremental synchronization request sent by the subsystem based on the second feedback result, and perform a first verification on the second token in the first incremental synchronization request;
[0048] A fifth feedback unit is configured to return the incremental data to the subsystem if it is detected that the second token passes the first verification, wherein the incremental data includes incremental role authority data and incremental user role data.
[0049] Optionally, the first receiving unit includes:
[0050] A receiving subunit, configured to receive a first incremental synchronization request sent by the subsystem based on the second feedback result, and obtain a validity period of the second token in the first incremental synchronization request;
[0051] The judging subunit is used to judge whether the second token is within the validity period, and when the second token is within the validity period, determine whether the second token in the synchronization request passes the first verification.
[0052] Optionally, the third feedback unit includes:
[0053] A calling subunit is used to call a preset redis-based distributed lock mechanism to perform a locking operation on the first incremental synchronization request or the first full synchronization request to obtain the first incremental synchronization request or the first full synchronization request in a locked state;
[0054] A processing sub-unit is used to ignore a second incremental synchronization request or a second full synchronization request if a second incremental synchronization request is detected that is consistent with the first incremental synchronization request in a locked state, or to send a prompt message to the subsystem if a second full synchronization request is detected that is consistent with the first full synchronization request in a locked state.
[0055] Optionally, the data management device further includes:
[0056] A judgment module, used to judge whether feedback information indicating successful synchronization of the subsystem data is received;
[0057] The unlocking module is used to unlock the first incremental synchronization request or the first full synchronization request if no feedback information on successful data synchronization of the subsystem is received, so as to call the preset redis-based distributed lock mechanism to perform locking operation on the second incremental synchronization request or the second full synchronization request to obtain the incremental data and feedback.
[0058] The present invention also provides a readable storage medium, on which a data management program is stored, and when the data management program is executed by a processor, the steps of the data management method as described above are implemented.
[0059] When the present invention detects an authentication request sent by a subsystem, the authentication parameters in the authentication request are obtained; a first signature associated with the authentication request is generated according to a first token in the authentication parameter and a preset first generation algorithm, and it is determined whether the first signature is consistent with a second signature in the authentication parameter; if the first signature is consistent with the second signature in the authentication parameter, a second token is generated according to a preset second generation algorithm; and first feedback data including the second token is fed back to the subsystem, so that the subsystem can achieve data synchronization with the data management system based on the first feedback data. In the present application, an access control management system for data resources is no longer set for each subsystem of the enterprise. Instead, only one data management system is set, and the unified management subsystem can realize data synchronization with each subsystem, so as to uniformly manage and control the access to data resources of each subsystem in addition to isolating the data interaction between each subsystem. Specifically, in order to uniformly manage and control the access to data resources of each subsystem in addition to isolating the data interaction between each subsystem, in the present application, the data management system first authenticates the subsystem that needs data synchronization. Specifically, the data management system receives the authentication request sent by the subsystem, and generates a first signature associated with the authentication request based on the first token parameter in the authentication request and the preset first generation algorithm, so as to compare the first signature with the second signature parameter to determine whether the subsystem authentication is passed. When the subsystem authentication is passed, a second token is generated according to the preset second generation algorithm to determine to feedback the first feedback data including the second token to the subsystem, so that the subsystem can realize data synchronization with the data management system based on the first feedback data. That is, in the present application, it is no longer necessary to develop a management system for each subsystem to achieve management and control of access to data resources of each subsystem, thereby solving the technical problem of excessive cost in access control management of enterprise data resources in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 It is a flowchart of the first embodiment of the data management method of the present invention;
[0061] Figure 2 A detailed flow chart before the step of obtaining the authentication parameters in the authentication request when the authentication request sent by the subsystem is detected in the second embodiment of the data management method of the present invention;
[0062] Figure 3 It is a schematic diagram of the system structure of the hardware operating environment involved in the embodiment of the present invention.
[0063] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0064] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0065] The present invention provides a data management method. In one embodiment of the data management method, the data management method is applied to a data management system that manages multiple subsystems. Figure 3 , the data management method comprises:
[0066] Step S10, when detecting an authentication request sent by the subsystem, obtaining authentication parameters in the authentication request;
[0067] Step S20, generating a first signature associated with the authentication request according to the first token in the authentication parameters and a preset first generation algorithm, and determining whether the first signature is consistent with the second signature in the authentication parameters;
[0068] Step S30, if the first signature is consistent with the second signature in the authentication parameter, generating a second token according to a preset second generation algorithm;
[0069] Step S40: Feedback first feedback data including the second token to the subsystem, so that the subsystem can synchronize data with the data management system based on the first feedback data.
[0070] The specific steps are as follows:
[0071] Step S10, when detecting an authentication request sent by the subsystem, obtaining authentication parameters in the authentication request;
[0072] In this embodiment, a data management system is provided, which uniformly controls and manages user access to multiple subsystems of an enterprise. In the process of uniformly controlling and managing user access to multiple subsystems of an enterprise, data synchronization and data isolation processes are involved, wherein data synchronization refers to the process in which each subsystem obtains user access control data from the data management system through a communication request such as an HTTP request, and data isolation refers to the process in which each subsystem synchronously obtains data belonging only to the subsystem from the data management system, and the data of other subsystems are unavailable and invisible to the subsystem. In order to achieve data synchronization and data isolation, the data management system needs to perform subsystem authentication on each subsystem. Subsystem authentication refers to each subsystem initiating a legitimacy verification request to the management system through a communication request such as an HTTP request. Only after the subsystem has passed the authentication of the data management system, can the subsystem achieve data synchronization from the data management system.
[0073] It should be noted that before the subsystem initiates an authentication request to the management system, it needs to perform access filing in the management system. Specifically, when the authentication request sent by the subsystem is detected, the authentication parameter step in the authentication request is obtained, including:
[0074] Step S01, if an access request is received from the subsystem requesting access to the data management system, role authority data and user role data in the access request are obtained, so as to associate the role authority data and the user role data with a preset user mapping in the data management system to obtain mapping data;
[0075] Among them, the data management system's management of data is determined by the role-based access control RBAC (Role-Based Access Control). As shown in the figure, in RBAC, various roles and permissions are first defined, and the roles and permissions are recorded in the role table and permission table respectively. Different permissions are given to different roles by using the role permission association table, that is, the role permission association table records the mapping relationship between roles and permissions. After obtaining the role permission association table, the corresponding role is assigned to the user by using the user role association table, that is, the user role association table records the mapping relationship between users and roles. Since the role to which the user belongs is recorded, the user entity belonging to a certain role has the permission of this role, which can be expressed in the management system as the permission to correctly access the corresponding data resources on the subsystem. At present, in order to expand users, the concept of user groups can also be introduced. User groups can be associated with multiple roles. If a user belongs to a certain user group, he can indirectly have multiple roles, which reduces the operation of assigning roles to a user multiple times and achieves a more efficient and quick management effect. Among them, in order to realize the management of data, the RBAC of the data management system includes at least a role management module, a permission management module, and an information query module. Among them, the role management module is used to define roles and maintain the mapping relationship between roles and permissions; the permission management module is used to divide the permissions of system resource operations, assign permissions to the roles defined in the system and maintain the corresponding mapping relationship; the information query module is used to realize the query of role permission information of system users, as shown in the figure.
[0076] In this embodiment, before the data management system implements control management of user access to multiple subsystems, the corresponding subsystems need to access the data management system. Specifically, if an access request is received from the subsystem requesting access to the data management system, the data management system obtains the role authority data and user role data carried in the access request, wherein the role authority data and user role data include roles, permissions, user role mapping tables, and role authority mapping tables. After obtaining the role authority data and user role data, the role authority data and the user role data are associated with preset user mappings in the data management system to obtain mapping data. For example, the role authority data and the user role data include user A, the corresponding role is developer, and the corresponding permission is a permission. User A is obtained from the user list of the data management system, and based on the received role authority data and user role data, user A in the user list is associated with the developer and a permission in the data management system.
[0077] Specifically, in order to achieve unified management of various subsystems, the data management system in this embodiment sets up three major modules based on RBAC: a visualization management module, a subsystem access module and a data transmission interface module. The visualization management module includes four submodules: a role management submodule, a permission management submodule, an authorization management submodule and a subsystem authentication management submodule. The role management submodule is used to maintain and manage the role data defined by multiple subsystems, and provide visualization of adding, deleting, modifying, checking and batch importing operations of role data. If the subsystem has the need to modify or import role data, it needs to apply to the data management system and other operations to achieve it. The permission management submodule is responsible for maintaining and managing the permission data defined by multiple subsystems, and provides visualization of adding, deleting, modifying, checking and batch importing operations of permission data; the authorization management submodule is used to provide visualization of authorization and batch role permission data and or batch user role data import operations. In addition, the authorization management submodule is also used to maintain and manage the mapping relationship between users and permissions, and provide a user permission query function. It should be noted that the authorization management submodule involves tables including role tables, permission tables, user role association tables, role permission association tables, etc.
[0078] Step S02: allocate an application ID and the first token to the subsystem, and store the application ID, the first token and the mapping data in association with each other.
[0079] In this embodiment, the data management system also includes a subsystem authentication management module, which is used to manage the authentication of multiple subsystems. Before authentication, the subsystem authentication management module also applies for a subsystem application identification ID (application ID or appId) and a first token token (first token or apptoken) of the corresponding subsystem for each subsystem, wherein the application ID is used to identify a subsystem, the first token is used for encrypted storage, and is used to generate a corresponding data signature when the subsystem initiates an authentication request. In addition, the subsystem may also carry the first token when synchronizing data subsequently. If the application ID of the subsystem and the first token are both approved, the application ID and the first token assigned to the subsystem are correspondingly saved under the subsystem authentication management module, and the application ID, the first token and the mapping data are associated and stored. The purpose of the associated storage is to lay the foundation for data isolation of each subsystem.
[0080] When detecting an authentication request sent by the subsystem, obtaining authentication parameters in the authentication request;
[0081] In this embodiment, the subsystem first generates an authentication request. Specifically, when the subsystem receives the user's authentication operation, it first calls the random code generation program segment to generate a random code (nonce), where nonce can be a 5-digit number. After obtaining the random code nonce, the preset first generation algorithm is called to generate the second signature sign. The preset first generation algorithm for generating the second signature sign is: sign = md5 (md5 (appId + nonce + timeStamp) + apptoken), where md5 (x) represents the md5 value of x, that is, the cryptographic hash function value, appId is the application ID, timeStamp is the timestamp, and apptoken is the first token. The random code, the second signature, the timestamp and other parameters are added to the authentication request. Therefore, when the authentication request sent by the subsystem is detected, the data management system can extract authentication parameters including the random code, the timestamp and the second signature from the authentication request.
[0082] Step S20, generating a first signature associated with the authentication request according to the first token in the authentication parameters and a preset first generation algorithm, and determining whether the first signature is consistent with the second signature in the authentication parameters;
[0083] For the data management system, after obtaining the authentication parameters, the first token parameters are extracted, and the first signature associated with the authentication request is generated with the preset first generation algorithm. The preset first generation algorithm is: sign = md5 (md5 (appId + nonce + timeStamp) + apptoken). After obtaining the first signature, it is determined whether the first signature is the same as the second signature in the authentication parameters.
[0084] Step S30, if the first signature is consistent with the second signature in the authentication parameter, generating a second token according to a preset second generation algorithm;
[0085] If the first signature is the same as the second signature in the authentication parameters, a second token is generated according to a preset second generation algorithm, wherein the preset second generation algorithm is: second token token (second token) = des (appId + expireTime + auth + key), wherein expireTime is the expiration time in seconds, the random number (auth) is a 5-digit random number, des is a symmetric encryption algorithm, and key is the encryption key.
[0086] Step S40: Feedback first feedback data including the second token to the subsystem, so that the subsystem can synchronize data with the data management system based on the first feedback data.
[0087] After obtaining the second token, the first feedback data including the second token is fed back to the subsystem, wherein the first feedback data fed back by the data management system is data in JSON format, and the first feedback data specifically includes appId, the second token, auth, expireTime and other contents. After feeding back the first feedback data to the subsystem, the subsystem realizes data synchronization with the data management system based on the first feedback data, and data synchronization includes incremental data synchronization and full data synchronization, etc.
[0088] Specifically, the step of feeding back the first feedback data including the second token to the subsystem so that the subsystem can synchronize data with the data management system based on the first feedback data includes:
[0089] Step S41, feeding back first feedback data including the second token to the subsystem;
[0090] The first feedback data including the second token is fed back to the subsystem so that the subsystem can obtain the second token.
[0091] Step S42, if a query request is received from the subsystem asking whether incremental synchronization is required, determining whether there is incremental data of the subsystem from the last synchronization time to the current time based on the query request;
[0092] In this embodiment, the subsystem initiates an inquiry request to the data management system every preset time period. For example, the subsystem initiates an inquiry request every 30 seconds to inquire whether incremental synchronization is required. If the data management system receives the inquiry request from the subsystem to inquire whether incremental synchronization is required, it obtains the pre-recorded last synchronization time of the subsystem, and checks whether there is any new or updated data in the subsystem from the last synchronization time to the current time, such as whether there is an update in the role table, permission table, user role association table, role permission association table, etc. Checking whether there is any new or updated data in the subsystem from the last synchronization time to the current time is mainly obtained by checking the update time field, where the update time field is used to record the time when the corresponding data is inserted or last updated. If the update time in the update time field is earlier than the last synchronization time, there is Incremental data. When incremental data exists, you also need to obtain the incremental data. Specifically, search the incremental role data of the subsystem from the last synchronization time to the current time according to appId, that is, the modified or newly added role data, search the incremental permission data of the subsystem from the last synchronization time to the current time according to appId, that is, the modified or newly added permission data, search the incremental user role data of the subsystem from the last synchronization time to the current time according to appId, that is, the modified or newly added user role data, search the incremental role permission data of the subsystem from the last synchronization time to the current time according to appId, that is, the modified or newly added role permissions, so as to obtain complete incremental data. Among them, when there is no incremental data, a prompt that there is no incremental data is returned. Specifically, the incremental data includes incremental role permission data and incremental user role data, etc.
[0093] Step S43, if there is incremental data of the subsystem, returning a second feedback result indicating that there is incremental data of the subsystem to the subsystem;
[0094] If there is incremental data of the subsystem, a second feedback result indicating that there is incremental data of the subsystem is returned to the subsystem, so that the subsystem generates and sends a first incremental synchronization request based on the second feedback result.
[0095] Step S44, receiving a first incremental synchronization request sent by the subsystem based on the second feedback result, and performing a first verification on the second token in the first incremental synchronization request;
[0096] Receive the first incremental synchronization request sent by the subsystem based on the second feedback result, the request parameters of the first incremental synchronization request are: appId, auth and the second token, wherein auth and the second token can be obtained in the subsystem authentication request, that is, when the first incremental synchronization request occurs within a certain time for the subsystem to access the data management system, the second token can be the same as the first token, that is, it is not necessary to obtain a new token every time the first incremental synchronization request is made. When the first token in the authentication parameters is valid, the first token can be set to the second token for verification. The process of verifying the second token can be: first, the second token needs to be decrypted by des, and appId, expireTime, auth and other contents are obtained after decryption. First, compare whether appId and auth are consistent with the corresponding parameters in the data management system. If they are consistent, judge according to expireTime to determine whether the second token has passed the verification.
[0097] The step of receiving a first incremental synchronization request sent by the subsystem based on the second feedback result, and performing a first verification on the second token in the first incremental synchronization request comprises:
[0098] Step S441, receiving a first incremental synchronization request sent by the subsystem based on the second feedback result, and obtaining the validity period of the second token in the first incremental synchronization request;
[0099] In this embodiment, the first incremental synchronization request sent by the subsystem based on the second feedback result is received, and the validity period of the second token in the first incremental synchronization request is obtained. For example, the validity period of any token can be 2 hours. The purpose of obtaining the validity period is to determine whether the subsystem needs to be re-authenticated, that is, it is not necessary to obtain a new second token every time the first incremental synchronization request is made. Therefore, the number of accesses to the subsystem authentication interface can be reduced to reduce waste of resources.
[0100] Step S442, determining whether the second token is within the validity period, and when the second token is within the validity period, determining whether the second token in the synchronization request passes the first verification.
[0101] Determine whether the second token is within the validity period. When the second token is within the validity period, determine that the second token in the synchronization request passes the first verification. When the second token is not within the validity period, regenerate the second token and execute subsequent logic accordingly.
[0102] Step S45, if it is detected that the second token passes the first verification, the incremental data is returned to the subsystem, wherein the incremental data includes incremental role authority data and incremental user role data.
[0103] The incremental data includes incremental role authority data and incremental user role data, etc. In this embodiment, if it is detected that the second token passes the first verification, the acquired incremental data will be returned to the subsystem to achieve incremental data synchronization between the unified management subsystem and the subsystem.
[0104] When the present invention detects an authentication request sent by a subsystem, the authentication parameters in the authentication request are obtained; a first signature associated with the authentication request is generated according to a first token in the authentication parameter and a preset first generation algorithm, and it is determined whether the first signature is consistent with a second signature in the authentication parameter; if the first signature is consistent with the second signature in the authentication parameter, a second token is generated according to a preset second generation algorithm; and first feedback data including the second token is fed back to the subsystem, so that the subsystem can achieve data synchronization with the data management system based on the first feedback data. In the present application, an access control management system for data resources is no longer set for each subsystem of the enterprise. Instead, only one data management system is set, and the unified management subsystem can realize data synchronization with each subsystem, so as to uniformly manage and control the access to data resources of each subsystem in addition to isolating the data interaction between each subsystem. Specifically, in order to uniformly manage and control the access to data resources of each subsystem in addition to isolating the data interaction between each subsystem, in the present application, the data management system first authenticates the subsystem that needs data synchronization. Specifically, the data management system receives the authentication request sent by the subsystem, and generates a first signature associated with the authentication request based on the first token parameter in the authentication request and the preset first generation algorithm, so as to compare the first signature with the second signature parameter to determine whether the subsystem authentication is passed. When the subsystem authentication is passed, a second token is generated according to the preset second generation algorithm to determine to feedback the first feedback data including the second token to the subsystem, so that the subsystem can realize data synchronization with the data management system based on the first feedback data. That is, in the present application, it is no longer necessary to develop a management system for each subsystem to achieve management and control of access to data resources of each subsystem, thereby solving the technical problem of excessive cost in access control management of enterprise data resources in the prior art.
[0105] Furthermore, the present invention provides another embodiment of the data management method, in which the step of feeding back the first feedback data including the second token to the subsystem includes:
[0106] Step S451, call the preset redis-based distributed lock mechanism to perform a locking operation on the first incremental synchronization request or the first full synchronization request, and obtain the first incremental synchronization request or the first full synchronization request in a locked state;
[0107] There are multiple computer machines in each subsystem, and these multiple computer machines may simultaneously send the same incremental synchronization request or full synchronization request to the data management system. To avoid resource waste caused by the data management system having to process multiple identical incremental synchronization requests or full synchronization requests, in this embodiment, the preset redis-based distributed lock mechanism is called to perform a locking operation on the first incremental synchronization request or the first full synchronization request, and obtain the first incremental synchronization request or the first full synchronization request in a locked state. Specifically, calling the preset redis-based distributed lock mechanism means: calling the set() method of redis to implement the distributed deployment lock of redis. The set() method defines 5 parameters: set(String key, String value, String nx, String px, int time). String is a string, and String key, that is, the key-value string, is unique. When the key-value strings are different, the corresponding incremental synchronization requests are different. Therefore, it is possible to determine whether multiple incremental synchronization requests are the same based on the key-value string; String value, that is, the value string, is associated with the second token value; String nx means that when String key does not exist, a set operation is performed; String px is to add an expiration setting to String key. The expiration setting refers to whether the locking setting of the specific first incremental synchronization request is in an expired state or a non-expired state. The time when the locking setting of the first incremental synchronization request is in an expired state or a non-expired state is determined by the fifth parameter time; int time corresponds to String px, and int time identifies the expiration time of String key. Generally, the set() method of redis results in two situations: if there is no first incremental synchronization request in a locked state (when key does not exist), then perform a locking operation on the received first incremental synchronization request and add the corresponding expiration setting; if there is already a first incremental synchronization request in a locked state, no other locking operation is performed.
[0108] Step S452, if a second incremental synchronization request consistent with the first incremental synchronization request in the locked state is detected, or if a second full synchronization request consistent with the first full synchronization request in the locked state is detected, ignore the second incremental synchronization request or the second full synchronization request, and send a prompt message to the subsystem.
[0109] If a second incremental synchronization request that is consistent with the first incremental synchronization request in the locked state is detected, the second incremental synchronization request is ignored; if a second full synchronization request that is consistent with the first full synchronization request in the locked state is detected, the second full synchronization request is ignored; the second incremental synchronization request that is consistent with the first incremental synchronization request in the locked state refers to a request for the same requested synchronization data; the second full synchronization request that is consistent with the first full synchronization request in the locked state refers to a request for the same requested synchronization data; ignoring the second incremental synchronization request or the second full synchronization request means not feeding back the second incremental synchronization request or the second full synchronization request, and sending a prompt message of no feedback to the subsystem.
[0110] After the step of feeding back the first feedback data including the second token to the subsystem so that the subsystem can synchronize data with the data management system based on the first feedback data, the following steps are included:
[0111] Step S453, determining whether feedback information indicating successful synchronization of the subsystem data is received;
[0112] Step S454: If no feedback information indicating successful data synchronization of the subsystem is received, the first incremental synchronization request or the first full synchronization request is unlocked, and the preset redis-based distributed lock mechanism is called to perform a locking operation on the second incremental synchronization request or the second full synchronization request to obtain the incremental data and provide feedback.
[0113] It should be noted that, in this embodiment, if the locking setting of the first incremental synchronization request or the first full synchronization request in a locked state is in an expired state, or if no feedback information of successful data synchronization of the subsystem is received, the synchronization data corresponding to the first incremental synchronization request or the first full synchronization request fails to be obtained, and the first incremental synchronization request or the first full synchronization request in a locked state is unlocked so that the data management system can process other second incremental synchronization requests that are consistent with the first incremental synchronization request in a locked state or the second full synchronization request that is consistent with the first incremental synchronization request in a locked state, that is, call the preset redis-based distributed lock mechanism to lock the second incremental synchronization request or the second incremental synchronization request to obtain the incremental data or the full data and feedback it, so as to avoid the difficulty in obtaining the corresponding synchronization data for a long time due to a computer machine failure.
[0114] In this embodiment, the first incremental synchronization request or the first full synchronization request is locked by calling a preset redis-based distributed lock mechanism to obtain the first incremental synchronization request or the first full synchronization request in a locked state; if a second incremental synchronization request consistent with the first incremental synchronization request in a locked state is detected, or if a second full synchronization request consistent with the first full synchronization request in a locked state is detected, the second incremental synchronization request or the second full synchronization request is ignored, and a prompt message is sent to the subsystem. In this embodiment, the waste of resources caused by the data management system having to process multiple identical incremental synchronization requests is avoided.
[0115] Furthermore, the present invention provides another embodiment of the data management method. In this embodiment, the step of feeding back the first feedback data including the second token to the subsystem so that the subsystem can synchronize data with the data management system based on the first feedback data includes:
[0116] Step S46, feeding back first feedback data including the second token to the subsystem;
[0117] Step S47, receiving a first full synchronization request sent by the subsystem based on the first feedback data, and performing a second verification on the second token in the first full synchronization request;
[0118] In this embodiment, synchronization of full data can also be achieved. Full data refers to all data corresponding to users, roles, permissions, role permissions, user roles, etc. of the subsystem in the data management system. Specifically, after receiving the first full synchronization request sent by the subsystem based on the first feedback data, a second verification is performed on the second token in the first full synchronization request. The process of performing the second verification on the second token in the first full synchronization request is basically the same as the process of performing the first verification on the second token in the incremental synchronization request, and will not be repeated here.
[0119] Step S48, if it is detected that the second token passes the second verification, the full data of the subsystem is obtained based on the query request, and the full data is returned to the subsystem, wherein the full data includes full role permission data and full user role data.
[0120] If it is detected that the second token passes the second verification, the full data of the subsystem is obtained based on the query request, and the full data is returned to the subsystem, wherein the full data includes full role permission data and full user role data. Specifically, the full role data, full permission data, full user role data, and full role permission data of the subsystem are searched according to appId to obtain complete full data.
[0121] By feeding back first feedback data including the second token to the subsystem; receiving a first full synchronization request sent by the subsystem based on the first feedback data, performing a second verification on the second token in the first full synchronization request; if it is detected that the second token passes the second verification, obtaining the full data of the subsystem based on the query request, and returning the full data to the subsystem, wherein the full data includes full role permission data and full user role data. In this embodiment, synchronization of full data is achieved.
[0122] Reference Figure 3 , Figure 3 It is a schematic diagram of the system structure of the hardware operating environment involved in the embodiment of the present invention.
[0123] The data management system in the embodiment of the present invention may be a PC, or a terminal device such as a smart phone, a tablet computer, or a portable computer.
[0124] like Figure 3 As shown, the data management system may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0125] Optionally, the data management system may also include a target user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The target user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional target user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0126] Those skilled in the art will understand that Figure 3The data management system structure shown in the figure does not constitute a limitation on the data management system, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0127] like Figure 3 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module and a data management program. The operating system is a program that manages and controls the hardware and software resources of the data management system, and supports the operation of the data management program and other software and / or programs. The network communication module is used to realize the communication between the components inside the memory 1005, and the communication with other hardware and software in the data management system.
[0128] exist Figure 3 In the data management system shown, the processor 1001 is used to execute the data management program stored in the memory 1005 to implement the steps of any of the above-mentioned data management methods.
[0129] The specific implementation of the data management system of the present invention is basically the same as the various embodiments of the above-mentioned data management method, and will not be repeated here.
[0130] In addition, an embodiment of the present invention further provides a data management device, and the specific implementation of the data management device is basically the same as the embodiments of the above-mentioned data management method, which will not be described in detail here.
[0131] In addition, an embodiment of the present invention also proposes a data management system, which includes: a memory 109, a processor 110, and a data management program stored in the memory 109 and executable on the processor 110. When the data management program is executed by the processor 110, the steps of each embodiment of the above-mentioned data management method are implemented.
[0132] In addition, the present invention also provides a computer-readable storage medium, which stores one or more programs. The one or more programs can also be executed by one or more processors to implement the steps of each embodiment of the above-mentioned data management method.
[0133] The expanded contents of the specific implementation methods of the system and readable storage medium (ie, computer-readable storage medium) of the present invention are basically the same as those of the above-mentioned data management method embodiments, and are not elaborated here.
[0134] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0135] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0136] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0137] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A data management method, characterized in that: The data management method is applied to a data management system that manages multiple subsystems, and the data management method includes: When detecting an authentication request sent by the subsystem, obtaining authentication parameters in the authentication request; Generate a first signature associated with the authentication request according to the first token in the authentication parameter and a preset first generation algorithm, and determine whether the first signature is consistent with the second signature in the authentication parameter; If the first signature is consistent with the second signature in the authentication parameter, generating a second token according to a preset second generation algorithm; The first feedback data including the second token is fed back to the subsystem, so that the subsystem can achieve data synchronization with the data management system based on the first feedback data.
2. The data management method according to claim 1, characterized in that: The method of detecting the authentication request sent by the subsystem, before obtaining the authentication parameter in the authentication request, includes: If an access request from the subsystem to access the data management system is received, the role authority data and the user role data in the access request are obtained to associate the role authority data and the user role data with a preset user mapping in the data management system to obtain mapping data; An application ID and the first token are allocated to the subsystem, and the application ID, the first token and the mapping data are associated and stored.
3. The data management method according to claim 1 or 2, characterized in that: The step of feeding back the first feedback data including the second token to the subsystem so that the subsystem can synchronize data with the data management system based on the first feedback data includes: Feedback first feedback data including the second token to the subsystem; receiving a first full synchronization request sent by the subsystem based on the first feedback data, and performing a second verification on the second token in the first full synchronization request; If it is detected that the second token passes the second verification, the full data of the subsystem is obtained based on the query request, and the full data is returned to the subsystem, wherein the full data includes full role permission data and full user role data.
4. The data management method according to claim 1 or 2, characterized in that: The step of feeding back the first feedback data including the second token to the subsystem so that the subsystem can synchronize data with the data management system based on the first feedback data includes: Feedback first feedback data including the second token to the subsystem; If a query request from the subsystem is received to inquire whether incremental synchronization is required, determining whether there is incremental data of the subsystem from the last synchronization time to the current time based on the query request; If there is incremental data of the subsystem, returning a second feedback result of the incremental data of the subsystem to the subsystem; receiving a first incremental synchronization request sent by the subsystem based on the second feedback result, and performing a first verification on the second token in the first incremental synchronization request; If it is detected that the second token passes the first verification, the incremental data is returned to the subsystem, wherein the incremental data includes incremental role permission data and incremental user role data.
5. The data management method according to claim 4, characterized in that: The step of receiving a first incremental synchronization request sent by the subsystem based on the second feedback result, and performing a first verification on the second token in the first incremental synchronization request comprises: receiving a first incremental synchronization request sent by the subsystem based on the second feedback result, and obtaining a validity period of the second token in the first incremental synchronization request; Determine whether the second token is within the validity period, and when the second token is within the validity period, determine that the second token in the synchronization request passes the first verification.
6. The data management method according to claim 4, characterized in that: The step of feeding back first feedback data including the second token to the subsystem includes: Calling a preset redis-based distributed lock mechanism to perform a locking operation on the first incremental synchronization request or the first full synchronization request to obtain the first incremental synchronization request or the first full synchronization request in a locked state; If a second incremental synchronization request is detected that is consistent with the first incremental synchronization request in a locked state, or if a second full synchronization request is detected that is consistent with the first full synchronization request in a locked state, the second incremental synchronization request or the second full synchronization request is ignored and a prompt message is sent to the subsystem.
7. The data management method according to claim 6, characterized in that: After the step of feeding back the first feedback data including the second token to the subsystem so that the subsystem can synchronize data with the data management system based on the first feedback data, the following steps are included: Determine whether feedback information of successful synchronization of the subsystem data is received; If no feedback information indicating successful data synchronization of the subsystem is received, the first incremental synchronization request or the first full synchronization request is unlocked, and the preset redis-based distributed lock mechanism is called to perform a locking operation on the second incremental synchronization request or the second full synchronization request to obtain the incremental data and provide feedback.
8. A data management device, characterized in that: The data management device is applied to a data management system for managing multiple subsystems, and the data management device comprises: A detection module, configured to obtain authentication parameters in the authentication request when detecting the authentication request sent by the subsystem; A first generating module, configured to generate a first signature associated with the authentication request according to a first token in the authentication parameters and a preset first generating algorithm, and determine whether the first signature is consistent with a second signature in the authentication parameters; A second generating module, configured to generate a second token according to a preset second generating algorithm if the first signature is consistent with the second signature in the authentication parameter; A synchronization module is used to feed back first feedback data including the second token to the subsystem, so that the subsystem can achieve data synchronization with the data management system based on the first feedback data.
9. A data management system, characterized in that: The system comprises: a memory, a processor, and a data management program stored in the memory and executable on the processor, wherein the data management program implements the steps of the data management method according to any one of claims 1 to 7 when executed by the processor.
10. A readable storage medium, characterized in that: The readable storage medium stores a data management program, and when the data management program is executed by a processor, the steps of the data management method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Distribution service management method, system and distribution authorization capacibility discrimination and authorization method, system
CN101047552A
Method and system for processing service authentication
CN101351027A
Token acquisition method, device and system
CN104821937A
Unified authority management method of XBRL application platform
CN105227551A
API access distributed authorization method and system
CN105491058A
