Data processing method, device and readable storage medium based on microservice architecture
Through the data processing method based on the microservice architecture, the target microservice interface and manage user permissions are automatically built, which solves the problem of high cost of product data platform development and maintenance, improves efficiency and reduces costs.
Patent Information
- Application Number
- CN202010751791.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-30
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2040-07-30
AI Technical Summary
When existing product data platforms meet the data needs of different users, the development and maintenance costs are too high, mainly because they need to manually develop customized data interfaces and perform data permission management for each user.
Using a data processing method based on the microservice architecture, the target type is determined by detecting the interface service request of new users, and the target microservice interface is built based on the preset microservice architecture, and the associated json data is extracted to determine the target path, and the user permissions are automatically completed. Management to avoid the need to manually develop interfaces and set permissions every time.
It improves the development efficiency of product data platforms, reduces maintenance costs, realizes automated user rights management, and reduces dependence on human resources.
Smart Images

Figure CN111897605B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a data processing method, device and readable storage medium based on a microservice architecture. Background Art
[0002] At present, general product data platforms are connected to a large amount of multi-source heterogeneous data, that is, product data platforms store massive data resources. As a result, many users will have the need to purchase data on the product data platform, and the data needs of different users vary greatly.
[0003] At present, in order to meet the data needs of different users, especially the data needs of new users, when a new user interface service request is detected, the response method adopted is: develop a customized data interface for each user, and manually set up data permission management for each user. However, developing a customized data interface for each user, and manually setting up data permission management for each user, makes the development and maintenance costs of the product data platform too high. Summary of the invention
[0004] The main purpose of the present invention is to provide a data processing method, device, system and readable storage medium based on a microservice architecture, aiming to solve the technical problem in the prior art that the development and maintenance costs of the product data platform are too high in order to meet the data needs of different users.
[0005] To achieve the above object, the present invention provides a data processing method based on a microservice architecture, the method comprising the following steps:
[0006] When an interface service request from a newly added user is detected, determining a target type of the interface service request;
[0007] If the target type is a customized interface service type, construct a target microservice interface for the interface service request based on a preset microservice architecture;
[0008] Extract the associated json data of the target microservice interface, and determine the target path of the target microservice interface based on the associated json data;
[0009] Based on the target path, the user rights of the newly added user are determined to complete the rights management of the newly added user.
[0010] Optionally, if the target type is a customized interface service type, the step of constructing a target microservice interface of the interface service request based on a preset microservice architecture includes:
[0011] If the target type is a customized interface service type, extracting target request parameters and target function information in the interface service request;
[0012] A target microservice interface corresponding to the target request parameters and the target function information is constructed based on a preset microservice architecture.
[0013] Optionally, the step of constructing a target microservice interface corresponding to the target request parameter and the target function information based on a preset microservice architecture includes:
[0014] Based on the target function information, a first type of microservice interface set is selected from a preset microservice architecture;
[0015] Obtain a candidate parameter set for each microservice interface in the first type of microservice interface set;
[0016] Constructing a request parameter representation matrix based on the candidate parameters in each of the candidate parameter sets and the corresponding target request parameters;
[0017] Based on the request parameter representation matrix, determining the similarity between each of the candidate parameter sets and a parameter set consisting of corresponding target request parameters, and obtaining a similarity representation vector;
[0018] Based on the similarity representation vector, select a second type of microservice interface set from the first type of microservice interface set;
[0019] Based on the second type of microservice interface set, a target microservice interface for the interface service request is constructed.
[0020] Optionally, the step of selecting a target microservice sub-interface from a preset microservice architecture based on the similarity representation vector includes:
[0021] Selecting a target representation vector with the highest similarity from the similarity representation vectors;
[0022] Determining whether the similarity value of the target representation vector is greater than or equal to a preset similarity value;
[0023] If the similarity value of the target representation vector is greater than or equal to a preset similarity value, a target microservice sub-interface is selected from a preset microservice architecture.
[0024] Optionally, the step of selecting a first type of microservice interface set from a preset microservice architecture based on the target function information includes:
[0025] Based on the target function information, select a target platform layer service interface from a preset microservice architecture;
[0026] The first type of microservice interface set is selected from the target platform layer service interface.
[0027] Optionally, the step of determining the user rights of the newly added user based on the target path to complete the rights management of the newly added user includes:
[0028] Obtaining prefix information of the target path, and obtaining a hierarchical category of the prefix information;
[0029] Determining the user rights of the newly added user according to the hierarchical category;
[0030] Based on the association between the user rights of the newly added user and the authentication token, the rights management of the newly added user is completed.
[0031] Optionally, after the step of determining the user rights of the newly added user based on the target path to complete the rights management of the newly added user, the method includes:
[0032] Based on the target microservice interface, determine whether the interface service request passes authentication;
[0033] If the authentication is passed, the target data corresponding to the interface service request is requested from the preset database;
[0034] The target data sent by the preset database is received.
[0035] Optionally, after the step of determining the target type of the interface service request when an interface service request of a newly added user is detected, the method includes:
[0036] If the target type is a universal interface service type, determining a target universal interface of the interface service request based on a preset universal interface set;
[0037] Based on the target universal interface, the user rights of the newly added user are determined to complete the rights management of the newly added user.
[0038] To achieve the above object, the present invention provides a data processing device based on a microservice architecture, the device comprising:
[0039] A first determination module, configured to determine a target type of an interface service request when an interface service request of a newly added user is detected;
[0040] A construction module, used for constructing a target microservice interface of the interface service request based on a preset microservice architecture if the target type is a customized interface service type;
[0041] An extraction module, used to extract the associated JSON data of the target microservice interface, and determine the target path of the target microservice interface based on the associated JSON data;
[0042] The second determination module is used to determine the user rights of the newly added user based on the target path to complete the rights management of the newly added user.
[0043] Optionally, the building blocks include:
[0044] An extraction unit, configured to extract target request parameters and target function information in the interface service request if the target type is a customized interface service type;
[0045] The construction unit is used to construct a target microservice interface corresponding to the target request parameter and the target function information based on a preset microservice architecture.
[0046] Optionally, the construction unit comprises:
[0047] A first selection subunit is used to select a first type of microservice interface set from a preset microservice architecture based on the target function information;
[0048] An acquisition subunit, used to acquire a candidate parameter set for each microservice interface in the first type of microservice interface set;
[0049] A first construction subunit is used to construct a request parameter representation matrix based on the candidate parameters in each of the candidate parameter sets and the corresponding target request parameters;
[0050] A determination subunit is used to determine the similarity between each of the candidate parameter sets and the parameter set consisting of the corresponding target request parameters based on the request parameter representation matrix, and obtain a similarity representation vector;
[0051] A second selection subunit is used to select a second type of microservice interface set from the first type of microservice interface set based on the similarity representation vector;
[0052] The second construction subunit is used to construct a target microservice interface for the interface service request based on the second type of microservice interface set.
[0053] Optionally, the second selection subunit is used to implement:
[0054] Selecting a target representation vector with the highest similarity from the similarity representation vectors;
[0055] Determining whether the similarity value of the target representation vector is greater than or equal to a preset similarity value;
[0056] If the similarity value of the target representation vector is greater than or equal to a preset similarity value, a target microservice sub-interface is selected from a preset microservice architecture.
[0057] Optionally, the base first selection subunit is used to implement:
[0058] Based on the target function information, select a target platform layer service interface from a preset microservice architecture;
[0059] The first type of microservice interface set is selected from the target platform layer service interface.
[0060] Optionally, the second determining module includes:
[0061] an acquiring unit, configured to acquire prefix information of the target path and acquire a hierarchical category of the prefix information;
[0062] A determination unit, configured to determine the user rights of the newly added user according to the hierarchical category;
[0063] The management unit is used to complete the authority management of the newly added user based on the association relationship between the user authority of the newly added user and the authentication token.
[0064] Optionally, the data processing based on the microservice architecture further includes:
[0065] A third determination module is used to determine whether the interface service request passes the authentication based on the target microservice interface;
[0066] A request module, used to request the target data corresponding to the interface service request from a preset database if the authentication is passed;
[0067] The receiving module is used to receive the target data sent by the preset database.
[0068] Optionally, the data processing based on the microservice architecture further includes:
[0069] A fourth determination module, configured to determine a target universal interface of the interface service request based on a preset universal interface set if the target type is a universal interface service type;
[0070] The fifth determination module is used to determine the user rights of the newly added user based on the target universal interface to complete the rights management of the newly added user.
[0071] To achieve the above-mentioned objectives, the present invention also provides a data processing device based on a microservice architecture, wherein the data processing device based on a microservice architecture comprises: a memory, a processor, and a data processing program based on a microservice architecture stored in the memory and executable on the processor, wherein the data processing program based on a microservice architecture implements the steps of the data processing method based on a microservice architecture as described above when executed by the processor.
[0072] In addition, to achieve the above-mentioned objectives, the present invention also proposes a readable storage medium, on which a data processing program based on a microservice architecture is stored. When the data processing program based on a microservice architecture is executed by a processor, the steps of the data processing method based on a microservice architecture as described above are implemented.
[0073] In the present invention, when an interface service request of a newly added user is detected, the target type of the interface service request is determined; if the target type is a customized interface service type, the target microservice interface of the interface service request is constructed based on a preset microservice architecture; the associated json data of the target microservice interface is extracted, and the target path of the target microservice interface is determined based on the associated json data; based on the target path, the user rights of the newly added user are determined to complete the rights management of the newly added user. In the present application, when an interface service request from a newly added user is detected, a customized data interface is no longer developed for each user, and data permission management is no longer manually performed for each user. Instead, a target microservice interface for the interface service request is directly constructed based on a preset microservice architecture, and the target path of the target microservice interface is automatically determined based on the associated json data of the target microservice interface to determine the user permissions of the newly added user, so as to automatically complete the permission management of the newly added user. Since the target microservice interface for the interface service request is directly constructed based on the preset microservice architecture instead of developing an interface each time, and the setting of user permissions for new users is automatically completed instead of manually, the development efficiency of the product data platform is improved, maintenance costs are reduced, and the technical problem of excessively high development and maintenance costs of the product data platform to meet the data needs of different users in the prior art is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0075] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0076] Figure 1 This is a flow chart of the first embodiment of the data processing method based on the microservice architecture of the present application;
[0077] Figure 2This is a detailed flow chart of the steps of constructing the target microservice interface of the interface service request based on the preset microservice architecture if the target type is a customized interface service type in the first embodiment of the data processing method based on the microservice architecture of the present application;
[0078] Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.
[0079] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0080] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0081] The present application embodiment provides a data processing method based on a microservice architecture. In the first embodiment of the data processing method based on a microservice architecture of the present application, refer to Figure 1 , the data processing method based on microservice architecture includes:
[0082] Step S10, when an interface service request of a newly added user is detected, determining a target type of the interface service request;
[0083] Step S20: if the target type is a customized interface service type, construct a target microservice interface of the interface service request based on a preset microservice architecture;
[0084] Step S30, extracting the associated json data of the target microservice interface, and determining the target path of the target microservice interface based on the associated json data;
[0085] Step S40: determining the user rights of the newly added user based on the target path to complete the rights management of the newly added user.
[0086] The specific steps are as follows:
[0087] Step S10, when an interface service request of a newly added user is detected, determining a target type of the interface service request;
[0088] In this embodiment, a data processing method based on a microservice architecture is applied to a data processing system or a product data platform based on a microservice architecture. The data processing system or the product data platform based on a microservice architecture is subordinate to a data processing device based on a microservice architecture. The following is a specific explanation using the application of a data processing method based on a microservice architecture to a data processing system based on a microservice architecture as an example.
[0089] In this embodiment, overall, the user proposes an interface service requirement, and then if the corresponding requirement requires customized development, the new logic is built based on the existing basic interface combination or developed separately. After development, when the corresponding interface is released online, the oauth service can request standard json data from the interface and incorporate the new interface into the permission management. Among them, the user's permission management is pre-configured according to the specified rules. If the developed interface path or target path meets the corresponding matching rules, the newly added interface can be used.
[0090] At present, the data processing system based on the microservice architecture is connected to a large amount of multi-source heterogeneous data, that is, the data processing system based on the microservice architecture reserves a large amount of data resources. Therefore, many users (or customers) have the demand to purchase data on the data processing system based on the microservice architecture. For example, user A can request small loan data of a certain city on the data processing system, user B can request car loan data of a certain city on the data processing system, and user C can request mortgage data of a certain city on the data processing system. That is, the data demands of different users vary greatly. In the prior art, in order to meet the data demands of different users, especially the different data demands of new users, after detecting the new users, the data processing system can be used to collect the data of the new users. When an interface service request is received, in order to meet the data needs of the new user, the response method adopted is: customize and develop a data interface for the new user, and manually set up data permission management for the new user, so that the new user can obtain the required data based on the customized data interface. Customizing and developing a data interface for the new user and manually setting up data permission management for the new user make the development and maintenance costs of the data processing system too high. In this embodiment, through the setting of the microservice architecture, the interface is directly constructed to avoid customizing the interface for each new user separately, improve development efficiency, and realize automatic user permission management and maintenance, avoiding the high cost caused by manual maintenance.
[0091] Specifically, in this embodiment, a data processing system based on a microservice architecture is developed in advance, and a unified gateway is set in the data processing system based on the microservice architecture, that is, all users access the data processing system based on the microservice architecture through a unified gateway service. The gateway service mainly provides a unified entrance to the outside world, and all interfaces need to pass through the gateway service. The gateway service can count the number and frequency of calls to each interface, and can cooperate with the service center to complete the function of authority management. After the user accesses the gateway, the data processing system obtains the user's interface service request. After obtaining the user's interface service request, it is determined whether the user is a new user. Among them, whether the user information of the user is saved in the data processing system is determined to determine whether the user is a new user. If the user is not a new user or the user is an existing user, it is determined whether there is service adjustment information in the user's interface service request. When service adjustment information exists, it is constructed based on the preset microservice architecture. A new microservice interface for an existing user, and adding the new microservice interface for the existing user to the existing target interface for the existing user. Specifically, a new microservice interface for the existing user is constructed based on a preset microservice architecture, and the step of adding the new microservice interface for the existing user to the existing target interface for the existing user includes: obtaining the type of service adjustment information, and based on the type of the service adjustment information, selectively selecting a new microservice interface from the preset microservice architecture (classifying the microservice interfaces by type); after selectively selecting the new microservice interface, adding the new microservice interface for the existing user to the existing target interface for the existing user. It should be noted that if the user is not a new user and it is determined that there is no service adjustment information in the interface service request, the interface service request is processed based on the existing interface. In this embodiment, when an existing customer needs to update a customized interface, only the customized service of the existing customer needs to be adjusted separately, without affecting services of other customers.
[0092] In this embodiment, if it is determined that the user is a newly added user, when an interface service request of the newly added user is detected, a target type of the interface service request is determined, and the target type may be a general interface service type or a customized interface service type, etc. When an interface service request of the newly added user is detected, a method for determining the target type of the interface service request includes:
[0093] Method 1: when an interface service request of a newly added user is detected, the request information carried in the interface service request is extracted to determine the target type of the interface service request;
[0094] Mode 2: When an interface service request of a newly added user is detected, a matching configuration file is called according to the interface service request to determine a target type of the interface service request.
[0095] Step S20: if the target type is a customized interface service type, construct a target microservice interface of the interface service request based on a preset microservice architecture;
[0096] If the target type is a customized interface service type, the target microservice interface of the interface service request is constructed based on the preset microservice architecture. It should be noted that, in this embodiment, the preset microservice architecture includes multiple microservice interfaces, and the multiple microservice interfaces are orderly combined to form the preset microservice architecture. Specifically, each microservice interface corresponds to a function, and a combination of multiple microservice interfaces of the same type corresponds to a certain type of function. The certain type of function can be for a certain sub-platform, or multiple sub-platforms. Specifically, for example, the a1 microservice interface is used to obtain the microloan data of a certain credit product M1 on a certain M platform, the b1 microservice interface is used to obtain the microloan data of a certain credit product M2 on a certain M platform, and the c1 microservice interface is used to obtain the microloan data of a certain credit product M3 on a certain M platform. Then the a1 microservice interface, the b1 microservice interface and the c1 microservice interface implement Corresponding to the function of obtaining microloan data of different products on a certain M platform, or the a2 microservice interface is used to obtain the microloan data of a certain credit product M1 on a certain N1 platform, the b2 microservice interface is used to obtain the microloan data of a certain credit product M1 on a certain N2 platform, and the c2 microservice interface is used to obtain the microloan data of a certain credit product M1 on a certain N3 platform, then the a2 microservice interface, the b2 microservice interface and the c2 microservice interface realize the corresponding function of obtaining microloan data on different platforms. It should be noted that, in order to improve efficiency, an intermediate layer or platform interface layer can also be built or encapsulated on the microservice interface. The intermediate layer or platform interface layer corresponds to a certain type of function. Specifically, for example, the a2 microservice interface, the b2 microservice interface and the c2 microservice interface are built or encapsulated into an intermediate layer to realize the corresponding function of obtaining microloan data on different platforms.
[0097] If the target type is a customized interface service type, the target microservice interface of the interface service request is constructed based on the preset microservice architecture, that is, the required microservice interface is selected from the preset microservice architecture.
[0098] Reference Figure 2 , if the target type is a customized interface service type, the step of constructing a target microservice interface of the interface service request based on a preset microservice architecture includes:
[0099] Step S21, if the target type is a customized interface service type, extracting target request parameters and target function information in the interface service request;
[0100] If the target type is a customized interface service type, extract the target request parameters and target function information in the interface service request, wherein the target function information includes the function type, or the platform area for implementing the function, etc., wherein the target request parameters can be grouped, specifically, the target request parameters are grouped according to the function.
[0101] Step S22: constructing a target microservice interface corresponding to the target request parameter and the target function information based on a preset microservice architecture.
[0102] The target microservice interface corresponding to the target request parameters and the target function information is constructed based on the preset microservice architecture, that is, a preliminary microservice interface set is first determined according to the target function information, and then the target microservice interface is determined from the preliminary microservice interface set according to the target request parameters.
[0103] The step of constructing a target microservice interface corresponding to the target request parameter and the target function information based on the preset microservice architecture includes:
[0104] Step A1, based on the target function information, selecting a first type of microservice interface set from a preset microservice architecture;
[0105] In this embodiment, based on the target function information, a first type of microservice interface set that matches or is consistent with the target function information is selected from a preset microservice architecture.
[0106] Step A2, obtaining a candidate parameter set for each microservice interface in the first type of microservice interface set;
[0107] First, obtain the candidate parameter set of each microservice interface in the first type of microservice interface set, that is, one microservice interface corresponds to one candidate parameter set.
[0108] Step A3, constructing a request parameter representation matrix based on the candidate parameters in each of the candidate parameter sets and the corresponding target request parameters;
[0109] In this embodiment, the candidate parameters in each of the candidate parameter sets are obtained, and the candidate parameters in each candidate parameter set are compared with the corresponding target request parameters to construct the target microservice interface of the interface service request, wherein the correspondence refers to the consistency of parameter names, or the consistency of functions of the candidate parameter set and the corresponding target request parameter set (one target request parameter set can correspond to multiple candidate parameter sets). Specifically, for each candidate parameter set, the candidate parameters and the corresponding target request parameters are used to construct a request parameter representation matrix, wherein each column of the request parameter representation matrix corresponds to one of the target request parameters or candidate parameters, and each row of the request parameter representation matrix corresponds to the characteristics of the target request parameter or candidate parameter. The method of constructing the request parameter matrix includes one-hot encoding, etc.
[0110] Step A4, based on the request parameter representation matrix, determining the similarity between each of the candidate parameter sets and the parameter set consisting of the corresponding target request parameters, and obtaining a similarity representation vector;
[0111] Step A5: selecting a second type of microservice interface set from the first type of microservice interface set based on the similarity representation vector;
[0112] The request parameter matrix is input into a preset similarity calculation model, and the similarity between each of the candidate parameter sets and the parameter set corresponding to the corresponding target request parameter is calculated to obtain a similarity representation vector, wherein the similarity representation vector includes one or more similarity values, wherein the similarity value represents the degree of similarity between the candidate parameter set and the parameter set corresponding to the corresponding target request parameter, and then, based on the similarity representation vector, according to a preset selection method, a second type of microservice interface set is selected from the first type of microservice interface set.
[0113] Step A6: construct a target microservice interface for the interface service request based on the second type of microservice interface set.
[0114] Based on the second-category microservice interface set, a target microservice interface for the interface service request is constructed, that is, each second-category microservice interface in the second-category microservice interface set is used as the target microservice interface for the interface service request.
[0115] Step S30, extracting the associated json data of the target microservice interface, and determining the target path of the target microservice interface based on the associated json data;
[0116] In this embodiment, in addition to automatically building the target microservice interface, user permissions are also automatically managed. It should be noted that after the target microservice interface is determined or published, the address of the target microservice interface is named according to the preset rules or a custom label is added to the target microservice interface according to the preset rules.
[0117] When a target microservice interface is published, it will be automatically registered with the service center and managed. Specifically, the oauth (open protocol) service of the service center can obtain the associated json (a data format) data of the target microservice interface by calling the corresponding preset api-doc interface, and parse the path (route) parameter to obtain the url path of the published target microservice interface, that is, the target path of the target microservice interface.
[0118] Step S40: determining the user rights of the newly added user based on the target path to complete the rights management of the newly added user.
[0119] Based on the target path, the user rights of the newly added user are determined to complete the rights management of the newly added user. Specifically, the user rights of the newly added user can be determined by the prefix information or suffix information of the target path to complete the rights management of the newly added user.
[0120] After the step of determining the target type of the interface service request when an interface service request of a newly added user is detected, the method comprises:
[0121] Step S50, if the target type is a universal interface service type, determining a target universal interface of the interface service request based on a preset universal interface set;
[0122] Step S60: determining the user rights of the newly added user based on the target universal interface to complete the rights management of the newly added user.
[0123] If the target type is a universal interface service type (determined according to an interface service request), the target universal interface of the interface service request is determined based on a preset universal interface set. Specifically, the target universal interface is selected from the preset universal interface set according to the request information in the interface service request, and the user rights of the newly added user are determined based on the target universal interface, specifically, based on the interface address or interface path of the target universal interface, to complete the permission management of the newly added user.
[0124] In the present invention, when an interface service request of a newly added user is detected, the target type of the interface service request is determined; if the target type is a customized interface service type, the target microservice interface of the interface service request is constructed based on a preset microservice architecture; the associated json data of the target microservice interface is extracted, and the target path of the target microservice interface is determined based on the associated json data; based on the target path, the user rights of the newly added user are determined to complete the rights management of the newly added user. In the present application, when an interface service request from a newly added user is detected, a customized data interface is no longer developed for each user, and data permission management is no longer manually performed for each user. Instead, a target microservice interface for the interface service request is directly constructed based on a preset microservice architecture, and the target path of the target microservice interface is automatically determined based on the associated json data of the target microservice interface to determine the user permissions of the newly added user, so as to automatically complete the permission management of the newly added user. Since the target microservice interface for the interface service request is directly constructed based on the preset microservice architecture instead of developing an interface each time, and the setting of user permissions for new users is automatically completed instead of manually, the development efficiency of the product data platform is improved, maintenance costs are reduced, and the technical problem of excessively high development and maintenance costs of the product data platform to meet the data needs of different users in the prior art is solved.
[0125] The embodiment of the present application provides a data processing method based on a microservice architecture. In another embodiment of the data processing method based on a microservice architecture of the present application, the step of selecting a target microservice sub-interface from a preset microservice architecture based on the similarity representation vector includes:
[0126] Step B1, selecting a target representation vector with the highest similarity from the similarity representation vectors;
[0127] Step B2, determining whether the similarity value of the target representation vector is greater than or equal to a preset similarity value;
[0128] Step B3: If the similarity value of the target representation vector is greater than or equal to a preset similarity value, a target microservice sub-interface is selected from a preset microservice architecture.
[0129] In this embodiment, a target representation vector with the highest similarity is selected from the similarity representation vectors, and it is determined whether the similarity value of the target representation vector is greater than or equal to a preset similarity value; if the similarity value of the target representation vector is greater than or equal to the preset similarity value (to avoid the selected target microservice sub-interface not meeting the requirements), the target microservice sub-interface is selected from the preset microservice architecture; if the similarity value of the target representation vector is less than the preset similarity value, the target microservice sub-interface is not selected from the preset microservice architecture. In this embodiment, it is also determined whether the similarity value of the target representation vector is greater than or equal to the preset similarity value to accurately determine the target microservice sub-interface.
[0130] In this embodiment, by selecting the target representation vector with the highest similarity from the similarity representation vectors, determining whether the similarity value of the target representation vector is greater than or equal to a preset similarity value, and selecting a target microservice sub-interface from a preset microservice architecture if the similarity value of the target representation vector is greater than or equal to the preset similarity value, the target microservice sub-interface is accurately determined.
[0131] The embodiment of the present application provides a data processing method based on a microservice architecture. In another embodiment of the data processing method based on a microservice architecture of the present application, based on the target function information, the step of selecting a first type of microservice interface set from a preset microservice architecture includes:
[0132] Step C1, based on the target function information, selecting a target platform layer service interface from a preset microservice architecture;
[0133] Step C2: Select the first type of microservice interface set from the target platform layer service interface.
[0134] In this embodiment, a target platform layer service interface is also set, that is, middleware is set in the microservice architecture. The purpose of setting the middleware is to quickly determine the first type of microservice interface set. Specifically, based on the target function information, the target platform layer service interface is selected from the preset microservice architecture, and then, the first type of microservice interface set is selected from the target platform layer service interface according to the specific function type.
[0135] In this embodiment, by selecting a target platform layer service interface from a preset microservice architecture based on the target function information and selecting the first type of microservice interface set from the target platform layer service interface, the first type of microservice interface set is quickly determined.
[0136] The embodiment of the present application provides a data processing method based on a microservice architecture. In another embodiment of the data processing method based on a microservice architecture of the present application, the step of determining the user rights of the newly added user based on the target vehicle association information and the target path to complete the rights management of the newly added user includes:
[0137] Step S41, obtaining prefix information of the target path, and obtaining the hierarchical category of the prefix information;
[0138] In this embodiment, the prefix information of the target path is obtained, and the hierarchical category of the prefix information is obtained. For example, common interfaces are uniformly prefixed with common, and the common interfaces can be further hierarchically classified by connection types such as type_a, type_b, while user-customized interfaces are prefixed with user descriptions. For example, client A is client_a, and client B is client_b. User-customized interfaces can be further hierarchically classified according to version numbers. Specifically, for example, / v1 / common / type_a / test represents v1 version common interface-class A, / v2 / common / type_a / test represents v2 version common interface-class A, / v1 / common / type_b / test represents v1 version common interface-class B, / v1 / client_a / test represents v1 version client A interface, and / v2 / client_a / test represents v2 version client A interface.
[0139] Step S42, determining the user rights of the newly added user according to the hierarchical category;
[0140] According to the hierarchical category, the user rights of the newly added user are determined. Specifically, * / common / type_a / * indicates permission to common interface Class A, * / common / * indicates permission to all common interfaces, * / v1 / common / type_b / * indicates permission to common interface Class B v1 version, * / common / type_a / *+* / client_a / * indicates permission to common interface Class A + client A customized interface, and * / common / *+* / client_b / * indicates permission to common interface + client B customized interface.
[0141] Step S43, completing the authority management of the newly added user based on the association relationship between the user authority of the newly added user and the authentication token.
[0142] In this embodiment, permission management of the newly added user is also completed based on the association between the user permissions of the newly added user and the authentication token. Completing permission management of the newly added user based on the association between the user permissions of the newly added user and the authentication token means: informing the newly added user of the permissions of the newly added user pre-existing in the service center by issuing authentication tokens. Specifically, for example, permission management of the newly added user is completed through the correspondence between token A and general interface class A, permission management of the newly added user is completed through the association between token D and general interface class A + customer A customized interface, and permission management of the newly added user is completed through the association between token B and all general interfaces, wherein one new user can correspond to multiple authentication tokens.
[0143] In this embodiment, the prefix information of the target path is obtained, and the hierarchical category of the prefix information is obtained; the user rights of the newly added user are determined according to the hierarchical category; and the rights management of the newly added user is completed based on the association between the user rights of the newly added user and the authentication token. In this embodiment, accurate rights management of the newly added user is achieved.
[0144] The embodiment of the present application provides a data processing method based on a microservice architecture. In another embodiment of the data processing method based on a microservice architecture of the present application, after the step of determining the user rights of the newly added user based on the target path to complete the rights management of the newly added user, the method includes:
[0145] Step E1, based on the target microservice interface, determining whether the interface service request has passed authentication;
[0146] Step E2, if the authentication is passed, request the target data corresponding to the interface service request from the preset database;
[0147] Step E3, receiving the target data sent by the preset database.
[0148] In this embodiment, after the target microservice interface is constructed, based on the target microservice interface, it is determined whether the interface service request has passed the authentication. If it has passed the authentication, the preset database is requested for the target data corresponding to the interface service request, and the target data sent by the preset database is received. If it has not passed the authentication, the preset database is requested for the target data corresponding to the interface service request, but the prompt data of no access rights sent by the preset database is received.
[0149] In this embodiment, based on the target microservice interface, it is determined whether the interface service request has passed authentication; if it has passed authentication, a preset database is requested for the target data corresponding to the interface service request; and the target data sent by the preset database is received. In this embodiment, the data acquisition service is completed based on the constructed target microservice interface.
[0150] Reference Figure 3 , Figure 3 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.
[0151] like Figure 3 As shown, the data processing device based on the microservice architecture 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 optionally be a storage device independent of the aforementioned processor 1001.
[0152] Optionally, the data processing device based on the microservice architecture may also include a rectangular owner interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The rectangular owner interface may include a display screen (Display), an input submodule such as a keyboard (Keyboard), and the optional rectangular owner 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).
[0153] Those skilled in the art will understand that Figure 3 The structure of the data processing device based on the microservice architecture shown in the figure does not constitute a limitation on the data processing device based on the microservice architecture, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0154] like Figure 3 As shown, the memory 1005 as a computer medium may include an operating system, a network communication module, and a data processing program based on a microservice architecture. The operating system is a program that manages and controls the hardware and software resources of a data processing device based on a microservice architecture, and supports the operation of a data processing program based on a microservice architecture and other software and / or programs. The network communication module is used to realize communication between the components inside the memory 1005, and communication with other hardware and software in a data processing system based on a microservice architecture.
[0155] exist Figure 3 In the data processing device based on microservice architecture shown, the processor 1001 is used to execute the data processing program based on microservice architecture stored in the memory 1005 to implement the steps of any of the above-mentioned data processing methods based on microservice architecture.
[0156] The specific implementation of the data processing device based on the microservice architecture of the present application is basically the same as the various embodiments of the data processing method based on the microservice architecture described above, and will not be repeated here.
[0157] The present application also provides a data processing device based on a microservice architecture, the data processing device based on a microservice architecture comprising:
[0158] A first determination module, configured to determine a target type of an interface service request when an interface service request of a newly added user is detected;
[0159] A construction module, used for constructing a target microservice interface of the interface service request based on a preset microservice architecture if the target type is a customized interface service type;
[0160] An extraction module, used to extract the associated JSON data of the target microservice interface, and determine the target path of the target microservice interface based on the associated JSON data;
[0161] The second determination module is used to determine the user rights of the newly added user based on the target path to complete the rights management of the newly added user.
[0162] Optionally, the building blocks include:
[0163] An extraction unit, configured to extract target request parameters and target function information in the interface service request if the target type is a customized interface service type;
[0164] The construction unit is used to construct a target microservice interface corresponding to the target request parameter and the target function information based on a preset microservice architecture.
[0165] Optionally, the construction unit comprises:
[0166] A first selection subunit is used to select a first type of microservice interface set from a preset microservice architecture based on the target function information;
[0167] An acquisition subunit, used to acquire a candidate parameter set for each microservice interface in the first type of microservice interface set;
[0168] A first construction subunit is used to construct a request parameter representation matrix based on the candidate parameters in each of the candidate parameter sets and the corresponding target request parameters;
[0169] A determination subunit is used to determine the similarity between each of the candidate parameter sets and the parameter set consisting of the corresponding target request parameters based on the request parameter representation matrix, and obtain a similarity representation vector;
[0170] A second selection subunit is used to select a second type of microservice interface set from the first type of microservice interface set based on the similarity representation vector;
[0171] The second construction subunit is used to construct a target microservice interface for the interface service request based on the second type of microservice interface set.
[0172] Optionally, the second selection subunit is used to implement:
[0173] Selecting a target representation vector with the highest similarity from the similarity representation vectors;
[0174] Determining whether the similarity value of the target representation vector is greater than or equal to a preset similarity value;
[0175] If the similarity value of the target representation vector is greater than or equal to a preset similarity value, a target microservice sub-interface is selected from a preset microservice architecture.
[0176] Optionally, the base first selection subunit is used to implement:
[0177] Based on the target function information, select a target platform layer service interface from a preset microservice architecture;
[0178] The first type of microservice interface set is selected from the target platform layer service interface.
[0179] Optionally, the second determining module includes:
[0180] an acquiring unit, configured to acquire prefix information of the target path and acquire a hierarchical category of the prefix information;
[0181] A determination unit, configured to determine the user rights of the newly added user according to the hierarchical category;
[0182] The management unit is used to complete the authority management of the newly added user based on the association relationship between the user authority of the newly added user and the authentication token.
[0183] Optionally, the data processing based on the microservice architecture further includes:
[0184] A third determination module is used to determine whether the interface service request passes the authentication based on the target microservice interface;
[0185] A request module, used to request the target data corresponding to the interface service request from a preset database if the authentication is passed;
[0186] The receiving module is used to receive the target data sent by the preset database.
[0187] Optionally, the data processing based on the microservice architecture further includes:
[0188] A fourth determination module, configured to determine a target universal interface of the interface service request based on a preset universal interface set if the target type is a universal interface service type;
[0189] The fifth determination module is used to determine the user rights of the newly added user based on the target universal interface to complete the rights management of the newly added user.
[0190] The specific implementation of the data processing device based on the microservice architecture of the present application is basically the same as the various embodiments of the data processing method based on the microservice architecture described above, and will not be repeated here.
[0191] An embodiment of the present application provides a readable storage medium, and the medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of any of the above-mentioned data processing methods based on microservice architecture.
[0192] The specific implementation methods of the medium of the present application are basically the same as the above-mentioned embodiments of the data processing method based on the microservice architecture, and will not be repeated here.
[0193] 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.
[0194] 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.
[0195] 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 device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the embodiments of the present invention.
[0196] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A data processing method based on microservice architecture, characterized in that: The data processing method based on the microservice architecture includes: When an interface service request from a newly added user is detected, determining a target type of the interface service request; If the target type is a customized interface service type, construct a target microservice interface for the interface service request based on a preset microservice architecture; Extract the associated json data of the target microservice interface, and determine the target path of the target microservice interface based on the associated json data; Based on the target path, determining the user rights of the newly added user to complete the rights management of the newly added user; If the target type is a customized interface service type, the step of constructing a target microservice interface of the interface service request based on a preset microservice architecture includes: If the target type is a customized interface service type, extracting target request parameters and target function information in the interface service request; Constructing a target microservice interface corresponding to the target request parameters and the target function information based on a preset microservice architecture; The step of determining the user rights of the newly added user based on the target path to complete the rights management of the newly added user includes: Obtaining prefix information of the target path, and obtaining a hierarchical category of the prefix information; Determining the user rights of the newly added user according to the hierarchical category; Based on the association between the user rights of the newly added user and the authentication token, the rights management of the newly added user is completed.
2. The data processing method based on microservice architecture according to claim 1, characterized in that: The step of constructing a target microservice interface corresponding to the target request parameter and the target function information based on the preset microservice architecture includes: Based on the target function information, a first type of microservice interface set is selected from a preset microservice architecture; Obtain a candidate parameter set for each microservice interface in the first type of microservice interface set; Constructing a request parameter representation matrix based on the candidate parameters in each of the candidate parameter sets and the corresponding target request parameters; Based on the request parameter representation matrix, determining the similarity between each of the candidate parameter sets and a parameter set consisting of corresponding target request parameters, and obtaining a similarity representation vector; Based on the similarity representation vector, select a second type of microservice interface set from the first type of microservice interface set; Based on the second type of microservice interface set, a target microservice interface for the interface service request is constructed.
3. The data processing method based on microservice architecture according to claim 2, characterized in that: The step of selecting a target microservice sub-interface from a preset microservice architecture based on the similarity representation vector includes: Selecting a target representation vector with the highest similarity from the similarity representation vectors; Determining whether the similarity value of the target representation vector is greater than or equal to a preset similarity value; If the similarity value of the target representation vector is greater than or equal to a preset similarity value, a target microservice sub-interface is selected from a preset microservice architecture.
4. The data processing method based on microservice architecture according to claim 2, characterized in that: The step of selecting a first type of microservice interface set from a preset microservice architecture based on the target function information includes: Based on the target function information, select a target platform layer service interface from a preset microservice architecture; The first type of microservice interface set is selected from the target platform layer service interface.
5. The data processing method based on microservice architecture according to claim 1, characterized in that: After the step of determining the user rights of the newly added user based on the target path to complete the rights management of the newly added user, the method includes: Based on the target microservice interface, determine whether the interface service request passes authentication; If the authentication is passed, the target data corresponding to the interface service request is requested from the preset database; The target data sent by the preset database is received.
6. The data processing method based on microservice architecture according to claim 1, characterized in that: After the step of determining the target type of the interface service request when an interface service request of a newly added user is detected, the method comprises: If the target type is a universal interface service type, determining a target universal interface of the interface service request based on a preset universal interface set; Based on the target universal interface, the user rights of the newly added user are determined to complete the rights management of the newly added user.
7. A data processing device based on a microservice architecture, characterized in that: The data processing device based on microservice architecture includes: a memory, a processor, and a data processing program based on microservice architecture stored in the memory and executable on the processor. When the data processing program based on microservice architecture is executed by the processor, the steps of the data processing method based on microservice architecture are implemented as described in any one of claims 1 to 6.
8. A readable storage medium, characterized in that: The readable storage medium stores a data processing program based on a microservice architecture, and when the data processing program based on a microservice architecture is executed by a processor, the steps of the data processing method based on a microservice architecture as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Client microservice-based method for automatic collaboration of applications (APPs)
CN108804154A
Micro-service generation method and device, server and storage medium
CN111062797A