A data query method and device based on distributed system
By generating query credentials and determining the distributed system information to be queried, the problem of being unable to support cross-system data queries in the existing technology is solved, and cross-system data queries in distributed systems are realized, ensuring the accuracy and flexibility of the query.
Patent Information
- Application Number
- CN202210270094.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-18
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2042-03-18
AI Technical Summary
In the prior art, the data query method cannot support cross-system scenarios. Due to the transmission bandwidth limitation of RPC interfaces or network requests, it is difficult to realize cross-system data query in distributed systems.
By recording the query parameters used to query the current distributed system, generating query credentials, and determining the information of the distributed system to be queried and the parameters to be queried based on the query credentials, cross-system data query is realized.
Implement cross-system data query in distributed systems to ensure the accuracy and flexibility of data query, and support integrity and consistency in multi-system query combination scenarios.
Smart Images

Figure CN114840547B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer application technology, and more particularly to a data query method and device based on a distributed system. The present application also relates to a computer storage medium and an electronic device. Background Art
[0002] In a distributed system, the same type of resource data is often stored in multiple system applications. The acquisition of data is limited by the transmission bandwidth of the RPC interface or network request. Therefore, it is necessary to perform paging query on the data. The paging query is mainly suitable for centralized data storage scenarios. Summary of the invention
[0003] The present application provides a data query method based on a distributed system to solve the problem that the data query method in the prior art cannot support cross-system scenarios.
[0004] The present application provides a data query method based on a distributed system, comprising:
[0005] In response to the first data query request, record query parameters generated for querying the current distributed system;
[0006] Generate a query credential based on a parameter combination determined by combining the query parameters;
[0007] In response to the second data query request, obtaining the query credential;
[0008] According to the query credentials, the distributed system information to be queried and the parameters to be queried are determined.
[0009] In some embodiments, the generating of the query credential by combining the query parameters to determine the parameter combination includes:
[0010] Determine a custom combination format according to the application service version information to which the first data query request belongs;
[0011] Combining the query parameters according to the custom combination format to determine a parameter combination string;
[0012] The query credential is generated according to the parameter combination character string.
[0013] In some embodiments, the generating a query credential by combining the query parameters to determine the parameter combination further includes:
[0014] Encrypting the parameter combination to determine the encryption parameter combination;
[0015] The query credential is generated according to the encryption parameter combination.
[0016] In some embodiments, generating the query credential according to the encryption parameter combination further includes:
[0017] In the encryption parameter combination, adding the specified application encoding version information in the current distributed system;
[0018] The query credential is generated according to the encryption parameter combination with the version information added thereto.
[0019] In some embodiments, determining the distributed system information to be queried and the parameters to be queried according to the query credentials includes:
[0020] Obtaining the specified application encoding version information in the query credential;
[0021] Determine a decoding method according to the specified application encoding version information;
[0022] Decoding the query credential according to the decoding method to obtain the parameter combination;
[0023] The distributed system information to be queried and the parameters to be queried are determined according to the separation processing of the parameter combination.
[0024] In some embodiments, decoding the query credential according to the decoding method to obtain the parameter combination includes:
[0025] Determining whether the decoded parameter combination needs to be decrypted;
[0026] If so, the decryption operation is performed according to the decryption method corresponding to the parameter combination encryption method.
[0027] In some embodiments, determining the distributed system information to be queried and the parameter to be queried according to the separation processing of the parameter combination includes:
[0028] The parameter combinations are separated according to the combination mode, and the distributed system information to be queried and the parameters to be queried are determined.
[0029] In some embodiments, it also includes:
[0030] Output the distributed system information to be queried and / or the parameters to be queried.
[0031] The present application also provides a data query device based on a distributed system, comprising:
[0032] A recording unit, configured to record, in response to the first data query request, query parameters generated for querying the current distributed system;
[0033] A generating unit, configured to generate a query credential by combining the parameters determined by combining the query parameters;
[0034] an acquisition unit, configured to acquire the query credential in response to the second data query request;
[0035] The determination unit is used to determine the distributed system information to be queried and the parameters to be queried according to the query credential.
[0036] The present application also provides a data query method based on a distributed system, comprising:
[0037] In response to a data query request, record query parameters generated for querying the current distributed system;
[0038] The query credential is generated by combining the query parameters to determine the parameter combination.
[0039] In some embodiments, the generating of the query credential by combining the query parameters to determine the parameter combination includes:
[0040] Determine a custom combination format according to the application service version information to which the data query request belongs;
[0041] Combining the query parameters according to the custom combination format to determine a parameter combination string;
[0042] The query credential is generated according to the parameter combination character string.
[0043] In some embodiments, the generating a query credential by combining the query parameters to determine the parameter combination further includes:
[0044] Encrypting the parameter combination to determine the encryption parameter combination;
[0045] The query credential is generated according to the encryption parameter combination.
[0046] In some embodiments, generating the query credential according to the encryption parameter combination further includes:
[0047] In the encryption parameter combination, adding the specified application encoding version information in the current distributed system;
[0048] The query credential is generated according to the encryption parameter combination with the version information added thereto.
[0049] The present application also provides a data query method based on a distributed system, comprising:
[0050] In response to the data query request, a query credential is obtained; wherein the query credential is generated according to the historical query parameters generated by the distributed system;
[0051] According to the query credentials, the distributed system information to be queried and the parameters to be queried are determined.
[0052] In some embodiments, determining the distributed system information to be queried and the parameters to be queried according to the query credentials includes:
[0053] Obtaining the specified application encoding version information in the query credential;
[0054] Determine a decoding method according to the specified application encoding version information;
[0055] Decoding the query credential according to the decoding method to obtain the parameter combination;
[0056] The distributed system information to be queried and the parameters to be queried are determined according to the separation processing of the parameter combination.
[0057] In some embodiments, it also includes:
[0058] Determining whether the decoded parameter combination needs to be decrypted;
[0059] If so, the decryption operation is performed according to the decryption method corresponding to the parameter combination encryption method.
[0060] In some embodiments, determining the distributed system information to be queried and the parameter to be queried according to the separation processing of the parameter combination includes:
[0061] The parameter combinations are separated according to the combination mode, and the distributed system information to be queried and the parameters to be queried are determined.
[0062] The present application also provides a routing query method, comprising:
[0063] Obtaining a first routing query request, wherein the routing query request carries a query order for specifying a query routing system;
[0064] querying the first routing system according to the query order;
[0065] Recording query parameters generated for querying the first routing system;
[0066] Combining the routing parameters determined by combining the query routing parameters to generate a query credential;
[0067] In response to the second routing query request, determining whether to enter the second routing system for query according to the acquired query credentials and the order of the designated query routing systems;
[0068] If so, query the second routing system according to the query credential.
[0069] The present application also provides a computer storage medium for storing data generated by a network platform, and a program for processing the data generated by the network platform;
[0070] When the program is read and executed by the processor, it executes the data query method based on the distributed system as described above; or, executes the data query method based on the distributed system as described above; or, executes the data query method based on the distributed system as described above; or, executes the routing query method as described above.
[0071] The present application also provides an electronic device, comprising:
[0072] processor;
[0073] A memory for storing a program for processing data generated by a network platform, wherein when the program is read and executed by the processor, the program executes a data query method based on a distributed system as described above; or, executes a data query method based on a distributed system as described above; or, executes a data query method based on a distributed system as described above; or, executes a routing query method as described above.
[0074] Compared with the prior art, this application has the following advantages:
[0075] The embodiment of a data query method based on a distributed system provided by the present application can generate a query credential from the query parameters generated by the previous query request, and determine the system and content to be queried in the next query request according to the query credential, thereby realizing cross-system data query in the distributed system, while ensuring the accuracy and flexibility of data query under cross-system query. Moreover, in the case of multi-system query combination scenario, it supports shielding the query interface differences of different systems, and realizes the integrity and consistency of resource query externally. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1 It is a flow chart of an embodiment of a data query method based on a distributed system provided by the present application;
[0077] Figure 2 It is a structural diagram of an embodiment of a data query device based on a distributed system provided by the present application;
[0078] Figure 3 It is a flow chart of an embodiment of a data query method based on a distributed system provided by the present application;
[0079] Figure 4 It is a structural diagram of an embodiment of a data query device based on a distributed system provided by the present application;
[0080] Figure 5 It is a flow chart of an embodiment of a data query method based on a distributed system provided by the present application;
[0081] Figure 6 It is a structural diagram of an embodiment of a data query device based on a distributed system provided by the present application;
[0082] Figure 7 It is a flow chart of an embodiment of a routing query method provided by the present application;
[0083] Figure 8 It is a structural diagram of an embodiment of a route query device provided by the present application;
[0084] Fig. 9 It is a structural schematic diagram of an electronic device embodiment provided by the present application. DETAILED DESCRIPTION
[0085] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0086] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The descriptions used in this application and the appended claims, such as "a", "first", and "second", are not limitations on quantity or sequence, but are used to distinguish the same type of information from each other.
[0087] Combined with the above background technology, it can be seen that the existing paging query is mainly applicable to the scenario of centralized data storage. However, with the continuous development of computer and network technology, distributed systems are widely used. The technical solution of this application is derived from how to query data in a distributed system, as follows:
[0088] In the distributed system scenario, resource data is often stored in different applications. In the scenario of statistics or auditing such resources, it is necessary to obtain the full amount of resource data information. When the amount of data is large, it is limited by the amount of data in a single network request or the amount of data in a single RPC request. Generally, the paging query capability is used to poll and obtain the full amount of data. In the distributed scenario, the traditional method of specifying the size of each query is no longer applicable. For example: One of the existing technologies is to query through the traditional paging method. Specifically, the use of PageNumber and PageSize is suitable for the data centralized storage scenario. By specifying the number of pages and the number of queries per page, the full amount of resources can be queried. This solution is simple and easy to understand, and is currently used by most cloud products. The disadvantage of this solution is that the relational database used has performance problems in scenarios with large data volumes, and cannot support scenarios where data spans multiple systems. Another method is to query through the NextToken method. Specifically, the next page query method is adopted, and MaxResults and NextToken are used to implement it, which can solve the paging performance problem. This solution is the mainstream solution for API paging design. However, this solution requires associating cursor records with database primary key IDs. Its application scenarios are mainly queries in scenarios where a single resource is centrally stored and can be sorted. It has poor support for scenarios where data spans multiple systems.
[0089] In view of the above, the present application provides a data query method based on a distributed system, so as to realize the data query function supporting the distributed system. The details are as follows:
[0090] like Figure 1 As shown, Figure 1 : is a flow chart of an embodiment of a data query method based on a distributed system provided by the present application, and the method may include:
[0091] Step S101: In response to a first data query request, record query parameters generated for querying the current distributed system.
[0092] The current distributed system in step S101 is the system currently executing data query. A distributed system can be a system that allows multiple servers and multiple computing units to work together to complete the overall computing task. In this embodiment, in a distributed system scenario, resource data is usually stored in different resource service applications, and when a task needs to be completed, data query needs to be performed between different resource service applications; that is, data query needs to be performed across systems.
[0093] In this embodiment, the query parameters may include: at least one parameter of querying the system source of the current distributed system, the number of pages to be queried, the number of queries, etc.
[0094] The purpose of step S101 is to record query parameters in response to the user's first data query request.
[0095] Step S102: generating a query credential by combining the parameters determined by combining the query parameters.
[0096] The purpose of step S102 is to generate a query credential.
[0097] The specific implementation process of step S102 may include:
[0098] Step S102-1: determining a custom combination format according to the application service version information to which the first data query request belongs;
[0099] Step S102-2: combining the query parameters according to the custom combination format to determine a parameter combination string;
[0100] Step S102-3: Generate the query credential according to the parameter combination character string.
[0101] In this embodiment, the step S102-1 may specifically include selecting a combination format according to the application service version information (ProductVersion).
[0102] In this embodiment, the specific step S102-2 may be to assemble the query parameters into a string according to the combination format. In this embodiment, the query parameters may be spliced into a string according to the combination format, i.e., a parameter combination string; for example, when the scenario is application service version information A, the determined custom combination format is query page number + query quantity + query system type; when the scenario is application service version information B, the determined custom combination format is primary key ID + query system type. The combination format is not limited to the above examples, and the parameter combination method is customized according to the application service version information in different application scenarios.
[0103] To improve security, step S102 may further include:
[0104] The parameter combination is encrypted to determine the encryption parameter combination; wherein the encryption processing method can be any one of the following methods: data encryption standard (DES: Data Encryption Standard), advanced encryption standard (AES: Advanced Encryption Standard), interference encryption method (Salt), public key encryption method (RSA), etc.
[0105] The query credential is generated according to the encryption parameter combination.
[0106] In order to ensure the legitimacy of the generated query credential, that is, to facilitate the subsequent data query in the event of abnormal parsing due to application service version upgrade, in this embodiment, the specified application code version information (CodeVersion) in the current distributed system can also be added to the encryption parameter combination. The specified application code version information can be added to the header of the encryption parameter combination.
[0107] Step S103: In response to the second data query request, obtain the query credential.
[0108] Step S104: Determine the distributed system information to be queried and the parameters to be queried according to the query credentials.
[0109] In this embodiment, the specific implementation process of step S104 may include:
[0110] Step S104-1: Obtain the designated application code version information in the query credential; specifically, the designated application code version information (CodeVersion) may be obtained from the header of the query credential.
[0111] Step S104-2: Determine a decoding method according to the specified application encoding version information; specifically, a corresponding decoding method may be selected according to the specified application encoding version information.
[0112] Step S104-3: Decode the query credential according to the decoding method to obtain the parameter combination.
[0113] Step S104 - 4 : Determine the distributed system information to be queried and the parameters to be queried according to the separation processing of the parameter combination.
[0114] The specific implementation process of step S104-3 may include:
[0115] Step S104-31: Determine whether the decoded parameter combination needs to be decrypted;
[0116] Step S104-32: If yes, perform the decryption operation according to the decryption method corresponding to the parameter combination encryption method. If no, directly execute the step S104-4.
[0117] The specific implementation process of step S104-4 may include: separating the parameter combination according to the combination method, determining the distributed system information to be queried and the parameters to be queried. That is, separating the parameter combination string according to the custom combination format; that is, parsing the parameter combination string into the query parameters before combination. It can also be understood that the process of step S104 is the inverse process of the process of step S102.
[0118] In this embodiment, it may also include: outputting the determined distributed system information to be queried and the parameters to be queried, for example: displaying the type or source of the distributed system to be queried, displaying at least one parameter of the number of queries, number of query pages, and estimated query time in the parameters to be queried, and of course it may also include querying the distributed system to be queried according to the parameters to be queried, recording the query parameters this time, and generating query credentials for the next query operation based on the query parameters this time.
[0119] The above is a description of an embodiment of a data query method based on a distributed system provided by the present application. This method embodiment can generate query credentials based on the query parameters generated by the previous query request, and determine the system and content to be queried in the next query request based on the query credentials, thereby realizing cross-system data query in the distributed system while ensuring the accuracy and flexibility of data query under cross-system query.
[0120] The above is a specific description of an embodiment of a data query method based on a distributed system provided by the present application. Corresponding to the embodiment of a data query method based on a distributed system provided above, the present application also discloses an embodiment of a data query device based on a distributed system. Please refer to Figure 2 Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described below is only illustrative.
[0121] like Figure 2 As shown, Figure 2 : is a schematic diagram of a structure of an embodiment of a data query device based on a distributed system provided by the present application. The embodiment of the device may include:
[0122] The recording unit 201 is used to record the query parameters generated for querying the current distributed system in response to the first data query request.
[0123] The generating unit 202 is used to generate a query credential by combining the parameters determined by combining the query parameters.
[0124] The acquisition unit 203 is used to acquire the query credential in response to the second data query request.
[0125] The determination unit 204 is used to determine the distributed system information to be queried and the parameters to be queried according to the query credential.
[0126] In this embodiment, the generating unit 202 may include: a determining subunit, a combining subunit and a generating subunit.
[0127] The determining subunit is used to determine a custom combination format according to the application service version information to which the first data query request belongs.
[0128] The combining subunit is used to combine the query parameters according to the custom combination format to determine a parameter combination character string.
[0129] The generating subunit is used to generate the query credential according to the parameter combination character string.
[0130] The generating unit 202 may further include: an encryption subunit, configured to perform encryption processing on the parameter combination to determine the encryption parameter combination; the generating unit 202 may specifically be configured to generate the query credential according to the encryption parameter combination.
[0131] The generation unit 202 may also include: an adding subunit, used to add the specified application coding version information in the current distributed system to the encryption parameter combination; the generation unit 202 is specifically used to generate the query credential according to the encryption parameter combination with the version information added.
[0132] In this embodiment, the determining unit 204 may include: an acquiring subunit, a determining subunit, a decoding subunit, and a separating subunit.
[0133] The acquisition subunit is used to obtain the specified application coding version information in the query credential.
[0134] The determining subunit is used to determine a decoding method according to the designated application encoding version information.
[0135] The decoding subunit is used to decode the query credential according to the decoding method to obtain the parameter combination;
[0136] The separation subunit is used to determine the distributed system information to be queried and the parameters to be queried according to the separation processing of the parameter combination.
[0137] In this embodiment, the decoding subunit may include: a decryption determination subunit and a decryption subunit;
[0138] The decryption determination subunit is used to determine whether the decoded parameter combination needs to be decrypted;
[0139] The decryption subunit is used to perform the decryption operation according to the decryption method corresponding to the parameter combination encryption method when the determination result of the decryption determination subunit is yes.
[0140] The separation subunit may be specifically configured to separate the parameter combination according to a combination method, and determine the distributed system information to be queried and the parameters to be queried.
[0141] Based on the above content, this embodiment may further include: an output unit, configured to output the distributed system information to be queried and / or the parameters to be queried.
[0142] The above is a description of an embodiment of a data query device based on a distributed system provided by the present application. The specific content of the device embodiment can refer to the content of steps S101 to S104 in the above method embodiment, and will not be repeated here.
[0143] Based on the above content, the present application also provides a data query method based on a distributed system, such as Figure 3 As shown, Figure 3 This is a flow chart of an embodiment of a data query method based on a distributed system provided by the present application. This method embodiment is mainly described from the perspective of query credential generation, and may specifically include:
[0144] Step S301: In response to a data query request, record query parameters generated for querying the current distributed system.
[0145] Step S302: Generate a query credential by combining the parameters determined by combining the query parameters.
[0146] In this embodiment, the specific implementation process of step S301 may include:
[0147] Step S301-1: determining a custom combination format according to the application service version information to which the data query request belongs;
[0148] Step S301-2: combining the query parameters according to the custom combination format to determine a parameter combination string;
[0149] Step S301 - 3: Generate the query credential according to the parameter combination character string.
[0150] In this embodiment, the specific implementation process of step S301 may also include:
[0151] The parameter combination is encrypted to determine the encrypted parameter combination; based on the above step S301-2, the parameter combination string can be encrypted to determine the encrypted parameter combination string.
[0152] The query credential is generated according to the encryption parameter combination; it may be generated according to the encryption parameter combination string. Specifically, the specified application encoding version information of the current distributed system is added to the encryption parameter combination; the query credential is generated according to the encryption parameter combination with the version information added.
[0153] The above is a description of an embodiment of a data query method based on a distributed system provided by the present application. For details about the method, reference may be made to the contents of steps S101 to S102 above, which will not be described in detail here.
[0154] The above is a specific description of an embodiment of a data query method based on a distributed system provided by the present application. Corresponding to the embodiment of a data query method based on a distributed system provided above, the present application also discloses an embodiment of a data query device based on a distributed system. Please refer to Figure 4 Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described below is only illustrative.
[0155] like Figure 4 As shown, Figure 4 : is a schematic diagram of a structure of a data query device embodiment based on a distributed system provided by the present application, and the device embodiment includes:
[0156] The recording unit 401 is used to record the query parameters generated for querying the current distributed system in response to the data query request.
[0157] The generating unit 402 is used to combine the parameters determined by combining the query parameters to generate a query credential.
[0158] Among them, the generating unit 402 may include: a determining subunit and a combining subunit; the determining subunit is used to determine a custom combination format according to the application service version information to which the data query request belongs; the combining subunit is used to combine the query parameters according to the custom combination format to determine a parameter combination string; the generating unit 402 can specifically be used to generate the query credential according to the parameter combination string.
[0159] To improve security, in this embodiment, the generation unit 402 may also include: an encryption subunit, used to encrypt the parameter combination and determine the encryption parameter combination; the generation unit 402 is specifically used to generate the query credential according to the encryption parameter combination.
[0160] To improve the flexibility of the query, in this embodiment, the generating unit 402 may further include: an adding subunit, which is used to add the specified application coding version information in the current distributed system to the encryption parameter combination. The generating unit 402 is specifically used to generate the query credential according to the encryption parameter combination with the added version information.
[0161] The above is a description of an embodiment of a data query device based on a distributed system provided in the present application. For the specific content of the embodiment of the device, please refer to the description of the above step 101 and step S102, as well as the content of the above recording unit 201 and generation unit 202, which will not be repeated here.
[0162] Based on the above content, the present application also provides a data query method based on a distributed system, which is mainly described from the perspective of parsing query credentials, such as Figure 5 As shown, Figure 5 : is a flow chart of an embodiment of a data query method based on a distributed system provided by the present application, and the embodiment of the method includes:
[0163] Step S501: In response to a data query request, a query credential is obtained; wherein the query credential is generated based on historical query parameters generated by a distributed system.
[0164] Step S502: Determine the distributed system information to be queried and the parameters to be queried according to the query credentials.
[0165] The specific implementation process of step S502 may include:
[0166] Step S502-1: Obtain the specified application coding version information in the query credential;
[0167] Step S502-2: Determine a decoding method according to the specified application encoding version information;
[0168] Step S502-3: Decode the query credential according to the decoding method to obtain the parameter combination; specifically, it may include: determining whether the decoded parameter combination needs to be decrypted; if so, perform the decryption operation according to the decryption method corresponding to the encryption method of the parameter combination.
[0169] Step S502-4: Determine the distributed system information to be queried and the parameters to be queried according to the separation processing of the parameter combination; specifically, the parameter combination may be separated according to the combination mode to determine the distributed system information to be queried and the parameters to be queried.
[0170] For the contents of step S501 and step S502, reference may be made to the contents of step S103 to step S104, which will not be repeated here.
[0171] Based on the above content, the present application also provides a data query device based on a distributed system, such as Figure 6 As shown, Figure 6 : is a schematic diagram of a structure of a data query device embodiment based on a distributed system provided by the present application, and the device embodiment includes:
[0172] The acquisition unit 601 is used to acquire a query credential in response to a data query request; wherein the query credential is generated based on historical query parameters generated by a distributed system.
[0173] The determination unit 602 is used to determine the distributed system information to be queried and the parameters to be queried according to the query credential.
[0174] The determining unit 602 may include: an acquiring subunit, a determining subunit, a decoding subunit and a separating subunit;
[0175] The acquisition subunit is used to acquire the specified application coding version information in the query credential;
[0176] The determining subunit is used to determine a decoding method according to the specified application encoding version information;
[0177] The decoding subunit is used to decode the query credential according to the decoding method to obtain the parameter combination;
[0178] The separation subunit is used to determine the distributed system information to be queried and the parameters to be queried according to the separation processing of the parameter combination.
[0179] It may also include: a decryption determination unit and a decryption unit, wherein the decryption determination unit is used to determine whether the decoded parameter combination needs to be decrypted; and the decryption unit is used to perform the decryption operation according to the decryption method corresponding to the encryption method of the parameter combination when the determination result of the decryption determination unit is yes.
[0180] The separation subunit may be specifically configured to separate the parameter combination according to a combination method, and determine the distributed system information to be queried and the parameters to be queried.
[0181] For the specific contents of the acquisition unit 601 and the determination unit 602, reference may be made to the contents of the acquisition unit 203 and the determination unit 204 in the recording unit 201 to the determination unit 204, which will not be repeated here.
[0182] Based on the above content, in the route query scenario, for example: the created VPC network can include multiple route tables. Each item in the route table is a route entry. The route entry includes the target network segment, next hop type, next hop, etc. The target network segment is the IP address range to which the network traffic is expected to be transmitted; the next hop type is the cloud product used to transmit the network traffic, such as ECS instance, VPN gateway or auxiliary elastic network card; the next hop is the specific cloud product instance selected to transmit the network traffic. The route entries include system routes, custom routes and dynamic routes.
[0183] The system routes are usually not modifiable. For example, if you create a VPC with a network segment of 192.168.0.0 / 16 and two switches with network segments of 192.168.1.0 / 24 and 192.168.0.0 / 24 under the VPC, the routing table of the VPC will have the following three system routes. The "-" in the table means they are not involved.
[0184]
[0185] The custom route can also be called a static route. The user can replace the system route or route the target traffic to a specified destination by adding a custom route. For example, the user can manually configure the destination IP address, the target network segment of the IP address, the next hop type and other data.
[0186] The dynamic routing is the routing learned through the cloud enterprise network or the routing learned through the VPN gateway and the border router BGP routing protocol.
[0187] The three types of routing scenarios have different sources, and the specific routing data are not stored in the same database, which can be understood as three systems. Therefore, when querying routing information, it is necessary to cross systems. Users can specify the routes of all systems to query, specify the number of queries each time, the query order, etc. For example: first the system route, then the custom route, and then the dynamic route query order.
[0188] Therefore, the present application can also provide a routing query method in combination with specific application scenarios, such as Figure 7 As shown, Figure 7 : is a flowchart of an embodiment of a routing query method provided by the present application, and the embodiment includes:
[0189] Step S701: obtaining a first routing query request, wherein the routing query request carries a query order for specifying a routing system to be queried;
[0190] Step S702: querying the first routing system according to the query sequence;
[0191] Step S703: Recording query routing parameters generated for querying the first routing system;
[0192] Step S704: Combine the routing parameters determined by combining the query routing parameters to generate a query credential; specifically, the combination can be performed according to a custom combination format, for example: combining and splicing according to the query routing type + routing query page number + routing query quantity + data query ID.
[0193] Step S705: In response to the second routing query request, determine whether to enter the second routing system for query according to the acquired query credentials and the order of the designated query routing systems;
[0194] Step S706: If yes, query the second routing system according to the query credential.
[0195] In this embodiment, the routing system includes at least two. When there are three or more routing systems, it is also necessary to record the query parameters of the current query routing system and generate query credentials for the next query routing system.
[0196] The specific contents of the above steps S701 to S706 can be combined with the description of the above steps S101 to S104, and will not be described in detail here.
[0197] Based on the above content, the present application also provides a route query device, such as Figure 8 As shown, Figure 8 : is a schematic diagram of a structure of a route query device embodiment provided by the present application; the device embodiment includes:
[0198] An acquiring unit 801 is configured to acquire a routing query request, wherein the routing query request carries a query order for specifying a query routing system;
[0199] A first query unit 802, configured to query a first routing system according to the query sequence;
[0200] A recording unit 803, configured to record query parameters generated for querying the first routing system;
[0201] A generating unit 804, configured to combine the routing parameters determined by combining the query routing parameters to generate a query credential;
[0202] A determination unit 805, configured to determine whether to enter the second routing system for query according to the query credential and the order of the designated query routing system;
[0203] The second query unit 806 is configured to query the second routing system according to the query credential if yes.
[0204] Regarding the above content, please refer to the description of the above steps S701 to S706 and the above steps S101 to S104, which will not be described in detail here.
[0205] Based on the above content, the present application also provides a computer storage medium for storing data generated by a network platform, and a program for processing the data generated by the network platform;
[0206] When the program is read and executed by the processor, it executes the steps of the above-mentioned data query method embodiment based on a distributed system; or, executes the steps of the above-mentioned data query method embodiment based on a distributed system; or, executes the steps of the above-mentioned data query method embodiment based on a distributed system; or, executes the steps of the above-mentioned routing query method embodiment.
[0207] Based on the above content, the present application also provides an electronic device, such as Fig. 9 As shown, the electronic device embodiment may include:
[0208] Processor 901;
[0209] Memory 902 is used to store a program for processing data generated by a network platform. When the program is read and executed by the processor, it executes the steps of the above-mentioned data query method embodiment based on a distributed system; or, executes the steps of the above-mentioned data query method embodiment based on a distributed system; or, executes the steps of the above-mentioned data query method embodiment based on a distributed system; or, executes the steps of the above-mentioned routing query method embodiment.
[0210] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0211] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0212] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0213] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0214] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
Claims
1. A data query method based on a distributed system, characterized in that: include: Obtaining a first routing query request, wherein the first routing query request carries a query order for specifying a query routing system; querying the first routing system according to the query order; Recording query routing parameters generated for querying the first routing system, the query routing parameters including: at least one parameter of the system source of the first routing system, the number of pages queried, and the number of queries; Generate a query credential based on a parameter combination determined by combining the query routing parameters; In response to the second data query request, determining whether to enter the second routing system for query according to the acquired query credentials and the order of the designated query routing systems; If so, query the second routing system according to the query credential.
2. The data query method based on a distributed system according to claim 1, characterized in that: The step of generating a query credential by combining the query routing parameters to determine the parameter combination includes: Determine a custom combination format according to the application service version information to which the first routing query request belongs; Combining the query routing parameters according to the custom combination format to determine a parameter combination string; The query credential is generated according to the parameter combination character string.
3. The data query method based on a distributed system according to claim 1, characterized in that: The generating of the query credential by combining the determined parameter combination according to the query routing parameters also includes: Encrypting the parameter combination to determine the encryption parameter combination; The query credential is generated according to the encryption parameter combination.
4. The data query method based on a distributed system according to claim 3 is characterized in that: The step of generating the query credential according to the encryption parameter combination further comprises: In the encryption parameter combination, add the specified application encoding version information in the current distributed system; The query credential is generated according to the encryption parameter combination with the version information added thereto.
5. A computer storage medium for storing data generated by a network platform and a program for processing the data generated by the network platform; When the program is read and executed by a processor, the distributed system-based data query method as described in any one of claims 1 to 4 is executed.
6. An electronic device comprising: processor; A memory for storing a program for processing data generated by a network platform, wherein when the program is read and executed by the processor, the data query method based on a distributed system as described in any one of claims 1 to 4 above is executed.
Citation Information
Patent Citations
Information security interaction method and device
CN113704580A