Data processing method and device, electronic equipment and storage medium
By introducing a data access layer and middleware request mechanism, and using a data routing parameter table to determine the target invocation method, the problem of inflexible data retrieval from different storage locations in the online system is solved, thus improving the system's flexibility and stability.
Patent Information
- Application Number
- CN202210997643.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-08-19
AI Technical Summary
In existing technologies, the business layer of online systems needs to directly access the database, which requires extensive modifications to the business layer when database table data deployment changes. This affects flexibility and increases the risk of errors, making it impossible to flexibly access data stored in different locations within the database.
A data access layer is introduced, which determines the target invocation method through the middleware's request reception and data routing parameter table, and performs serialization and deserialization processing to achieve flexible invocation of target data.
By determining the target invocation method through the data routing parameter table, flexible invocation of data in different storage locations in the database is achieved, simplifying the data invocation process and reducing the risk of changes to the business layer.
Smart Images

Figure CN115357653B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and more particularly, to a data processing method and device, electronic equipment, storage medium and computer program product. BACKGROUND
[0002] The architecture of most online systems is designed many years ago, usually without a data access layer, and the business layer needs to be directly used to access the database, which causes that in the case of changes in the data deployment of the tables in the database, a large number of changes need to be made to the business layer, so that the flexibility of business development is poor, the workload of the development personnel is increased, and the risk of error is also high. Therefore, a data access layer needs to be introduced to optimize the architecture of the online system.
[0003] In the process of implementing the present disclosure, the inventors found that at least the following problems exist in the related art: In the related art, the data access layer can only call the data in the database by modifying the business logic layer, and flexible calling of data in different storage locations in the database cannot be achieved. SUMMARY
[0004] Therefore, the present disclosure provides a data processing method and device, electronic equipment, storage medium and computer program product.
[0005] One aspect of the present disclosure provides a data processing method, comprising:
[0006] receiving a request for calling target data from a middleware, wherein the request comprises communication information related to the target data;
[0007] determining a target calling mode of the target data from a data routing parameter table based on the communication information;
[0008] calling the target data according to the target calling mode; and
[0009] sending the target data to the middleware, so that the middleware sends the target data to a business logic layer.
[0010] According to an embodiment of the present disclosure, wherein the determining the target calling mode of the target data from the data routing parameter table based on the communication information comprises:
[0011] determining a storage location of the target data from the communication information;
[0012] in a case where the storage location of the target data is consistent with a first predetermined storage location, determining a first target calling mode of the target data from the data routing parameter table, wherein the first predetermined storage location comprises an off-site database or cache matched with an off-site middleware, and the off-site middleware is a middleware located in a different partition from the middleware;
[0013] In a case where the storage location of the target data is consistent with a second predetermined storage location, a second target invocation manner of the target data is determined from the data routing parameter table, wherein the second predetermined storage location comprises a local database matched with the middleware.
[0014] According to an embodiment of the present disclosure, wherein the storage location of the target data is determined from the communication information, comprising:
[0015] The table name information of the target data is determined from the communication information; and
[0016] The storage location of the target data is determined from the data routing parameter table based on the table name information.
[0017] According to an embodiment of the present disclosure, wherein the target invocation manner comprises a first target invocation manner;
[0018] The target data is invoked according to the target invocation manner, comprising:
[0019] The input variable data of the target data is determined from the communication information;
[0020] The input variable data is serialized to obtain target input variable data;
[0021] The output variable data is obtained from the first predetermined storage location based on the target input variable data; and
[0022] The output variable data is deserialized to obtain the target data.
[0023] According to an embodiment of the present disclosure, wherein the input variable data is serialized to obtain the target input variable data, comprising:
[0024] The communication mapping table is obtained, wherein the communication mapping table comprises format information of the input variable data matched with the storage location; and
[0025] The input variable data is serialized based on the communication mapping table to obtain the target input variable data matched with the format of the storage location.
[0026] According to an embodiment of the present disclosure, wherein the output variable data is deserialized to obtain the target data, comprising:
[0027] The communication mapping table is obtained, wherein the communication mapping table comprises format information of the output variable data matched with the storage location; and
[0028] The output variable data is deserialized based on the communication mapping table to obtain the target data matched with the business logic layer.
[0029] According to an embodiment of the present disclosure, the target invocation manner includes a second target invocation manner.
[0030] According to the target invocation manner, the target data is invoked, and the method further includes:
[0031] The input variable data of the target data is determined from the communication information; and
[0032] Based on the input variable data, the output variable data is obtained from a second predetermined storage location, and the output variable data is taken as the target data.
[0033] Another aspect of the present disclosure provides a data processing apparatus, including:
[0034] A receiving module is configured to receive a request for invoking target data from middleware, wherein the request includes communication information related to the target data;
[0035] A determining module is configured to determine a target invocation manner of the target data from a data routing parameter table based on the communication information;
[0036] An invoking module is configured to invoke the target data according to the target invocation manner; and
[0037] A sending module is configured to send the target data to the middleware, so that the middleware sends the target data to a business logic layer.
[0038] Another aspect of the present disclosure provides an electronic device, including: one or more processors; a memory configured to store one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the above-mentioned data processing method.
[0039] Another aspect of the present disclosure provides a computer-readable storage medium, which stores computer-executable instructions, and the instructions, when executed by a processor, cause the processor to implement the above-mentioned data processing method.
[0040] Another aspect of the present disclosure provides a computer program product, which includes computer-executable instructions, and the instructions, when executed, are used to implement the above-mentioned data processing method.
[0041] According to the embodiments of the present disclosure, because the technical means of receiving a request for calling target data from middleware, determining a target calling mode of the target data from a data routing parameter table based on the communication information, calling the target data according to the target calling mode, and sending the target data to the middleware so that the middleware sends the target data to the business logic layer is adopted, the target data can be called through the target calling mode determined in the data routing parameter table, thereby realizing flexible calling of the target data, and at least partially overcoming the technical problem that data in different storage locations in the database cannot be flexibly called in the related art. BRIEF DESCRIPTION OF DRAWINGS
[0042] The above and other objects, features and advantages of the present disclosure will become more apparent from the following description when taken in conjunction with the accompanying drawings, in which:
[0043] Figure 1 An exemplary system architecture to which the data processing method and apparatus according to embodiments of the present disclosure can be applied is schematically shown;
[0044] Figure 2 A flowchart of a data processing method according to embodiments of the present disclosure is schematically shown;
[0045] Figure 3 A flowchart of a data processing method according to yet another embodiment of the present disclosure is schematically shown;
[0046] Figure 4 A block diagram of a data processing system according to embodiments of the present disclosure is schematically shown
[0047] Figure 5 A block diagram of a data processing apparatus according to embodiments of the present disclosure is schematically shown; and
[0048] Figure 6 A block diagram of a computer system suitable for implementing the above-described data processing method according to embodiments of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0049] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. However, it will be apparent to one skilled in the art that one or more embodiments can be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques have been omitted to avoid unnecessarily obscuring the concept of the present disclosure.
[0050] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the terms "comprises", "comprising", "includes", "including" and the like are specifically intended to be open-ended terms meaning that other elements can be added.
[0051] All terms used herein including technical and scientific terms have the meanings commonly understood by one of ordinary skill in the art unless otherwise specified. It should be noted that the terms used herein are not intended to have their ideally or overly formal meanings, but should be interpreted in a manner consistent with the context of the present specification.
[0052] In the case where expressions such as "at least one of A, B, and C, etc." are used, it generally should be interpreted that the meaning is "at least one of A, B, and C, etc." in the way that is generally understood by a person of ordinary skill in the art (for example, "a system having at least one of A, B, and C" should include but not be limited to a system having A alone, a system having B alone, a system having C alone, a system having both A and B, a system having both A and C, a system having both B and C, and / or a system having A, B, and C, etc.). In the case where expressions such as "at least one of A, B, or C, etc." are used, it generally should be interpreted that the meaning is "at least one of A, B, and C, etc." in the way that is generally understood by a person of ordinary skill in the art (for example, "a system having at least one of A, B, or C" should include but not be limited to a system having A alone, a system having B alone, a system having C alone, a system having both A and B, a system having both A and C, a system having both B and C, and / or a system having A, B, and C, etc.).
[0053] In the related art, in large online systems, most of them adopt a hierarchical architecture design, in which a business layer can access a database through a data access layer. When the deployment of the database is changed (for example, the data of a table is loaded into a cache database), it is necessary to manually analyze the data access operations involved in the data access layer, modify the program code of the business layer, and manually change the structured query language (SQL) for accessing the database to the interface of the data access layer. The business layer is mostly developed and designed many years ago, and a large number of programs are involved. Directly modifying the business layer can easily damage the processing flow of the business logic, and the influence is large.
[0054] Therefore, embodiments of the present disclosure provide a data processing method. The method includes receiving a request for calling target data from middleware, wherein the request includes communication information related to the target data; determining a target calling mode of the target data from a data routing parameter table based on the communication information; calling the target data according to the target calling mode; and sending the target data to the middleware, so that the middleware sends the target data to a business logic layer.
[0055] According to an embodiment of the present disclosure, the target data can be called by the target calling mode determined in the data routing parameter table, so as to realize flexible calling of the target data, and at least partially overcome the technical problem that the data in different storage locations in the database cannot be flexibly called in the related art.
[0056] Figure 1 An exemplary system architecture 100 to which the data processing method and apparatus according to an embodiment of the present disclosure can be applied is schematically shown. It should be noted that, Figure 1 The shown is only an example of the system architecture to which the embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0057] As Figure 1 shown, the system architecture 100 according to the embodiment can include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is a medium for providing a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired and / or wireless communication links, etc.
[0058] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).
[0059] The terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers and desktop computers, etc.
[0060] The server 105 can be a server providing various services, such as a background management server providing support for the website browsed by the user using the terminal devices 101, 102, 103 (only as an example). The background management server can analyze and process the received user request data, etc., and feed back the processing result (such as a webpage, information or data, etc. obtained or generated according to the user request) to the terminal device.
[0061] It should be noted that the data processing method provided by the embodiments of the present disclosure can be generally executed by the server 105. Correspondingly, the data processing apparatus provided by the embodiments of the present disclosure can be generally arranged in the server 105. The data processing method provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal device 101, 102, 103 and / or the server 105. Correspondingly, the data processing apparatus provided by the embodiments of the present disclosure can also be arranged in a server or a server cluster different from the server 105 and capable of communicating with the terminal device 101, 102, 103 and / or the server 105.
[0062] For example, the data routing parameter table can be originally stored in the server 105. Then, the server 105 can execute the data processing method provided by the embodiments of the present disclosure locally, or send the data routing parameter table to other servers or server clusters, and execute the data processing method provided by the embodiments of the present disclosure by the other servers or server clusters receiving the target data.
[0063] It should be understood that Figure 1 The number of terminal devices, networks and servers in the above description is only illustrative. According to the implementation needs, there can be any number of terminal devices, networks and servers.
[0064] Figure 2 A flowchart of a data processing method according to an embodiment of the present disclosure is schematically shown.
[0065] As shown in Figure 2 The method includes operations S201-S204.
[0066] In operation S201, a request for calling target data from middleware is received, wherein the request includes communication information related to the target data.
[0067] According to an embodiment of the present disclosure, the target data can be a structured query language (SQL) in a database. The middleware (CICS, Custom Information Control System) can be a system for processing transaction services in an online system, which can process, for example, a transfer transaction service, a withdrawal transaction service, etc.
[0068] In operation S202, based on the communication information, a target calling mode of the target data is determined from a data routing parameter table.
[0069] According to an embodiment of the present disclosure, the data routing parameter table can include information related to the calling target data, so as to determine the target calling mode of the target data. For example, the information related to the calling target data in the data routing parameter table is A interface information, and it can be determined that the target calling mode of the target data is an A target calling mode corresponding to the A interface information.
[0070] In operation S203, the target data is called according to the target calling mode.
[0071] According to an embodiment of the present disclosure, the target data can be called according to the target calling mode. For example, the target calling mode is an A target calling mode corresponding to A interface information, and the target data is called according to the A target interface calling mode.
[0072] In operation S204, the target data is sent to the middleware, so that the middleware sends the target data to the business logic layer.
[0073] According to an embodiment of the present disclosure, the middleware can send the called target data to the business logic layer.
[0074] According to an embodiment of the present disclosure, because the technical means of receiving a request for calling target data from the middleware, determining the target calling mode of the target data from the data routing parameter table based on the communication information, calling the target data according to the target calling mode, and sending the target data to the middleware so that the middleware sends the target data to the business logic layer are adopted, the target data can be called through the target calling mode determined in the data routing parameter table, so that flexible calling of the target data is realized, and at least part of the technical problems that data in different storage locations in the database cannot be flexibly called in the related art are overcome.
[0075] According to an embodiment of the present disclosure, wherein the target calling mode of the target data is determined from the data routing parameter table based on the communication information, comprising:
[0076] determining the storage location of the target data from the communication information;
[0077] in a case where the storage location of the target data is consistent with a first predetermined storage location, determining a first target calling mode of the target data from the data routing parameter table, wherein the first predetermined storage location includes an off-site database or cache matched with an off-site middleware, and the off-site middleware is a middleware located in a different partition from the middleware;
[0078] in a case where the storage location of the target data is consistent with a second predetermined storage location, determining a second target calling mode of the target data from the data routing parameter table, wherein the second predetermined storage location includes a local database matched with the middleware.
[0079] According to an embodiment of the present disclosure, the communication information can be information related to the storage location of the target data.
[0080] According to an embodiment of the present disclosure, when the storage location of the target data is consistent with the first predetermined storage location, that is, the storage location of the target data is a remote database or cache matched with the remote middleware, the target data can be invoked in the first target invocation mode, that is, the target data is invoked from the remote database or cache matched with the remote middleware.
[0081] According to an embodiment of the present disclosure, when the storage location of the target data is consistent with the second predetermined storage location, that is, the storage location of the target data is a local database matched with the middleware, the target data can be invoked in the second target invocation mode, that is, the target data is invoked from the local database matched with the middleware.
[0082] According to an embodiment of the present disclosure, by matching the storage location of the target data, the target invocation mode corresponding to the target data stored in different storage locations is determined, so that the target data can be quickly invoked through the corresponding target invocation mode when the target data is invoked. Thus, flexible invocation can be realized, and the application processing level of the data is expanded.
[0083] According to an embodiment of the present disclosure, wherein the storage location of the target data is determined from the communication information, comprising:
[0084] The table name information of the target data is determined from the communication information; and
[0085] The storage location of the target data is determined from the data routing parameter table based on the table name information.
[0086] According to an embodiment of the present disclosure, the communication information can include the table name information of the target data. For example, the communication information can be a Select statement, a Delete statement, an Update statement, etc. of the target data. The table name information of the Select statement or the Delete statement can be determined by the first field after the keyword From in the statement, and the table name information of the Update statement can be determined by the first field after the keyword Update in the statement.
[0087] According to an embodiment of the present disclosure, the data routing parameter table can be a table of the correspondence between the table name information of the target data and the storage location.
[0088] According to an embodiment of the present disclosure, the storage location of the target data can be determined in the data routing parameter table through the table name information of the target data, so that the target data is called according to the target calling mode matched with the storage location. Based on the data routing parameter table, the calling of the target data can be made simple and easy to handle.
[0089] Figure 3 A flowchart of a data processing method according to yet another embodiment of the present disclosure is schematically shown.
[0090] As shown in Figure 3 , the method comprises operation S301 to operation S304.
[0091] In operation S301, the input variable data of the target data is determined from the communication information.
[0092] In operation S302, the input variable data is serialized to obtain target input variable data.
[0093] In operation S303, the output variable data is obtained from the first predetermined storage location based on the target input variable data.
[0094] In operation S304, the output variable data is deserialized to obtain the target data.
[0095] According to an embodiment of the present disclosure, the target calling mode comprises a first target calling mode,
[0096] According to an embodiment of the present disclosure, the input variable data of the target data can be the input variable data (SQL-PVAR-LIST) of the SQL statement. The SQL-PVAR-LIST can be composed of a SQL descriptor area header (SQLDA Header) and SQL variable entries (SQLVAR entries).
[0097] According to an embodiment of the present disclosure, the serialization of the input variable data can be the format conversion of the input variable data of the SQL statement to obtain the target input variable data, and the target input variable data can be the data for calling the database interface.
[0098] According to an embodiment of the present disclosure, the output variable data can be the data stored in the database, and the first predetermined storage location of the output variable data in the database can be determined through the input variable data of the target data, that is, the data for calling the database interface, so that the output variable data is obtained from the first predetermined storage location,
[0099] According to an embodiment of the present disclosure, the deserialization of the output variable data can be the format conversion of the output variable data, so as to obtain the target data.
[0100] According to an embodiment of the present disclosure, in the case that the target data is stored in a remote database or cache matched with the remote middleware, the target data can be called flexibly in the remote database or cache by calling the target data through the first calling target calling mode.
[0101] According to an embodiment of the present disclosure, the serialization processing on the input variable data to obtain the target input variable data comprises:
[0102] The communication mapping table is obtained, wherein the communication mapping table comprises format information of the input variable data matched with the storage location; and
[0103] The input variable data is serialized based on the communication mapping table to obtain the target input variable data matched with the format of the storage location.
[0104] According to an embodiment of the present disclosure, the format information of the input variable data can comprise the number and length of the input variable, the input variable length of the SQLDA Header is 16 bytes, the SQLVAR entries comprise the description information (variable type, variable length and storage location of the variable, i.e. 12-layer variable SQLVAR-BASE in the PLIST) of each input variable, and the description information of each input variable occupies 44 bytes.
[0105] According to an embodiment of the present disclosure, the format information of the input variable data matched with the storage location can be queried through the communication mapping table.
[0106] According to an embodiment of the present disclosure, the format information of the input variable data can be determined through the communication mapping table, the input variable data is serialized, which can be converting the format of the input variable data, so as to obtain the target input variable data matched with the format of the storage location. For example, the storage location of the SQL statement in the input variable data is obtained, the variable type and variable length of the input variable corresponding to the SQL statement in the storage location are converted, and the target input variable data matched with the format of the storage location is obtained, so that the output variable data can be obtained from the storage location based on the target input variable data.
[0107] According to an embodiment of the present disclosure, the input variable data is converted through the communication mapping table, so that the target input variable data matched with the format of the storage location can be accurately obtained.
[0108] According to an embodiment of the present disclosure, the deserialization processing on the output variable data to obtain the target data comprises:
[0109] The communication mapping table is obtained, wherein the communication mapping table comprises format information of the output variable data matched with the storage location; and
[0110] Based on the communication mapping table, the output variable data is deserialized to obtain target data matching the business logic layer.
[0111] According to an embodiment of the present disclosure, the format information of the output variable data matching the storage location can be queried through the communication mapping table, and the format information of the output variable data can be the same as the format information of the target input variable data, which will not be described here.
[0112] According to an embodiment of the present disclosure, in the case that the output variable data is stored in an off-site database or cache, the format of the output variable data can be converted to be consistent with the format of the input variable data through the communication mapping table, so as to generate target data matching the business logic layer.
[0113] According to an embodiment of the present disclosure, the output variable data is deserialized to obtain target data matching the business logic layer, so that the business logic layer can receive the target data.
[0114] According to an embodiment of the present disclosure, the target calling mode includes a second target calling mode.
[0115] According to the target calling mode, the target data is called, and further includes:
[0116] The input variable data of the target data is determined from the communication information; and
[0117] Based on the input variable data, the output variable data is obtained from the second predetermined storage location, and the output variable data is taken as the target data.
[0118] According to an embodiment of the present disclosure, in the case that the target data is stored in the second predetermined storage location, that is, in the case that the target data is stored in the local database, the interface of the local database can be directly accessed according to the input variable data to obtain the output variable data of the SQL statement from the local database, and the output variable data is taken as the target data.
[0119] According to an embodiment of the present disclosure, in the case that the target data is stored in the local database, the output variable data of the second predetermined storage location can be directly called according to the input variable data, so that the target data can be quickly called.
[0120] Figure 4 A flowchart of a data processing method according to an embodiment of the present disclosure is schematically shown.
[0121] As shown in Figure 4 the method can include operation S401 to operation S408.
[0122] In operation S401, the target file is linked with the middleware.
[0123] In operation S402, the target file is activated to form a data access layer.
[0124] In operation S403, the data access layer is used to receive a request for calling target data from the middleware.
[0125] In operation S404, based on the communication information related to the target data, a first target calling mode of the target data is determined from a data routing parameter table.
[0126] In operation S405, input variable data of the target data is determined from the communication information.
[0127] In operation S406, the input variable data is serialized to obtain target input variable data.
[0128] In operation S407, based on the target input variable data, output variable data is obtained from a first predetermined storage location.
[0129] In operation S408, the output variable data is deserialized to obtain the target data.
[0130] According to an embodiment of the present disclosure, the communication information related to the target data can include table name information of the target data, and the storage location of the target data can be determined through the table name information.
[0131] According to an embodiment of the present disclosure, the target calling mode of the target data can be determined by a data routing access module. The data routing access module can include a data routing parameter table, and the target calling mode of the target data can be determined from the storage location of the target data through the data routing parameter table.
[0132] According to an embodiment of the present disclosure, the input variable data can be serialized by a serialization module to obtain the target input variable data. For example, the format of the input variable data can be converted to obtain the target input variable data matching the format of the storage location.
[0133] According to an embodiment of the present disclosure, the output variable data of the target data can be obtained from the first predetermined storage location by a data access layer calling module.
[0134] According to an embodiment of the present disclosure, the output variable data can be deserialized by a deserialization module to obtain the target data. For example, the format of the output variable data can be converted to obtain the target data matching the business logic layer.
[0135] According to an embodiment of the present disclosure, based on the communication information of the target data, the target calling mode of the target data can be determined from the data routing parameter table, the input variable data of the target data can be converted into target input variable data through the serialization module, the output variable data can be called through the data access layer calling module according to the target calling mode, and the output variable data can be converted into the target data matched with the business logic layer through the deserialization module, so as to realize flexible calling of the target data in different storage locations.
[0136] Figure 5 A block diagram of a data processing apparatus 500 according to an embodiment of the present disclosure is schematically shown.
[0137] As shown in Figure 5 The data processing apparatus 500 includes a receiving module 510, a determining module 520, a calling module 530, and a sending module 540.
[0138] The receiving module 510 is configured to receive a request for calling target data from middleware, wherein the request includes communication information related to the target data.
[0139] The determining module 520 is configured to determine a target calling mode of the target data from a data routing parameter table based on the communication information.
[0140] The calling module 530 is configured to call the target data according to the target calling mode.
[0141] The sending module 540 is configured to send the target data to the middleware, so that the middleware sends the target data to a business logic layer.
[0142] According to an embodiment of the present disclosure, because the request for calling target data from middleware is received, the target calling mode of the target data is determined from a data routing parameter table based on communication information, the target data is called according to the target calling mode, and the target data is sent to the middleware so that the middleware sends the target data to a business logic layer, the target data can be called through the target calling mode determined in the data routing parameter table, so as to realize flexible calling of the target data, and at least partially overcome the technical problem that data in different storage locations in a database cannot be flexibly called in the related art. According to an embodiment of the present disclosure, the determining module 520 for determining the target calling mode of the target data from the data routing parameter table based on the communication information includes:
[0143] A first determining unit is configured to determine a storage location of the target data from the communication information.
[0144] The second determining unit is configured to determine, from the data routing parameter table, a first target calling mode of the target data when the storage location of the target data is consistent with a first predetermined storage location, wherein the first predetermined storage location comprises an offsite database or cache matched with offsite middleware, and the offsite middleware is middleware located in a different partition from the middleware.
[0145] The third determining unit is configured to determine, from the data routing parameter table, a second target calling mode of the target data when the storage location of the target data is consistent with a second predetermined storage location, wherein the second predetermined storage location comprises a local database matched with the middleware.
[0146] According to an embodiment of the present disclosure, the first determining unit for determining the storage location of the target data from the communication information comprises:
[0147] The first determining sub-unit is configured to determine table name information of the target data from the communication information; and
[0148] The second determining sub-unit is configured to determine, based on the table name information, the storage location of the target data from the data routing parameter table.
[0149] According to an embodiment of the present disclosure, the target calling mode comprises a first target calling mode, and the calling module 530 for calling the target data according to the target calling mode comprises:
[0150] The first calling unit is configured to determine input variable data of the target data from the communication information;
[0151] The second calling unit is configured to perform serialization processing on the input variable data to obtain target input variable data;
[0152] The third calling unit is configured to obtain output variable data from the first predetermined storage location based on the target input variable data; and
[0153] The fourth calling unit is configured to perform deserialization processing on the output variable data to obtain the target data.
[0154] According to an embodiment of the present disclosure, the second calling unit for performing serialization processing on the input variable data to obtain the target input variable data comprises:
[0155] The first calling sub-unit is configured to obtain a communication mapping table, wherein the communication mapping table comprises format information of the input variable data matched with the storage location; and
[0156] The second calling sub-unit is configured to perform serialization processing on the input variable data based on the communication mapping table to obtain target input variable data matched with the format of the storage location.
[0157] According to an embodiment of the present disclosure, the fourth calling unit for deserializing the output variable data to obtain the target data comprises:
[0158] The third calling sub-unit is configured to acquire a communication mapping table, wherein the communication mapping table comprises format information of the output variable data matched with the storage location.
[0159] The fourth calling sub-unit is configured to deserialize the output variable data based on the communication mapping table to obtain the target data matched with the business logic layer.
[0160] According to an embodiment of the present disclosure, the target calling mode comprises a second target calling mode, and the calling module 530 for calling the target data according to the target calling mode further comprises:
[0161] The fifth calling unit is configured to determine the input variable data of the target data from the communication information.
[0162] The sixth calling unit is configured to acquire the output variable data from the second predetermined storage location based on the input variable data, and take the output variable data as the target data.
[0163] Any one or more of the modules, sub-modules, units, sub-units according to the embodiments of the present disclosure, or at least part of the functions of any one or more of the modules, sub-modules, units, sub-units, can be implemented in one module. Any one or more of the modules, sub-modules, units, sub-units according to the embodiments of the present disclosure can be split into multiple modules for implementation. Any one or more of the modules, sub-modules, units, sub-units according to the embodiments of the present disclosure can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on substrate, a system on package, an application specific integrated circuit (ASIC), or any other reasonable way of hardware or firmware through integration or packaging of circuits, or in any one of software, hardware and firmware or in an appropriate combination of any one or more of them. Alternatively, one or more of the modules, sub-modules, units, sub-units according to the embodiments of the present disclosure can be at least partially implemented as computer program modules which can perform corresponding functions when running.
[0164] For example, any of the receiving module 510, the determining module 520, the calling module 530 and the sending module 540 can be combined in one module / unit / sub-unit, or any of the modules / units / sub-units can be split into multiple modules / units / sub-units. Or, at least part of the function of one or more of the modules / units / sub-units can be combined with at least part of the function of other modules / units / sub-units, and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the receiving module 510, the determining module 520, the calling module 530 and the sending module 540 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system on package, an application specific integrated circuit (ASIC), or any other reasonable manner of integrating or packaging a circuit, etc. in hardware or firmware, or in any one of software, hardware and firmware or in a proper combination of any of them. Or, at least one of the receiving module 510, the determining module 520, the calling module 530 and the sending module 540 can be at least partially implemented as a computer program module which can perform the corresponding function when the computer program module is run.
[0165] It should be noted that the data processing apparatus part in the embodiments of the present disclosure corresponds to the data processing method part in the embodiments of the present disclosure, and the description of the data processing apparatus part is specifically referred to the data processing method part, which will not be repeated here.
[0166] Figure 6 A block diagram of a computer system suitable for implementing the data processing method described above according to an embodiment of the present disclosure is schematically shown. Figure 6 The computer system shown is merely an example, and should not bring any limitation to the functions and use range of the embodiments of the present disclosure.
[0167] As Figure 6 shown, the computer system 600 according to an embodiment of the present disclosure includes a processor 601 which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 602 or programs loaded from a storage portion 608 to a random access memory (RAM) 603. The processor 601 can include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset, and / or a special-purpose microprocessor (such as an application specific integrated circuit (ASIC)), etc. The processor 601 can also include an on-board memory for cache use. The processor 601 can include a single processing unit or multiple processing units for performing different actions of the method processes according to the embodiments of the present disclosure.
[0168] In the RAM 603, various programs and data required for the operation of the system 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via the bus 604. The processor 601 performs various operations according to the method flow of the embodiments of the present disclosure by executing the programs stored in the ROM 602 and / or the RAM 603. It is noted that the programs can also be stored in one or more memories other than the ROM 602 and the RAM 603. The processor 601 can also perform various operations according to the method flow of the embodiments of the present disclosure by executing the programs stored in the one or more memories.
[0169] According to the embodiments of the present disclosure, the system 600 can further include an input / output (I / O) interface 605, which is also connected to the bus 604. The system 600 can further include one or more of the following components connected to the I / O interface 605: an input portion 606 including, for example, a keyboard and a mouse; an output portion 607 including, for example, a cathode ray tube (CRT) display, a liquid crystal display (LCD), and a speaker; a storage portion 608 including, for example, a hard disk; and a communication portion 609 including, for example, a LAN card, a modem, and the like. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as necessary. A removable recording medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is attached to the drive 610 as necessary, so that a computer program read therefrom is installed in the storage portion 608 as necessary.
[0170] According to the embodiments of the present disclosure, the method flow according to the embodiments of the present disclosure can be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product comprising a computer program carrying out the method shown in the flowchart, which is stored in a computer readable storage medium. In such embodiments, the computer program can be downloaded from a network via the communication portion 609 and installed, and / or installed from the removable recording medium 611. When the computer program is executed by the processor 601, the above-described functions defined in the system of the embodiments of the present disclosure are performed. According to the embodiments of the present disclosure, the system, the device, the apparatus, the module, the unit, and the like described above can be implemented by computer program modules.
[0171] The present disclosure also provides a computer readable storage medium, which can be included in the device / apparatus / system described in the above embodiments, or can exist separately without being assembled into the device / apparatus / system. The above computer readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present disclosure.
[0172] According to an embodiment of the present disclosure, the computer readable storage medium can be a non-volatile computer readable storage medium. For example, it can include, but is not limited to, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in connection with an instruction execution system, apparatus, or device.
[0173] For example, according to an embodiment of the present disclosure, the computer readable storage medium can include one or more memories other than the ROM 602 and / or the RAM 603 and / or the ROM 602 and the RAM 603 described above.
[0174] Embodiments of the present disclosure also include a computer program product, which includes a computer program containing program codes for executing the method provided by the embodiments of the present disclosure, and when the computer program product is run on an electronic device, the program codes are used to make the electronic device implement the data processing method provided by the embodiments of the present disclosure.
[0175] When the computer program is executed by the processor 601, the above-mentioned functions defined in the system / apparatus of the embodiments of the present disclosure are performed. According to an embodiment of the present disclosure, the system, apparatus, module, unit, etc. described above can be implemented by computer program modules.
[0176] In one embodiment, the computer program can rely on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program can also be transmitted, distributed, and downloaded in the form of a signal on a network medium, and be downloaded and installed through the communication part 609, and / or be installed from the detachable medium 611. The program codes contained in the computer program can be transmitted by any appropriate network medium, including but not limited to wireless, wired, etc., or any suitable combination of the foregoing.
[0177] According to embodiments of the present disclosure, program code of a computer program provided by embodiments of the present disclosure can be written in any combination of one or more programming languages, and specifically, can be implemented using a high-level procedural and / or object-oriented programming language, and / or an assembly / machine language. Programming languages include, but are not limited to, Java, C++, python, "C" language, or similar programming languages. Program code can execute entirely on a user's computing device, partly on a user device, partly on a remote computing device, or entirely on a remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider.
[0178] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.
[0179] The above describes embodiments of the present disclosure. However, these embodiments are merely for illustrative purposes, and are not intended to limit the scope of the present disclosure. Although each embodiment is described above separately, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications shall fall within the scope of the present disclosure.
Claims
1. A data processing method, comprising: Receive a request from middleware to invoke target data, wherein the request includes communication information related to the target data; Based on the communication information, the target invocation method of the target data is determined from the data routing parameter table; The target data is invoked according to the stated target invocation method; and The target data is sent to the middleware, so that the middleware sends the target data to the business logic layer; The step of determining the target invocation method of the target data from the data routing parameter table based on the communication information includes: The storage location of the target data is determined from the communication information; If the storage location of the target data is consistent with the first predetermined storage location, the first target calling method of the target data is determined from the data routing parameter table, wherein the first predetermined storage location includes a remote database or cache that matches the remote middleware, and the remote middleware is a middleware located in a different partition from the middleware. If the storage location of the target data is consistent with the second predetermined storage location, the second target invocation method of the target data is determined from the data routing parameter table, wherein the second predetermined storage location includes a local database that matches the middleware; Determining the storage location of the target data from the communication information includes: Determine the table name information of the target data from the communication information; and Based on the table name information, the storage location of the target data is determined from the data routing parameter table.
2. The method according to claim 1, wherein, The target invocation method includes the first target invocation method; The step of invoking the target data according to the target invocation method includes: The input variable data of the target data are determined from the communication information; The input variable data is serialized to obtain the target input variable data; Based on the target input variable data, output variable data is obtained from the first predetermined storage location; and The output variable data is deserialized to obtain the target data.
3. The method according to claim 2, wherein, The step of serializing the input variable data to obtain the target input variable data includes: Obtain a communication mapping table, wherein the communication mapping table includes format information of input variable data that matches the storage location; and Based on the communication mapping table, the input variable data is serialized to obtain the target input variable data that matches the format of the storage location.
4. The method according to claim 2 or 3, wherein, The step of deserializing the output variable data to obtain the target data includes: Obtain a communication mapping table, wherein the communication mapping table includes format information of output variable data that matches the storage location; and Based on the communication mapping table, the output variable data is deserialized to obtain the target data that matches the business logic layer.
5. The method according to claim 1, wherein, The target invocation method includes the second target invocation method; The step of invoking the target data according to the target invocation method further includes: The input variable data of the target data are determined from the communication information; and Based on the input variable data, output variable data is obtained from the second predetermined storage location, and the output variable data is used as the target data.
6. A data processing apparatus, comprising: A receiving module is configured to receive a request from middleware for invoking target data, wherein the request includes communication information related to the target data; The determination module is used to determine the target invocation method of the target data from the data routing parameter table based on the communication information; The calling module is used to call the target data according to the target calling method; and A sending module is used to send the target data to the middleware, so that the middleware can send the target data to the business logic layer; The determining module includes: The first determining unit is configured to determine the storage location of the target data from the communication information; The second determining unit is used to determine the first target calling method of the target data from the data routing parameter table when the storage location of the target data is consistent with the first predetermined storage location. The first predetermined storage location includes a remote database or cache that matches the remote middleware. The remote middleware is a middleware located in a different partition from the middleware. The third determining unit is used to determine the second target calling method of the target data from the data routing parameter table when the storage location of the target data is consistent with the second predetermined storage location, wherein the second predetermined storage location includes a local database that matches the middleware; The first defined unit includes: The first determining subunit is used to determine the table name information of the target data from the communication information; The second determining subunit is used to determine the storage location of the target data from the data routing parameter table based on the table name information.
7. An electronic device, comprising: One or more processors; Memory, used to store one or more instructions. When the one or more instructions are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method of any one of claims 1 to 5.
8. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 5.
9. A computer program product comprising computer-executable instructions, which, when executed, are used to implement the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Routing algorithm based database sharding method, system and middleware system
CN105426396A
Service request routing method and device
CN110581890A