EJB routing forwarding method and device, equipment, storage medium and product
By implementing automated routing configuration and forwarding in EJB message service, the problem of missing routing forwarding function in the EJB architecture is solved, the system performance and maintenance efficiency are improved, the configuration and maintenance process is simplified, and the enterprise development and maintenance costs are reduced.
Patent Information
- Application Number
- CN202411091428.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-12-06
AI Technical Summary
The lack of built-in routing and forwarding functions in the EJB architecture leads to unbalanced server load, low resource utilization, and slow processing speed, which increases the cost of enterprise development and maintenance, and requires manual update of routing rules and configurations when system version changes or fault repairs.
Provide an EJB routing forwarding method, which allows you to write configuration files and database routing tables before the EJB message service is started, and load them into the cache, realizing automatic routing configuration and forwarding, including verification, parsing, querying and forwarding modules, and dynamically update routing information. , combined with logging and monitoring systems, optimize routing search performance and message forwarding efficiency.
It significantly improves the system's startup efficiency, routing search performance, security and message forwarding efficiency, reduces development and maintenance costs, simplifies configuration and maintenance work, and improves the overall performance and maintenance convenience of the system.
Smart Images

Figure CN119094438A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of path forwarding, and in particular, to an EJB routing forwarding method, apparatus, device, storage medium and product. Background Art
[0002] EJB (Enterprise JavaBeans) is an enterprise-level JavaBean, a server-side component model used to develop distributed enterprise-level applications. It is part of the Java EE (Java Platform, Enterprise Edition) specification and is designed to simplify the development and deployment of enterprise-level applications.
[0003] At present, EJB has become one of the architectures adopted by many enterprises. Under the impact of the big data era, single-path forwarding, that is, there is only one path between servers by default to forward messages, which may lead to some servers being under heavy load while other servers are idle, and resource utilization is seriously low. At the same time, the message processing speed is also relatively slow, which causes important problems such as increased enterprise costs, slow service response, and reduced user experience. Therefore, multi-path forwarding has gradually come into the sight of developers.
[0004] However, the EJB architecture does not directly provide built-in routing forwarding functions, which often need to be implemented through other technologies. The multi-routing forwarding function can provide different paths for different service quality requirements, and can guess the degree of network congestion by detecting the status of each path, thereby ensuring service quality and response speed, and load balancing between servers. At the same time, when the system version changes, such as the parallel stage of replacement of the old with the new, adding new services or instances, etc., maintenance personnel are often required to manually update the routing rules and configurations, and the network path will become more complicated. Correspondingly, when problems occur in services or instances, maintenance personnel are also required to manually modify and remove faulty nodes, which increases the development and maintenance costs of the enterprise.
[0005] Therefore, there is an urgent need for an EJB routing forwarding method that can automatically configure routing and reduce development and maintenance costs. Summary of the invention
[0006] The purpose of the embodiments of this specification is to provide an EJB routing forwarding method, apparatus, device, storage medium and product to automatically perform routing configuration and reduce development and maintenance costs.
[0007] To achieve the above objectives, on the one hand, the embodiments of this specification provide an EJB routing and forwarding method, which is applied to the EJB message service of the current system, including:
[0008] Before starting the EJB message service, write the EJB configuration file and database routing table;
[0009] After the EJB message service starts to start, the EJB message service is initialized according to the EJB configuration file;
[0010] After the EJB message service is started, the database routing table is loaded into the cache to obtain a cache routing table;
[0011] When receiving a request message sent by the upstream system to the current system, verifying the request message;
[0012] When the verification is correct, the request message is parsed to obtain the target transaction code;
[0013] Query the cache routing table according to the target transaction code to obtain the target routing information corresponding to the request message;
[0014] According to the target routing information, the request message is forwarded to a downstream system.
[0015] Preferably, the database routing table and cache routing table both include: a transaction code, a routing identifier and a valid identifier;
[0016] The transaction code is used to characterize a routing link from the current system to the downstream system, the routing identifier is used to characterize whether the downstream system is a new system or an old system, and to characterize the link interface of the downstream system, and the valid identifier is used to characterize whether each routing link is valid.
[0017] Preferably, forwarding the request message to a downstream system according to the target routing information further comprises:
[0018] forwarding the request message to a downstream system according to the target routing link and the target routing identifier corresponding to the target transaction code in the target routing information;
[0019] If during the forwarding process, multiple forwarding failures occur due to an abnormality in the target routing link, the valid flag corresponding to the target routing link in the cache routing table is updated to invalid;
[0020] Update the valid identifier corresponding to the target routing link in the database routing table to invalid.
[0021] Preferably, it also includes:
[0022] Monitor and query the transaction log by second level to obtain the request messages forwarded by the current system in all routing links up to now. The transaction log records the transaction time and corresponding routing link of each request message up to now.
[0023] According to the request message forwarded by the current system, the number of requests of the current system up to now is obtained.
[0024] Preferably, forwarding the request message to the downstream system according to the target routing link and the target routing identifier corresponding to the target transaction code in the target routing information further comprises:
[0025] Get the number of requests to the current system up to now;
[0026] Add 1 to the number of requests of the current system;
[0027] Taking the modulus of the number of requests and the number of servers in the current system, a subscript value is obtained;
[0028] A server in the current system corresponding to the subscript value is used as the target server;
[0029] The request message is forwarded to the downstream system through the target server of the current system.
[0030] Preferably, it also includes:
[0031] Monitor and query transaction logs at the second level, and count the failure rate of each routing link within a set period of time, where the failure rate is the ratio of the number of request messages that failed to be forwarded in each routing link within the set period of time to the number of all request messages;
[0032] When the failure rate of a certain routing link is greater than a set value, the record corresponding to the routing link in the cache routing table and the database routing table is deleted.
[0033] Preferably, it also includes:
[0034] Receive a specific request message;
[0035] If a specific position in the specific request message contains a specific value, parsing the specific request message to obtain a specific transaction code;
[0036] A routing link is added or a routing link is deleted based on the specific transaction code, and the cache routing table and the database routing table are updated.
[0037] On the other hand, the embodiment of this specification provides an EJB routing and forwarding device, which is applied to the EJB message service of the current system, and the device includes:
[0038] Write a module to write EJB configuration files and database routing tables before starting the EJB message service.
[0039] An initialization module, used to initialize the EJB message service according to the EJB configuration file after the EJB message service starts to start;
[0040] A loading module is used to load the database routing table into the cache to obtain a cache routing table after the EJB message service is started;
[0041] A verification module, used for verifying a request message sent by an upstream system to the current system when receiving the request message;
[0042] A parsing module, used to parse the request message to obtain a target transaction code when the verification is correct;
[0043] A query module, used to query the cache routing table according to the target transaction code to obtain the target routing information corresponding to the request message;
[0044] A forwarding module is used to forward the request message to a downstream system according to the target routing information.
[0045] On the other hand, an embodiment of the present specification further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein when the computer program is executed by the processor, the instructions according to any one of the methods described above are executed.
[0046] On the other hand, an embodiment of the present specification further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor of a computer device, the computer program executes instructions according to any one of the methods described above.
[0047] On the other hand, the embodiments of this specification further provide a computer program product, which, when executed by a processor of a computer device, executes instructions according to any one of the methods described above.
[0048] It can be seen from the technical solutions provided by the embodiments of the present specification that, through the methods of the embodiments of the present specification, a series of orderly steps significantly improve the startup efficiency, routing search performance, security and message forwarding efficiency of the system. Before the EJB message service is started, the configuration file and database routing table are written in advance to ensure that the system can be quickly initialized at startup and reduce errors and delays in the startup process. After the service is started, the database routing table is loaded into the cache, which not only optimizes the performance of subsequent routing searches, but also reduces the access pressure on the database. When receiving the request message sent by the upstream system, the system first verifies the message to ensure the integrity and legitimacy of the data, thereby improving the security of the system. After the verification is passed, the request message is parsed to obtain the target transaction code, and then the target routing information is quickly obtained by querying the cache routing table. This process is more efficient than directly querying the database. According to the obtained target routing information, the system accurately forwards the request message to the corresponding downstream system to ensure the accuracy and efficiency of message transmission. The use of the cache mechanism not only improves the speed of message forwarding, but also allows the routing information to be dynamically updated without modifying the code, enhancing the flexibility and scalability of the system. In addition, standardized configuration files and database tables simplify the configuration and maintenance of the system. By combining the log record and monitoring system, problems in the routing forwarding process can be better tracked and analyzed, further improving the reliability and maintenance efficiency of the system. In short, the method of the embodiment of this specification significantly improves the overall performance and maintenance convenience of the system by optimizing the configuration and caching mechanism, strict verification process and efficient forwarding strategy.
[0049] In order to make the above and other purposes, features and advantages of the present specification more obvious and easy to understand, the following specifically cites preferred embodiments and describes them in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 A schematic diagram of a process flow of an EJB routing forwarding method provided in an embodiment of this specification is shown;
[0052] Figure 2 A schematic diagram of a process of forwarding a request message to a downstream system according to target routing information provided in an embodiment of this specification is shown;
[0053] Figure 3Another schematic diagram of the process of an EJB routing forwarding method provided by an embodiment of this specification is shown;
[0054] Figure 4 A schematic diagram of a process of forwarding a request message to a downstream system provided in an embodiment of this specification is shown;
[0055] Figure 5 Another schematic diagram of a process of an EJB routing forwarding method provided by an embodiment of this specification is shown;
[0056] Figure 6 A schematic diagram of a process flow after receiving a specific request message provided in an embodiment of this specification is shown;
[0057] Figure 7 A schematic diagram of the module structure of an EJB routing and forwarding device provided in an embodiment of this specification is shown;
[0058] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of this specification is shown.
[0059] Description of the accompanying symbols:
[0060] 100. Write modules;
[0061] 200, initialization module;
[0062] 300, load module;
[0063] 400, verification module;
[0064] 500, parsing module;
[0065] 600, query module;
[0066] 700, forwarding module;
[0067] 802. Computer equipment;
[0068] 804, processor;
[0069] 806. Memory;
[0070] 808, driving mechanism;
[0071] 810, input / output module;
[0072] 812. Input device;
[0073] 814. Output device;
[0074] 816. Presentation equipment;
[0075] 818. Graphical user interface;
[0076] 820, network interface;
[0077] 822, communication link;
[0078] 824. Communication bus. DETAILED DESCRIPTION
[0079] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of this specification.
[0080] At present, EJB has become one of the architectures adopted by many enterprises. Under the impact of the big data era, single-path forwarding, that is, there is only one path between servers by default to forward messages, which may lead to some servers being under heavy load while other servers are idle, and resource utilization is seriously low. At the same time, the message processing speed is also relatively slow, which causes important problems such as increased enterprise costs, slow service response, and reduced user experience. Therefore, multi-path forwarding has gradually come into the sight of developers.
[0081] However, the EJB architecture does not directly provide built-in routing forwarding functions, which often need to be implemented through other technologies. The multi-routing forwarding function can provide different paths for different service quality requirements, and can guess the degree of network congestion by detecting the status of each path, thereby ensuring service quality and response speed, and load balancing between servers. At the same time, when the system version changes, such as the parallel stage of replacement of the old with the new, adding new services or instances, etc., maintenance personnel are often required to manually update the routing rules and configurations, and the network path will become more complicated. Correspondingly, when problems occur in services or instances, maintenance personnel are also required to manually modify and remove faulty nodes, which increases the development and maintenance costs of the enterprise.
[0082] In order to solve the above problems, the embodiments of this specification provide an EJB routing forwarding method. Figure 1 This is a flowchart of an EJB routing forwarding method provided by an embodiment of this specification. This specification provides method operation steps as described in the embodiment or flowchart, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the actual system or device product is executed, it can be executed in the order of the method shown in the embodiment or the accompanying drawings or in parallel.
[0083] It should be noted that the terms "first", "second", etc. in the description and claims of the embodiments of this specification and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this specification described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0084] Reference Figure 1 The embodiment of this specification provides an EJB routing forwarding method, which is applied to the EJB message service of the current system, including:
[0085] S101: Before starting the EJB message service, compile the EJB configuration file and database routing table;
[0086] S102: After the EJB message service starts to start, the EJB message service is initialized according to the EJB configuration file;
[0087] S103: After the EJB message service is started, the database routing table is loaded into the cache to obtain a cache routing table;
[0088] S104: When receiving a request message sent by the upstream system to the current system, verify the request message;
[0089] S105: When the verification is correct, the request message is parsed to obtain the target transaction code;
[0090] S106: query the cache routing table according to the target transaction code to obtain the target routing information corresponding to the request message;
[0091] S107: Forward the request message to a downstream system according to the target routing information.
[0092] The overall architecture of the system in the embodiments of this specification includes: an upstream system, a current system and a downstream system, wherein the upstream system sends a request message, and the request message is forwarded to the downstream system through the current system. For the downstream system, it may be a new system or an old system.
[0093] EJB (Enterprise JavaBeans) message service, as the backend component of enterprise-level Java applications, is usually located inside the system and runs in the application server. Among them, whether it is an upstream system, a current system or a downstream system, an EJB message service can be set inside. The embodiment of this specification takes the EJB message service of the current system as the main body and proposes an EJB routing forwarding method.
[0094] Before starting the EJB message service, you need to write the EJB configuration file and database routing table. After starting, you need to initialize the EJB message service according to the EJB configuration file. After the startup is completed, load the database routing table into the cache to obtain the cache routing table, thereby improving the access speed and reducing the database load.
[0095] Further, the request message sent by the upstream system can be received. After receiving the request message, it needs to be verified. During the verification, on the one hand, it verifies whether the format of the request message conforms to the set standard format, data integrity and data consistency, etc., and on the other hand, verifies the data source to confirm that the request message comes from the expected upstream system and is sent to the correct downstream system.
[0096] Routing information includes transaction code, routing identifier and valid identifier.
[0097] When the verification is correct, the request message is parsed to obtain the target transaction code. It should be noted that the database routing table and cache routing table both include: transaction code, routing identifier and valid identifier;
[0098] The transaction code is used to characterize a routing link from the current system to the downstream system, the routing identifier is used to characterize whether the downstream system is a new system or an old system, and to characterize the link interface of the downstream system, and the valid identifier is used to characterize whether each routing link is valid.
[0099] A routing link refers to the transmission path of request messages between systems. In the embodiments of this specification, it refers to the transmission path of request messages between the current system and the downstream system. For example, if the current system is system A and the downstream system is system B, then the routing link is system A-system B, and a combination of letters and / or numbers is used as a transaction code to characterize the routing link. The routing identifier is used to characterize whether the downstream system is a new system or an old system, and to characterize the link interface of the downstream system. For example, if the downstream system is the old system C1, or the downstream system is the new system C2, for system C1, it receives the request message forwarded by the current system through the link interface c11, and a combination of letters and / or numbers is used as the routing identifier. The valid identifier is used to characterize whether each routing link is valid. For example, 1 is used to characterize a valid routing link, and 0 is used to characterize an invalid routing link.
[0100] After obtaining the target transaction code, the cache routing table is queried without querying the database routing table, because querying the cache routing table is faster, and the target routing information corresponding to the target transaction code is obtained. The target routing information includes the target transaction code, the target routing identifier and the target valid identifier.
[0101] Further, according to the target routing information, the request message is forwarded to the downstream system. It should be noted that before performing this step, it is necessary to determine whether the target valid identifier in the target routing information is valid, and perform this step under the premise of validity.
[0102] Reference Figure 2 , specifically:
[0103] S201: forwarding the request message to a downstream system according to the target routing link and the target routing identifier corresponding to the target transaction code in the target routing information;
[0104] S202: If multiple forwarding failures occur due to an abnormality in the target routing link during the forwarding process, the valid identifier corresponding to the target routing link in the cache routing table is updated to invalid;
[0105] S203: Update the valid identifier corresponding to the target routing link in the database routing table to invalid.
[0106] Since the transaction code corresponds to the routing link one by one, the corresponding target routing link can be obtained according to the target transaction code. In addition, the target routing identifier can characterize whether the downstream system is a new system or an old system, as well as the link interface. Therefore, after determining the target routing link and the target routing identifier, corresponding forwarding can be performed. The request message is forwarded to the corresponding downstream system through the target routing link, and is received by the corresponding link interface in the downstream system.
[0107] However, if multiple forwarding failures occur due to abnormalities in the target link during the forwarding process, the valid flag corresponding to the target routing link in the cache routing table is updated to invalid, and the valid flag corresponding to the target routing link in the corresponding database routing table is updated to invalid.
[0108] The number of forwarding failures can be set according to the actual situation. For example, one day (24 hours) is used as a cycle. If multiple forwarding failures occur in one cycle, for example, 10 forwarding failures occur, the valid flag is updated to invalid. However, it should be noted that multiple forwarding failures in the current cycle do not mean that there will be forwarding failures in the next cycle. Therefore, after each cycle, all invalid valid flags can be updated to valid to observe their forwarding conditions in the next cycle.
[0109] To better observe the forwarding of request messages, refer to Figure 3 , the embodiments of this specification also include:
[0110] S301: Monitor and query the transaction log by second level to obtain the request messages forwarded by the current system in all routing links up to now. The transaction log records the transaction time and corresponding routing link of each request message up to now.
[0111] S302: Obtain the number of requests of the current system up to now according to the request message forwarded by the current system.
[0112] The transaction log records the transaction time and corresponding routing link of each request message up to now. Of course, in addition to the transaction time, other transaction information is also recorded, such as transaction content, transaction type, etc. When monitoring and querying the transaction log by second, all request messages up to now and their corresponding routing links can be obtained. If the request message is a request message forwarded by the current system to the downstream system, the routing link includes the current system and the downstream system, and has a directionality that represents the current system forwarding to the downstream system. Based on this, the routing links can be counted to obtain the request messages forwarded by the current system in all routing links. As long as it is a message forwarded by the current system, regardless of the specific downstream system, it is counted to obtain the number of requests of the current system up to now.
[0113] In the embodiments of this specification, refer to Figure 4 , forwarding the request message to the downstream system according to the target routing link and the target routing identifier corresponding to the target transaction code in the target routing information further includes:
[0114] S401: Obtain the number of requests of the current system up to now;
[0115] S402: adding 1 to the number of requests of the current system;
[0116] S403: Taking the modulus of the number of requests and the number of servers in the current system to obtain a subscript value;
[0117] S404: taking a server in the current system corresponding to the subscript value as a target server;
[0118] S405: Forward the request message to the downstream system through the target server of the current system.
[0119] When the number of requests of the current system is obtained, the current request message has not been forwarded to the downstream system at this time, so the current request message is not recorded in the transaction log. At this time, it is necessary to add 1 to the number of requests of the current system, that is, to obtain the number of all request messages processed by the current system including the current request message, and further take the modulus of the number of requests and the number of servers in the current system to obtain the subscript value, and number all servers in the current system starting from 0, in sequence 0, 1, 2, 3... Match the subscript value with the number, and the server corresponding to the matching number is the target server. The request message can be forwarded to the downstream system through the target server of the current system.
[0120] In addition, refer to Figure 5 , also includes:
[0121] S501: Monitor and query transaction logs at the second level, and count the failure rate of each routing link within a set period of time, where the failure rate is the ratio of the number of request messages that failed to be forwarded in each routing link within the set period of time to the number of all request messages;
[0122] S502: When the failure rate of a certain routing link is greater than a set value, the record corresponding to the routing link in the cache routing table and the database routing table is deleted.
[0123] As mentioned above: one day (24 hours) is regarded as a cycle. If multiple forwarding failures occur in one cycle, for example, 10 times, the valid flag is updated to invalid. Multiple forwarding failures in the current cycle do not mean that there will be forwarding failures in the next cycle. Therefore, after each cycle, all invalid valid flags can be updated to valid.
[0124] However, it is possible that due to a fault in the routing link itself, multiple forwarding failures occur in each cycle. In this case, it is necessary to count the failure rate of each routing link in the set time period. The set time period can be multiple cycles, and the failure rate is the ratio of the number of request messages that failed to be forwarded in each routing link in the set time period to the number of all request messages. For example, in the set time period, for example, 2 cycles, the first routing link forwards a total of 15 request messages, and 10 request messages that failed to be forwarded, with a failure rate of 66.67%. If the set value is 50%, and the failure rate of 66.67% is greater than the set value, it is necessary to delete the records corresponding to the routing link in the cache routing table and the database routing table, and the routing link is unavailable. At the same time, the transaction log corresponding to the routing link can be sent to the operation and maintenance personnel terminal for maintenance.
[0125] In addition, refer to Figure 6 , the embodiments of this specification also include:
[0126] S601: receiving a specific request message;
[0127] S602: If the specific position in the specific request message contains a specific value, parse the specific request message to obtain a specific transaction code;
[0128] S603: Add a new routing link or delete a routing link based on the specific transaction code, and update the cache routing table and the database routing table.
[0129] Specific request messages are generally not sent by the upstream system, but can be sent through manual editing, in which specific positions contain specific values. For example, the first 4 characters of the request message are 0001, which means adding a routing link, and 0004, which means deleting a routing link. The specific transaction code can be parsed from the specific request message, and the routing link corresponding to the specific transaction code is added or deleted accordingly, so as to achieve the purpose of updating the cache routing table and the database routing table.
[0130] Of course, the operation and maintenance personnel can manually change the routing table and change the routing identifier to achieve centralized switching. When the failure rate of a certain routing link is too high, the corresponding record in its routing table has been deleted. To ensure business continuity, a decision can be made from the remaining records in the routing table.
[0131] Through the method of the embodiment of this specification, a series of orderly steps significantly improve the startup efficiency, routing search performance, security and message forwarding efficiency of the system. Before the EJB message service is started, the configuration file and database routing table are written in advance to ensure that the system can be quickly initialized at startup and reduce errors and delays in the startup process. After the service is started, the database routing table is loaded into the cache, which not only optimizes the performance of subsequent routing searches, but also reduces the access pressure on the database. When receiving the request message sent by the upstream system, the system first verifies the message to ensure the integrity and legitimacy of the data, thereby improving the security of the system. After the verification is passed, the request message is parsed to obtain the target transaction code, and then the target routing information is quickly obtained by querying the cache routing table. This process is more efficient than directly querying the database. According to the obtained target routing information, the system accurately forwards the request message to the corresponding downstream system to ensure the accuracy and efficiency of message transmission. The use of the cache mechanism not only improves the speed of message forwarding, but also allows the routing information to be dynamically updated without modifying the code, enhancing the flexibility and scalability of the system. In addition, standardized configuration files and database tables simplify the configuration and maintenance of the system. By combining the log record and monitoring system, problems in the routing forwarding process can be better tracked and analyzed, further improving the reliability and maintenance efficiency of the system. In short, the method of the embodiment of this specification significantly improves the overall performance and maintenance convenience of the system by optimizing the configuration and caching mechanism, strict verification process and efficient forwarding strategy.
[0132] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0133] This application provides users with corresponding big data analysis (such as personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.) operation entrances for users to choose to agree or reject automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0134] Based on the above-mentioned EJB routing forwarding method, an embodiment of this specification also provides an EJB routing forwarding device. The device may include a system (including a distributed system), software (application), module, component, server, client, etc. using the method described in the embodiment of this specification and a device combined with necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiment of this specification is as described in the following embodiments. Since the implementation scheme and method of the device to solve the problem are similar, the implementation of the specific device in the embodiment of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0135] Specifically, Figure 7 This is a schematic diagram of the module structure of an embodiment of an EJB routing forwarding device provided in the embodiment of this specification, referring to Figure 7 As shown, an EJB routing and forwarding device provided in an embodiment of this specification is applied to the EJB message service of the current system, including: a writing module 100, an initialization module 200, a loading module 300, a verification module 400, a parsing module 500, a query module 600, and a forwarding module 700.
[0136] The writing module 100 is used to write the EJB configuration file and the database routing table before the EJB message service starts.
[0137] Initialization module 200, used to initialize the EJB message service according to the EJB configuration file after the EJB message service starts to start;
[0138] The loading module 300 is used to load the database routing table into the cache to obtain the cache routing table after the EJB message service is started;
[0139] The verification module 400 is used to verify the request message when receiving the request message sent by the upstream system to the current system;
[0140] The parsing module 500 is used to parse the request message and obtain the target transaction code when the verification is correct;
[0141] A query module 600 is used to query the cache routing table according to the target transaction code to obtain the target routing information corresponding to the request message;
[0142] The forwarding module 700 is used to forward the request message to a downstream system according to the target routing information.
[0143] Reference Figure 8 As shown, based on the above-mentioned EJB routing forwarding method, a computer device 802 is also provided in an embodiment of this specification, wherein the above-mentioned method is run on the computer device 802. The computer device 802 may include one or more processors 804, such as one or more central processing units (CPUs) or graphics processing units (GPUs), and each processing unit may implement one or more hardware threads. The computer device 802 may also include any memory 806, which is used to store any kind of information such as code, settings, data, etc. In a specific implementation, the computer program on the memory 806 and which can be run on the processor 804, when the computer program is run by the processor 804, can execute instructions according to the above-mentioned method. Non-limitingly, for example, the memory 806 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory may use any technology to store information. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent a fixed or removable component of the computer device 802. In one embodiment, when the processor 804 executes the associated instructions stored in any memory or combination of memories, the computer device 802 can perform any operation of the associated instructions. The computer device 802 also includes one or more drive mechanisms 808 for interacting with any memory, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.
[0144] The computer device 802 may also include an input / output module 810 (I / O) for receiving various inputs (via input devices 812) and for providing various outputs (via output devices 814). A specific output mechanism may include a presentation device 816 and an associated graphical user interface 818 (GUI). In other embodiments, the input / output module 810 (I / O), input device 812, and output device 814 may not be included, and the computer device 802 may be used as a computer device in a network. The computer device 802 may also include one or more network interfaces 820 for exchanging data with other devices via one or more communication links 822. One or more communication buses 824 couple the components described above together.
[0145] The communication link 822 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 822 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.
[0146] Corresponds to Figure 1-Figure 6 The method in the embodiment of the present specification also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are executed.
[0147] The embodiment of the present specification also provides a computer-readable instruction, wherein when the processor executes the instruction, the program therein causes the processor to execute the following Figures 1 to 6 The method shown.
[0148] The present specification also provides a computer program product. When the computer program product is executed by a processor of a computer device, the computer program product performs the following steps: Figures 1 to 6 The method shown.
[0149] The computer program product described in this specification is a software product that mainly implements the method described in this specification through a computer program.
[0150] It should be understood that in the various embodiments of this specification, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this specification.
[0151] It should also be understood that in the embodiments of this specification, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the embodiments of this specification generally indicates that the associated objects before and after are in an "or" relationship.
[0152] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of this specification can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of this specification.
[0153] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0154] In the several embodiments provided in this specification, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.
[0155] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this specification.
[0156] In addition, each functional unit in each embodiment of this specification may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0157] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of this specification is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0158] Specific embodiments are used in this specification to illustrate the principles and implementation methods of the embodiments of this specification. The description of the above embodiments is only used to help understand the methods and core ideas of the embodiments of this specification. At the same time, for those skilled in the art, according to the ideas of the embodiments of this specification, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the embodiments of this specification.
Claims
1. An EJB routing forwarding method, characterized in that: The EJB message services applied to the current system include: Before starting the EJB message service, write the EJB configuration file and database routing table; After the EJB message service starts to start, the EJB message service is initialized according to the EJB configuration file; After the EJB message service is started, the database routing table is loaded into the cache to obtain a cache routing table; When receiving a request message sent by the upstream system to the current system, verifying the request message; When the verification is correct, the request message is parsed to obtain the target transaction code; Query the cache routing table according to the target transaction code to obtain the target routing information corresponding to the request message; According to the target routing information, the request message is forwarded to a downstream system.
2. The method according to claim 1, characterized in that The database routing table and cache routing table both include: transaction code, routing identifier and valid identifier; The transaction code is used to characterize a routing link from the current system to the downstream system, the routing identifier is used to characterize whether the downstream system is a new system or an old system, and to characterize the link interface of the downstream system, and the valid identifier is used to characterize whether each routing link is valid.
3. The method according to claim 2, characterized in that The forwarding of the request message to the downstream system according to the target routing information further comprises: forwarding the request message to a downstream system according to the target routing link and the target routing identifier corresponding to the target transaction code in the target routing information; If during the forwarding process, multiple forwarding failures occur due to an abnormality in the target routing link, the valid flag corresponding to the target routing link in the cache routing table is updated to invalid; Update the valid identifier corresponding to the target routing link in the database routing table to invalid.
4. The method according to claim 3, characterized in that Also includes: Monitor and query the transaction log by second level to obtain the request messages forwarded by the current system in all routing links up to now. The transaction log records the transaction time and corresponding routing link of each request message up to now. According to the request message forwarded by the current system, the number of requests of the current system up to now is obtained.
5. The method according to claim 4, characterized in that The forwarding of the request message to the downstream system according to the target routing link and the target routing identifier corresponding to the target transaction code in the target routing information further comprises: Get the number of requests to the current system up to now; Add 1 to the number of requests of the current system; Taking the modulus of the number of requests and the number of servers in the current system, a subscript value is obtained; A server in the current system corresponding to the subscript value is used as the target server; The request message is forwarded to the downstream system through the target server of the current system.
6. The method according to claim 4, characterized in that Also includes: Monitor and query transaction logs at the second level, and count the failure rate of each routing link within a set period of time, where the failure rate is the ratio of the number of request messages that failed to be forwarded in each routing link within the set period of time to the number of all request messages; When the failure rate of a certain routing link is greater than a set value, the record corresponding to the routing link in the cache routing table and the database routing table is deleted.
7. The method according to claim 1, characterized in that Also includes: Receive a specific request message; If a specific position in the specific request message contains a specific value, parsing the specific request message to obtain a specific transaction code; A routing link is added or a routing link is deleted based on the specific transaction code, and the cache routing table and the database routing table are updated.
8. An EJB routing forwarding device, characterized in that: The EJB message service applied to the current system comprises: Write a module to write EJB configuration files and database routing tables before starting the EJB message service. An initialization module, used to initialize the EJB message service according to the EJB configuration file after the EJB message service starts to start; A loading module is used to load the database routing table into the cache to obtain a cache routing table after the EJB message service is started; A verification module, used for verifying a request message sent by an upstream system to the current system when receiving the request message; A parsing module, used to parse the request message to obtain a target transaction code when the verification is correct; A query module, used to query the cache routing table according to the target transaction code to obtain the target routing information corresponding to the request message; A forwarding module is used to forward the request message to a downstream system according to the target routing information.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: When the computer program is executed by the processor, the computer program executes the instructions of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor of a computer device, the computer program executes instructions of the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that When the computer program product is executed by a processor of a computer device, the computer program product executes instructions of the method according to any one of claims 1 to 7.
