Business data processing method and device under unitization architecture, equipment and medium
By determining whether a specified database identifier is included when a business data processing message is received under a unitized architecture, and then identifying and storing the target database identifier, the problem of low efficiency when the server accesses the database each time is solved, thus achieving more efficient database access and business data processing.
Patent Information
- Application Number
- CN202310231968.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-10
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2043-03-10
AI Technical Summary
In a unitized architecture, the server needs to determine the corresponding database based on the relevant parameters in the business data processing message each time it accesses the database, resulting in low database access efficiency and business data processing efficiency.
When a business data processing message is received, it is determined whether it contains a specified database identifier. If it does not, the target database identifier is determined based on the database selection identifier and stored in the thread variable library. When accessing the database, the target database identifier is directly obtained from the thread variable library for access.
It improves database access efficiency and business data processing efficiency, supports dynamic and static routing, and ensures that the server can process business data processing messages normally.
Smart Images

Figure CN116226199B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data, and in particular to a method, apparatus, device and medium for processing business data under a modular architecture. Background Technology
[0002] With the rapid development of technology, the architecture of business data processing systems has evolved from the original multi-datacenter architecture within the same city and the three-center architecture in two locations to the current unitized structure. As the volume of business data continues to increase, unitized business data processing systems are favored for their strong disaster recovery capabilities and easy scalability.
[0003] In existing technologies, when processing business data in a unitized architecture business data processing system, the server accesses the database multiple times after receiving the business data processing message. Because in a unitized architecture, a server connects to multiple databases, each time the server accesses a database, it determines the corresponding database based on the relevant parameters in the business data processing message and then accesses that database.
[0004] In summary, under the existing unitized architecture, the business processing method determines the corresponding database based on the relevant parameters in the business data processing message every time the server accesses the database, resulting in low database access efficiency, which in turn leads to low business data processing efficiency. Summary of the Invention
[0005] This application provides a business data processing method, apparatus, device, and medium under a unitized architecture, which solves the problem that existing business processing methods under a unitized architecture determine the corresponding database based on relevant parameters in the business data processing message every time the server accesses the database, resulting in low database access efficiency and consequently low business data processing efficiency.
[0006] In a first aspect, embodiments of this application provide a method for processing business data under a unitized architecture, including:
[0007] When accessing the database, the target database identifier is obtained from the thread variable library, which includes the target database identifier determined according to the business data processing message;
[0008] Based on the target database identifier, access the database corresponding to the target database identifier and perform business data processing.
[0009] In one specific implementation, before obtaining the target database identifier from the thread variable library when accessing the database, the method further includes:
[0010] Receive a business data processing message, wherein the business data processing message includes a database selection identifier;
[0011] If the specified database identifier is not included in the business data processing message, the target database identifier is determined based on the database selection identifier;
[0012] The target database identifier is stored in the thread variable library.
[0013] In one specific implementation, determining the target database identifier based on the database selection identifier includes:
[0014] Based on the database selection identifier, determine the database identifier to be selected;
[0015] Based on the database identifier to be selected, obtain the configuration protocol table of the database corresponding to the database identifier to be selected;
[0016] The target database identifier is determined based on the database selection identifier and the configuration protocol table.
[0017] In one specific implementation, determining the database identifier to be selected based on the database selection identifier includes:
[0018] Calculate the hash value of the database selection identifier;
[0019] The target remainder is obtained by performing a remainder calculation based on the hash value and a preset divisor.
[0020] Based on the target remainder and the correspondence between the remainder and the database identifier, the database identifier to be selected corresponding to the target remainder is determined.
[0021] In one specific implementation, determining the target database identifier based on the database selection identifier and the configuration protocol table includes:
[0022] In the configuration protocol table, if the database identifier corresponding to the database selection identifier is the same as the database identifier to be selected, the database identifier to be selected is used as the target database identifier.
[0023] In one specific implementation, determining the target database identifier based on the database selection identifier and the configuration protocol table includes:
[0024] In the configuration protocol table, if the database identifier corresponding to the database selection identifier is different from the database identifier to be selected, the database identifier corresponding to the database selection identifier shall be used as the target database identifier.
[0025] In one specific implementation, after receiving the service data processing message, the method further includes:
[0026] If the business data processing message includes the specified database identifier, the target database identifier is determined based on the specified database identifier.
[0027] Secondly, embodiments of this application provide a business data processing apparatus under a unitized architecture, comprising:
[0028] The acquisition module is used to obtain the target database identifier from the thread variable library when accessing the database. The thread variable library includes the target database identifier determined according to the business data processing message.
[0029] The processing module is used to access the database corresponding to the target database identifier based on the target database identifier, and to perform business data processing.
[0030] Thirdly, embodiments of this application provide an electronic device, including:
[0031] Processor, memory, communication interface;
[0032] The memory is used to store the executable instructions of the processor;
[0033] The processor is configured to execute the business data processing method under the unitized architecture described in any of the first aspects by executing the executable instructions.
[0034] Fourthly, embodiments of this application provide a readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the business data processing method under the unitized architecture described in any of the first aspects.
[0035] Fifthly, embodiments of this application provide a computer program product, including a computer program, which, when executed by a processor, is used to implement the business data processing method under the unitized architecture described in any of the first aspects.
[0036] The unitized architecture-based business data processing method, apparatus, device, and medium provided in this application, when accessing a database, utilize a thread variable library containing a target database identifier generated from a business data processing message that does not include a specified database identifier. The target database identifier can be retrieved from the thread variable library, and the database corresponding to the target database identifier can be accessed for business data processing. This solution effectively improves both database access efficiency and business data processing efficiency by obtaining the target database identifier from the thread variable library and then accessing the database corresponding to the target database identifier. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 A flowchart illustrating an embodiment of the business data processing method under the unitized architecture provided in this application;
[0039] Figure 2 A flowchart illustrating Embodiment 2 of the business data processing method under the unitized architecture provided in this application;
[0040] Figure 3 A flowchart illustrating Embodiment 3 of the business data processing method under the unitized architecture provided in this application;
[0041] Figure 4 A flowchart illustrating Embodiment 4 of the business data processing method under the unitized architecture provided in this application;
[0042] Figure 5 A schematic diagram of the structure of an embodiment of the business data processing device under the unitized architecture provided in this application;
[0043] Figure 6 This is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments made by those skilled in the art under the guidance of these embodiments are within the scope of protection of this application.
[0045] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0046] With the rapid development of technology, the architecture of business data processing systems has also evolved to a modular architecture. Modular architecture business data processing systems are favored by people because of their strong disaster recovery and easy expansion.
[0047] In existing technologies, under a unitized architecture, a server connects to multiple databases. After receiving a business data processing message, the server will access the database multiple times. Each time the database is accessed, the corresponding database is determined based on the relevant parameters in the business data processing message. This results in low database access efficiency, which in turn leads to low business data processing efficiency.
[0048] To address the problems existing in the prior art, the inventors, during their research on business data processing methods under a unitized architecture, discovered that to improve database access efficiency, a target database identifier can be determined and stored first. Subsequently, during each database access, the corresponding database is determined and accessed based on the target database identifier. Upon receiving a business data processing message, it is determined whether the message includes a specified database identifier. If not, the target database identifier is determined based on the database selection identifier in the message and then stored in a thread variable library. During each database access, the target database identifier is retrieved from the thread variable library, and the corresponding database is accessed based on this identifier for business data processing, effectively improving database access efficiency. Based on the above inventive concept, the business data processing scheme under the unitized architecture described in this application was designed.
[0049] In this application, the execution subject of the business data processing method under the unitized architecture can be a server, or a computer, terminal device, or other device capable of running a business data processing system under the unitized architecture. This application does not limit it. The following description uses a server as an example.
[0050] The following describes the application scenarios of the business data processing method under the unitized architecture provided in this application.
[0051] For example, in this application scenario, when the server receives a business data processing message sent by its upstream server, since the server is connected to multiple databases, the server needs to determine which database to access next. Therefore, it first determines whether the business data processing message includes a specified database identifier.
[0052] If the server determines that the specified database identifier is not included in the business data processing message, it then determines the target database identifier based on the database selection identifier in the business data processing message and stores the target database identifier in the thread variable library.
[0053] Each time the server accesses the database, it retrieves the target database identifier from the thread variable library to determine the corresponding database, thus enabling access to that database for business data processing. Furthermore, for each subsequent database access, it only needs to retrieve the target database identifier from the thread variable library; there is no need to determine the target database identifier each time the database is accessed.
[0054] It should be noted that the above scenario is only an example of an application scenario provided by the embodiments of this application. The embodiments of this application do not limit the actual form of the various devices included in the scenario, nor do they limit the interaction method between devices. In the specific application of the solution, it can be set according to actual needs.
[0055] The technical solution of this application will now be described in detail through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0056] Figure 1 This is a flowchart illustrating an embodiment of the business data processing method under a unitized architecture provided in this application. This embodiment describes how the server obtains the target database identifier from the thread variable library and then accesses the corresponding database when accessing the database. The method in this embodiment can be implemented through software, hardware, or a combination of both. Figure 1 As shown, the business data processing method under this unitized architecture specifically includes the following steps:
[0057] S101: When accessing the database, obtain the target database identifier from the thread variable library.
[0058] In a business data processing system, business data can be processed by accessing a database through a server. When business data processing is required, terminal devices, upstream servers, and other devices can send business data processing messages to the server. The server determines the target database identifier based on whether the business data processing message includes a specified database identifier and stores it in the thread variable library.
[0059] In this step, after the server stores the target database identifier in the thread variable library, it can perform database access operations. When it is necessary to access the database, it is necessary to obtain the target database identifier from the thread variable library to determine which database to access.
[0060] S102: Based on the target database identifier, access the database corresponding to the target database identifier and perform business data processing.
[0061] In this step, after the server obtains the target database identifier, it accesses the database corresponding to the target database identifier and performs business data processing.
[0062] It should be noted that business data processing can include adding, deleting, modifying, or searching data in the database. This application does not limit the business data processing; it can be determined according to the actual situation.
[0063] The unitized architecture-based business data processing method provided in this embodiment determines the target database identifier and stores it in a thread variable library when the server receives a business data processing message. Each time the database needs to be accessed, it is unnecessary to determine the target database identifier again based on the business data processing message; the target database identifier can be obtained from the thread variable library, and the database corresponding to the target database identifier can then be accessed for business data processing. Compared to existing technologies that require calculating the database identifier each time the database needs to be accessed, this solution determines the target database identifier and stores it in the thread variable library upon receiving the business data processing message. Therefore, each time the database needs to be accessed, only the target database identifier needs to be obtained from the thread variable library, effectively improving database access efficiency and business data processing efficiency. Furthermore, it also enables the server to support dynamic routing.
[0064] Figure 2 This is a flowchart illustrating a second embodiment of the business data processing method under a unitized architecture provided in this application. Based on the above embodiments, this application embodiment describes the following: the server receives a business data processing message, determines the target database identifier based on whether the business data processing message includes a specified database identifier, and stores the target database identifier in the thread variable library. For example... Figure 2As shown, the business data processing method under this unitized architecture specifically includes the following steps:
[0065] S201: Receive service data processing message.
[0066] In a business data processing system, business data can be processed by accessing a database through a server. When business data processing is required, terminal devices, upstream servers, and other devices can send business data processing messages to the server.
[0067] In this step, the server can receive a business data processing message, which includes a database selection identifier for subsequent database access.
[0068] It should be noted that the database selection identifier can be a user number, a business number, a business data type number, etc. This application embodiment does not limit the database selection identifier, and it can be set according to the actual situation.
[0069] S202: Determine whether the business data processing message includes a specified database identifier; if the business data processing message does not include a specified database identifier, proceed to step S203; if the business data processing message includes a specified database identifier, proceed to step S204.
[0070] S203: Determine the target database identifier based on the database selection identifier.
[0071] In the above steps, after the server receives the business data processing message, in order to more accurately determine the target database identifier, it needs to determine whether the business data processing message includes the specified database identifier.
[0072] If the business data processing message does not include a specified database identifier, it means that the message does not specify a database to access. Therefore, the server needs to determine which database to access. It needs to determine the database identifier to be selected based on the database selection identifier, and then determine the target database identifier based on the configuration protocol table of the database corresponding to the database selection identifier and the database identifier to be selected.
[0073] S204: Determine the target database identifier based on the specified database identifier.
[0074] In this step, if it is determined that the business data processing message includes a specified database identifier, it means that the message specifies a database to be accessed, and the target database identifier can be determined based on the specified database identifier.
[0075] When the database identifier is specified as the database identifier, the specified database identifier is directly used as the target database identifier.
[0076] When the specified database identifier is not the database identifier, the target database identifier is determined according to the correspondence between the specified database identifier and the target database identifier.
[0077] After determining the target database identifier, the configuration protocol table of the database corresponding to the target database identifier can also be obtained. If the database identifier corresponding to the database selection identifier is different from the target database identifier, the target database identifier is updated and the database identifier corresponding to the database selection identifier is used as the updated target database identifier.
[0078] S205: Store the target database identifier in the thread variable library.
[0079] In this step, after the server determines the target database identifier, it needs to store the target database identifier in the thread variable library so that it can be retrieved from it later.
[0080] It should be noted that after the server receives a business data processing message, it only performs the operation of determining the target database identifier once and storing the target database identifier in the thread variable library. Subsequently, each time the database is accessed, the target database identifier can be directly obtained from the thread variable library, without having to perform the operation of determining the target database identifier based on the business data processing message again.
[0081] The business data processing method under the unitized architecture provided in this embodiment determines whether a specified database identifier is included in the business data processing message when the server receives it. If the specified database identifier is not included, the target database identifier is determined based on the database selection identifier. If the specified database identifier is included, the target database identifier is determined based on the specified database identifier. This ensures that the server supports both dynamic and static routing, and guarantees that the server can process business data processing messages normally.
[0082] Figure 3 This is a flowchart illustrating a third embodiment of the business data processing method under a unitized architecture provided in this application. Based on the above embodiments, this application's embodiment further explains how the server determines a database identifier to be selected based on a database selection identifier, then obtains the configuration protocol table of the database corresponding to the database identifier to be selected, and then combines this with the determination of the target database identifier using the database selection identifier. For example... Figure 3 As shown, the business data processing method under this unitized architecture specifically includes the following steps:
[0083] S301: Determine the database identifier to be selected based on the database selection identifier.
[0084] In this step, after the server receives the business data processing message, in order to determine which database to access, it needs to first determine the database identifier to be selected based on the database selection identifier.
[0085] Specifically, first calculate the hash value of the database selection identifier, then perform a remainder calculation based on the hash value and a preset divisor to obtain the target remainder, and finally determine the database identifier to be selected corresponding to the target remainder based on the target remainder, the correspondence between the remainder and the database identifier.
[0086] For example, Table 1 is a table showing the correspondence between remainders and database identifiers provided in this application.
[0087] Table 1
[0088] Remainder Database identifier [0,15] 1 [16,31] 2 [32,47] 3 [48,63] 4 [64,79] 5 [80,95] 6 [96,111] 7 [112,127] 8
[0089] For example, based on Table 1, the database selection identifier is the user ID, the preset divisor is 128, and the server connects to 8 databases. After calculating the hash value of the user ID and performing a modulo operation, the target remainder is 65, so the database identifier to be selected is 5.
[0090] It should be noted that the above example is only for illustrating the determination of the database identifier to be selected. This application embodiment does not limit the correspondence between the remainder and the database identifier, the database selection identifier, the preset divisor, etc., and can be set according to the actual situation.
[0091] S302: Based on the database identifier to be selected, obtain the configuration protocol table of the database corresponding to the database identifier to be selected.
[0092] In this step, after the server determines the database identifier to be selected, in order to ensure that the database corresponding to the database identifier is the database that the server wants to access, it is also necessary to obtain the configuration protocol table of the database corresponding to the database identifier.
[0093] S303: Determine the target database identifier based on the database selection identifier and configuration protocol table.
[0094] In this step, after the server obtains the configuration protocol table, it determines whether the data the server needs to access still exists in the database based on the database selection identifier and the configuration protocol table. If it still exists, the database identifier to be selected is used as the target database identifier. If it does not exist, it means that the data has been moved to another database, and the database identifier corresponding to the moved database stored in the configuration protocol table is used as the target database identifier.
[0095] The business data processing method under the unitized architecture provided in this embodiment improves the accuracy of the server in determining the target server by determining the database identifier to be selected based on the database selection identifier, obtaining the configuration protocol table of the database corresponding to the database identifier to be selected, and combining it with the database selection identifier.
[0096] Figure 4 This is a flowchart illustrating Embodiment 4 of the business data processing method under the unitized architecture provided in this application. Based on the above embodiments, this application embodiment describes the situation where the server determines the target database identifier according to the database selection identifier and configuration protocol table. Figure 4 As shown, the business data processing method under this unitized architecture specifically includes the following steps:
[0097] S401: Based on the database identifier to be selected, obtain the configuration protocol table of the database corresponding to the database identifier to be selected.
[0098] It should be noted that this step is similar to step S302 in Embodiment 3, and will not be described again here.
[0099] S402: In the configuration protocol table, determine whether the database identifier corresponding to the database selection identifier is the same as the database identifier to be selected; if the database identifier corresponding to the database selection identifier is the same as the database identifier to be selected, then proceed to step S403; if the database identifier corresponding to the database selection identifier is not the same as the database identifier to be selected, then proceed to step S404.
[0100] S403: Use the identifier of the database to be selected as the identifier of the target database.
[0101] S404: Use the database identifier corresponding to the database selection identifier as the target database identifier.
[0102] In the above steps, after the server obtains the configuration protocol table, since the configuration protocol table stores the correspondence between the database selection identifier and the database identifier, it can determine whether the database identifier corresponding to the database selection identifier is the same as the database identifier to be selected.
[0103] If the database identifier corresponding to the database selection identifier is the same as the database identifier to be selected, it means that the data to be accessed by the server has not been moved. The database identifier to be selected will be used as the target database identifier.
[0104] If the database identifier corresponding to the database selection identifier is different from the database identifier to be selected, it means that the data that the server wants to access has been moved. The database identifier corresponding to the database selection identifier is the identifier of the moved database, so the database identifier corresponding to the database selection identifier is used as the target database identifier.
[0105] The business data processing method under the unitized architecture provided in this embodiment determines the target database identifier by judging whether the database identifier corresponding to the database selection identifier is the same as the database identifier to be selected, which effectively improves the accuracy of determining the target database identifier.
[0106] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0107] Figure 5 This is a structural schematic diagram of an embodiment of the business data processing device under the unitized architecture provided in this application. Figure 5 As shown, the business data processing device 50 under this unitized architecture includes:
[0108] The acquisition module 51 is used to acquire the target database identifier from the thread variable library when accessing the database. The thread variable library includes the target database identifier determined according to the business data processing message.
[0109] The processing module 52 is used to access the database corresponding to the target database identifier based on the target database identifier, and to perform business data processing.
[0110] Receiving module 53 is used to receive a business data processing message, wherein the business data processing message includes a database selection identifier;
[0111] Furthermore, the processing module 52 is also configured to determine the target database identifier based on the database selection identifier if the specified database identifier is not included in the business data processing message;
[0112] Storage module 54 is used to store the target database identifier into the thread variable library.
[0113] Furthermore, the processing module 52 is specifically used for:
[0114] Based on the database selection identifier, determine the database identifier to be selected;
[0115] Based on the database identifier to be selected, obtain the configuration protocol table of the database corresponding to the database identifier to be selected;
[0116] The target database identifier is determined based on the database selection identifier and the configuration protocol table.
[0117] Furthermore, the processing module 52 is specifically used for:
[0118] Calculate the hash value of the database selection identifier;
[0119] The target remainder is obtained by performing a remainder calculation based on the hash value and a preset divisor.
[0120] Based on the target remainder and the correspondence between the remainder and the database identifier, the database identifier to be selected corresponding to the target remainder is determined.
[0121] Furthermore, the processing module 52 is specifically used for:
[0122] In the configuration protocol table, if the database identifier corresponding to the database selection identifier is the same as the database identifier to be selected, the database identifier to be selected is used as the target database identifier.
[0123] Furthermore, the processing module 52 is specifically used for:
[0124] In the configuration protocol table, if the database identifier corresponding to the database selection identifier is different from the database identifier to be selected, the database identifier corresponding to the database selection identifier shall be used as the target database identifier.
[0125] Furthermore, the processing module 52 is also used for:
[0126] If the business data processing message includes the specified database identifier, the target database identifier is determined based on the specified database identifier.
[0127] The business data processing device under the unitized architecture provided in this embodiment is used to execute the technical solutions in any of the aforementioned method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0128] Figure 6 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 6 As shown, the electronic device 60 includes:
[0129] Processor 61, memory 62, and communication interface 63;
[0130] The memory 62 is used to store the executable instructions of the processor 61;
[0131] The processor 61 is configured to execute the technical solutions in any of the foregoing method embodiments by executing the executable instructions.
[0132] Optionally, the memory 62 can be either standalone or integrated with the processor 61.
[0133] Optionally, when the memory 62 is a device independent of the processor 61, the electronic device 60 may further include:
[0134] Bus 64, memory 62 and communication interface 63 are connected to processor 61 through bus 64 and complete communication with each other. Communication interface 63 is used to communicate with other devices.
[0135] Optionally, the communication interface 63 can be implemented using a transceiver. The communication interface is used to enable communication between the database access device and other devices (e.g., clients, read-write databases, and read-only databases). The memory may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk drive.
[0136] Bus 64 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus.
[0137] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0138] The electronic device is used to execute the technical solutions in any of the foregoing method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0139] This application also provides a readable storage medium storing a computer program thereon, which, when executed by a processor, implements the technical solutions provided in any of the foregoing embodiments.
[0140] This application also provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the technical solutions provided in any of the foregoing method embodiments.
[0141] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for processing business data under a modular architecture, characterized in that, include: Receive a business data processing message, wherein the business data processing message includes a database selection identifier; If the business data processing message does not include a specified database identifier, the database identifier to be selected is determined based on the database selection identifier. Based on the database identifier to be selected, obtain the configuration protocol table of the database corresponding to the database identifier to be selected; The target database identifier is determined based on the database selection identifier and the configuration protocol table; Store the target database identifier in the thread variable library; When accessing the database, the target database identifier is obtained from the thread variable library, which includes the target database identifier determined according to the business data processing message; Based on the target database identifier, access the database corresponding to the target database identifier and perform business data processing.
2. The method according to claim 1, characterized in that, The step of determining the database identifier to be selected based on the database selection identifier includes: Calculate the hash value of the database selection identifier; The target remainder is obtained by performing a remainder calculation based on the hash value and a preset divisor. Based on the target remainder and the correspondence between the remainder and the database identifier, the database identifier to be selected corresponding to the target remainder is determined.
3. The method according to claim 1, characterized in that, The step of determining the target database identifier based on the database selection identifier and the configuration protocol table includes: In the configuration protocol table, if the database identifier corresponding to the database selection identifier is the same as the database identifier to be selected, the database identifier to be selected is used as the target database identifier.
4. The method according to claim 1, characterized in that, The step of determining the target database identifier based on the database selection identifier and the configuration protocol table includes: In the configuration protocol table, if the database identifier corresponding to the database selection identifier is different from the database identifier to be selected, the database identifier corresponding to the database selection identifier shall be used as the target database identifier.
5. The method according to claim 1, characterized in that, After receiving the service data processing message, the method further includes: If the business data processing message includes the specified database identifier, the target database identifier is determined based on the specified database identifier.
6. A business data processing device under a modular architecture, characterized in that, include: The acquisition module is used to obtain the target database identifier from the thread variable library when accessing the database. The thread variable library includes the target database identifier determined according to the business data processing message. The processing module is used to access the database corresponding to the target database identifier based on the target database identifier, and to perform business data processing. A receiving module is used to receive business data processing messages, wherein the business data processing messages include a database selection identifier; The processing module is configured to, if the business data processing message does not include a specified database identifier, determine a database identifier to be selected based on the database selection identifier; and obtain the configuration protocol table of the database corresponding to the database identifier to be selected based on the database identifier to be selected. The target database identifier is determined based on the database selection identifier and the configuration protocol table; The storage module is used to store the target database identifier into the thread variable library.
7. An electronic device, characterized in that, include: Processor, memory, communication interface; The memory is used to store the executable instructions of the processor; The processor is configured to execute the business data processing method under the unitized architecture according to any one of claims 1 to 5 by executing the executable instructions.
8. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the business data processing method under the unitized architecture as described in any one of claims 1 to 5.
9. A computer program product, characterized in that, Includes a computer program, which, when executed by a processor, is used to implement the business data processing method under the unitized architecture as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Business data processing method and device, equipment, storage medium and program
CN113127102A