Data processing method and system for multiple service scenes, computer equipment and medium
By adopting a dynamic conversion mechanism between binary sequence and decimal keys in the financial system, a key-value pair mapping factory is built, which solves the problem of complex accounting processing logic, achieves efficient decoupling and global consistency, and improves the system's processing efficiency and maintainability.
Patent Information
- Application Number
- CN202510269238.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-07-04
AI Technical Summary
In modern financial systems, the logic of the splitting processing is complex. Traditional methods make the code readability poor through hard coding or complex conditions, making it difficult to maintain and expand, increasing development costs and error risks.
The dynamic conversion mechanism of binary sequence and decimal keys is adopted to build a key-value pair mapping factory to achieve efficient decoupling of multiple business scenarios and processing solutions, ensuring the global consistency and flexibility of the mapping relationship.
It improves the processing efficiency and flexibility of the system, reduces system resource consumption, reduces chain modifications of processing solutions caused by business scenario changes, and enhances the maintainability and scalability of the system.
Smart Images

Figure CN120258705A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of software engineering, and in particular, to a data processing method, system, computer device, and medium for multi-business scenarios. Background Art
[0002] In modern financial systems, account splitting is one of the key links in the business process. With the diversification of business types, the account splitting logic has become increasingly complex. For example, when processing order account splitting, an order may involve multiple types, such as Figure 1 In the multiple types of order examples shown, it includes whether it is an escort order, whether it is a corporate order, whether it is a transfer order, whether it is an exchange order, etc. Among them, an escort order refers to an order in which a user places an order through an Internet platform to request an escort service, the system generates a payment order to complete the payment process, then schedules the escort time and generates a service order, and finally schedules the escort time to complete the entire escort service process. A transfer order refers to a business document in a business scenario where, after the payer completes the payment, the right to use the order is transferred to other users. In the business scenario of a transfer order, the bill owner (i.e., the payer) and the user (i.e., the third party receiving the transfer) are clearly distinguished to ensure the clarity of the business process and the clear division of responsibilities.
[0003] Next, each combination of order types corresponds to a specific account splitting scheme. For example, when an order simultaneously meets the conditions of "being an escort order", "being a corporate order", "being a transfer order", and "being an exchange order", only the additional account splitting order is processed; while when an order meets the conditions of "being an escort order", "being a corporate order", "being a transfer order", and "not being an exchange order", no account splitting is performed. This complex mapping relationship between business scenarios and account splitting schemes is usually implemented through hard coding or complex conditional judgment logic in traditional methods, which not only results in poor code readability but also is difficult to maintain and expand. With the development of the business, new scenarios and requirements emerge continuously, and the system needs to be frequently modified and tested, increasing the development cost and the risk of errors. Summary of the Invention
[0004] In view of the above deficiencies or drawbacks, the present application provides a data processing method, system, computer device, and medium for multi-business scenarios, which realizes the efficient decoupling of multi-business scenarios to processing solutions through a dynamic conversion mechanism between binary sequences and decimal keys, ensuring the global consistency of the mapping relationship, reducing system resource consumption, and improving processing efficiency.
[0005] According to a first aspect, the present application provides a data processing method for multiple service scenarios. This method is applied to a service mapping processing system, which pre - constructs a mapping relationship table between service scenarios and their processing solutions for multiple service scenarios; in this mapping relationship table, the unique identifier corresponding to each service scenario includes multiple binary conditions, and each processing solution corresponds to a predefined Spring Bean name, and the binary condition is a boolean value; the method includes:
[0006] In response to the startup instruction of the service mapping processing system, splice the binary conditions of each service scenario into a binary string, and convert each binary string into a decimal value.
[0007] Construct a key - value pair mapping factory based on each decimal value and each Spring Bean name.
[0008] In response to receiving a service processing request, generate a target decimal key value according to the current service scenario specified by the service processing request and its corresponding binary conditions.
[0009] Obtain the target Spring Bean name from the key - value pair mapping factory according to the target decimal key value, so as to call the processing solution of the target service.
[0010] In some embodiments, before reading the mapping relationship table, the method further includes:
[0011] Determine the arrangement order of each column in the mapping relationship table according to the priority order set by the developer.
[0012] According to the arrangement order of each column, determine the judgment priority of each binary condition.
[0013] Among them, the priority order is used to reflect the importance degree of the services corresponding to each service scenario or the sequence of service processing. The arrangement order of each column is the arrangement of each binary condition in the mapping relationship table according to the priority order. When the service mapping processing system processes the service corresponding to the target service scenario, it performs judgment operations in turn according to the judgment priority of the binary conditions.
[0014] In some embodiments, when processing the service corresponding to the target service scenario, the method further includes:
[0015] When it is detected that any binary condition of the target service scenario is not defined in the mapping relationship table, record an error log according to the undefined binary condition, and call the fallback processing solution preset for the target service scenario.
[0016] In some embodiments, when constructing a key - value pair mapping factory based on each decimal value and each Spring Bean name, the method includes:
[0017] Use each decimal value as the key of the corresponding Map in the mapping table, and use each Spring Bean name as the value of the corresponding Map in the mapping table to construct a key-value pair mapping factory.
[0018] In some embodiments, the above key-value pair mapping factory stores the mapping relationships between multiple business scenarios and various processing solutions in a singleton pattern.
[0019] In some embodiments, the key-value pair mapping factory includes a global mapping container. The global mapping container stores the mapping relationships between business scenarios and processing solutions in a singleton pattern and adopts a lazy loading mechanism to load all mapping relationships only when the processing solution of the target business is called for the first time. The method further includes:
[0020] Associate each processing solution with the corresponding Spring Bean instance, and store the references of these Spring Bean instances in the global mapping container.
[0021] In some embodiments, the above business mapping processing system is used to process accompanying diagnosis orders from multiple business scenarios. Examples of the accompanying diagnosis orders for the multiple business scenarios can be as Figure 5 shown. The above mapping relationship table is stored in any one of the comma-separated value.csv format,.xlsx format, or.xls format.
[0022] According to a second aspect, the present application provides a data processing system for multiple business scenarios. The system is based on a business mapping processing system, which pre-constructs a mapping relationship table between business scenarios and their processing solutions. In the mapping relationship table, the unique identifier corresponding to each business scenario includes multiple binary conditions, and each processing solution corresponds to a predefined Spring Bean name. The binary condition is a boolean value. The system includes:
[0023] A numerical format conversion module, configured to splice the binary conditions of each business scenario into a binary string and convert each binary string into a decimal value when receiving a startup instruction from the business mapping processing system.
[0024] A mapping factory construction module, configured to construct a key-value pair mapping factory based on each decimal value and each Spring Bean name.
[0025] A key value generation module, configured to generate a target decimal key value according to the current business scenario and its corresponding binary condition specified in the business processing request when receiving a business processing request.
[0026] Spring Bean Name Retrieval Module, which is used to retrieve the target Spring Bean name from the key-value pair mapping factory according to the target decimal key value for invoking the processing solution of the target business.
[0027] According to a third aspect of the present application, there is provided a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data processing method for multiple business scenarios in any one of the above embodiments are implemented.
[0028] According to a fourth aspect of the present application, there is provided a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes, the steps of the data processing method for multiple business scenarios in any one of the above embodiments are implemented.
[0029] The multi-business scenario processing method of the above embodiment is applied to a business mapping processing system. The system pre-constructs a mapping relationship table between business scenarios and their processing solutions for multiple business scenarios. In this mapping relationship table, the unique identifier corresponding to each business scenario includes multiple binary conditions, and each processing solution corresponds to a predefined Spring Bean name. Among them, the binary condition is a boolean value used to represent a specific attribute or state of the business scenario. The above method includes the following steps: The business mapping processing system, in response to the startup instruction of the business mapping processing system, sequentially concatenates the binary conditions of each business scenario into a binary string and converts each binary string into a corresponding decimal value. Then, based on each decimal value and each Spring Bean name, a key-value pair mapping factory is constructed. The key-value pair mapping factory is used to store the mapping relationship between business scenarios and processing solutions. Here, the key is the decimal value, and the value is the Spring Bean name. Next, the business mapping processing system, in response to receiving a business processing request, generates a target decimal key value according to the current business scenario and its corresponding binary conditions specified by the business processing request. Retrieves the corresponding target Spring Bean name from the key-value pair mapping factory through the target decimal key value, and invokes the Spring Bean to execute the processing solution of the target business. It can be seen that the above method realizes the efficient decoupling of multiple business scenarios and processing solutions through the dynamic conversion mechanism of binary sequences and decimal keys. This decoupling method ensures the global consistency of the mapping relationship, avoids the cascading modification of the processing solution caused by the change of the business scenario, reduces the system resource consumption, and improves the processing efficiency at the same time. Description of the Drawings
[0030] Figure 1 It is a diagram showing examples of multiple types of orders in one or more embodiments of the present application;
[0031] Figure 2Schematic diagram of the application environment of a data processing method for multiple service scenarios in one or more embodiments of the present application;
[0032] Figure 3 Flowchart of a data processing method for multiple service scenarios in one or more embodiments of the present application;
[0033] Figure 4 Flowchart of a method for determining the judgment priority of binary conditions in one or more embodiments of the present application;
[0034] Figure 5 Example diagram of an escort service order for multiple service scenarios in one or more embodiments of the present application;
[0035] Figure 6 Example diagram of the processing logic mapping of an escort order for multiple service scenarios in one or more embodiments of the present application;
[0036] Figure 7 Schematic diagram of the structure of a data processing system for multiple service scenarios in one or more embodiments of the present application;
[0037] Figure 8 Schematic diagram of the internal structure of a computer device in one or more embodiments of the present application. Detailed implementation manners
[0038] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0039] A data processing method for multiple service scenarios provided by the present application according to the first aspect can be applied to a service mapping processing system (102) in an application environment as Figure 2 shown. The user terminal (101) can first send a start instruction to the service mapping processing system (102), so that the service mapping processing system (102) calls the processing solution of the target service from the server systems (103) of multiple service scenarios. Then, the service mapping processing system (102) executes the processing logic of the target service scenario according to the called processing solution and sends the service processing result to the user terminal (101).
[0040] In some exemplary embodiments of the present application, the above method can be applied to an application environment as Figure 2The business mapping processing system shown above pre - constructs a mapping relationship table between business scenarios and their processing solutions for multiple business scenarios. In this mapping relationship table, the unique identifier corresponding to each business scenario includes multiple binary conditions, and each processing solution corresponds to a predefined Spring Bean name. The binary condition is a boolean value; among them, the Spring Bean name is the unique string identifier used to identify and reference Beans in the Spring container and is one of the core mechanisms for implementing dependency injection and component management in the Spring framework. As Figure 3 shown, the method includes the following steps:
[0041] Step 301: In response to the startup instruction of the business mapping processing system, splice the binary conditions of each business scenario into a binary string, and convert each binary string into a decimal value.
[0042] Among them, the binary condition of a business scenario refers to a set of boolean value conditions used to characterize the specific attributes or states of the business scenario. The value of each binary condition is True or False. These binary conditions serve as the unique identifier of the business scenario and are used to distinguish different business scenarios and their corresponding processing solutions.
[0043] Specifically, when the business mapping processing system (hereinafter referred to as: the system) receives the startup instruction, it can read the pre - constructed mapping relationship table between business scenarios and processing solutions through its own system initialization module. This mapping relationship table stores each business scenario, its corresponding set of binary conditions, and the Spring Bean name of the processing solution. Then, the system splices the multiple binary conditions of each business scenario into a binary string in accordance with the preset splicing rules. Subsequently, the system converts this binary string into the corresponding decimal value.
[0044] Step 302: Build a key - value pair mapping factory based on each decimal value and each Spring Bean name.
[0045] Among them, the key - value pair mapping factory is used to store the mapping relationship between business scenarios and processing solutions. Among them, the decimal value can be used as the key, and the Spring Bean name can be used as the value. The construction process of the key - value pair mapping factory can be the following steps: The system initialization module associates the decimal value corresponding to each business scenario generated in step 201 with the Spring Bean name corresponding to this business scenario and stores these key - value pairs in the mapping factory.
[0046] Step 303: In response to receiving a business processing request, generate a target decimal key - value according to the current business scenario specified by the business processing request and its corresponding binary conditions.
[0047] Among them, a business processing request refers to an instruction initiated by a user or other system modules to trigger specific business logic processing. The request carries a set of binary conditions used to characterize the current business scenario. These binary conditions have the same definition and format as those used to construct the key-value pair mapping factory in step 301, and are all boolean values, used to identify specific attributes or states of the current business scenario.
[0048] Specifically, when the system receives a business processing request, the request parsing module of the system itself extracts the set of binary conditions of the current business scenario carried in the request. Subsequently, the system concatenates these binary conditions into a binary string in the same concatenation rule as in step 301, and converts it into the corresponding target decimal key.
[0049] Step 304: Obtain the target Spring Bean name from the key-value pair mapping factory according to the target decimal key, so as to call the processing solution of the target business.
[0050] Among them, the key-value pair mapping factory stores the mapping relationship between the decimal values of business scenarios and the Spring Bean names of processing solutions. The target decimal key is dynamically generated according to the current business scenario and its binary conditions specified in the business processing request, and is used to uniquely identify the current business scenario.
[0051] Specifically, after the system generates the target decimal key, the business scheduling module of the system itself uses this key as a query condition to retrieve the corresponding target Spring Bean name from the key-value pair mapping factory. If there is a corresponding Spring Bean name in the key-value pair mapping factory for the target decimal key, the system obtains this name and instantiates the corresponding Spring Bean through the dependency injection mechanism of the Spring framework. Subsequently, the system calls the business processing method defined in this Spring Bean to execute the processing solution matching the current business scenario.
[0052] In this way, the system can quickly and accurately obtain and call the corresponding Spring Bean according to the dynamically generated target decimal key, so as to achieve efficient matching and decoupling between the business scenario and the processing solution. This mechanism not only improves the flexibility and scalability of the system, but also ensures the global consistency of the mapping relationship, reduces system resource consumption, and improves processing efficiency.
[0053] In some embodiments, before reading the mapping relationship table, as Figure 4 shown, the method further includes:
[0054] Step 401: Determine the arrangement order of each column in the mapping relationship table according to the priority order set by the developer.
[0055] Specifically, developers set priorities for each column in the mapping relation table in advance according to business requirements and system design. Columns with higher priorities are arranged on the left side of the table, and columns with lower priorities are arranged on the right side of the table. The arrangement order of the columns is the arrangement of each binary condition in the mapping relation table in the order of priority.
[0056] Step 402: Determine the judgment priorities of each binary condition according to the arrangement order of the columns.
[0057] Among them, the priority order is used to reflect the importance degree of the business corresponding to each business scenario or the sequence of business processing. The arrangement order of the columns is the arrangement of each binary condition in the mapping relation table in the order of priority. When the system processes the business corresponding to the target business scenario, it performs judgment operations in sequence according to the judgment priorities of the binary conditions.
[0058] Specifically, in the mapping relation table, each column corresponds to a binary condition, and its value is a Boolean value (True or False). According to the arrangement order of the columns determined in Step 401, the system assigns judgment priorities to each binary condition in sequence. The binary condition with a higher priority is judged first, and the binary condition with a lower priority is judged later. When the system processes the business corresponding to the target business scenario, it performs judgment operations in sequence according to the judgment priorities of the binary conditions to determine the unique identifier of the current business scenario and generate a corresponding decimal key value.
[0059] Through the above steps, the system can flexibly adjust the judgment order of binary conditions according to the importance degree or processing sequence of the business, thereby optimizing the business processing flow and improving the adaptability and processing efficiency of the system. At the same time, this priority-based judgment mechanism provides higher flexibility and configurability for business mapping processing, facilitating developers to adjust and optimize according to actual needs.
[0060] In some embodiments, when processing the business corresponding to the target business scenario, the method further includes:
[0061] When it is detected that any binary condition of the target business scenario is not defined in the mapping relation table, an error log is recorded according to the undefined binary condition, and the fallback processing solution preset for the target business scenario is called.
[0062] Among them, the detailed information of the binary conditions included in the error log can be the position of the system in the business scenario, the expected Boolean value type, and other relevant context information, so that developers can conduct problem troubleshooting and repair later. This fallback handling solution is a general processing mechanism designed in advance for abnormal situations or undefined conditions that may occur in the business scenario. Its purpose is to ensure that when the system cannot match an exact business processing solution, it can still process the business in a relatively stable and predictable manner, thereby avoiding the interruption or failure of the entire business processing flow due to the undefined of a single binary condition.
[0063] Through the above steps, the system can record error information in a timely manner and take fallback measures when facing the situation where some binary conditions in the business scenario are undefined, effectively improving the robustness and fault tolerance of the system, and ensuring the continuity and stability of business processing.
[0064] In some embodiments, when constructing a key-value pair mapping factory based on each decimal value and each Spring Bean name, the method includes:
[0065] Taking each decimal value as the key of the corresponding Map in the mapping table and each Spring Bean name as the value of the corresponding Map in the mapping table to construct a key-value pair mapping factory.
[0066] Among them, Map is a data structure used to store key-value pairs. The above system initialization module takes the decimal value corresponding to each business scenario as the key of the corresponding Map in the mapping table and the SpringBean name corresponding to each business scenario as the value of the corresponding Map in the mapping table, thereby constructing a key-value pair mapping factory. In this key-value pair mapping factory, each decimal value corresponds to a unique Spring Bean name, forming a one-to-one mapping relationship. This mapping relationship ensures that the system can quickly retrieve the corresponding Spring Bean name according to the unique identifier (i.e., the decimal value) of the business scenario, and then call the corresponding business processing solution.
[0067] Through the above steps, the system can construct a mapping relationship between business scenarios and processing solutions in an efficient and structured manner. The design of this key-value pair mapping factory not only improves the operating efficiency of the system, but also enhances the scalability and maintainability of the system, facilitating developers to flexibly adjust and optimize the mapping relationship according to changes in business requirements.
[0068] In some embodiments, the above key-value pair mapping factory stores the mapping relationships of multiple business scenarios and their respective processing solutions in a singleton pattern.
[0069] Specifically, by adopting the singleton pattern, the key-value pair mapping factory is instantiated only once during the system operation and continuously provides services during subsequent business processing. This design ensures the global uniqueness and consistency of the mapping relationship, avoiding problems such as mapping relationship conflicts or data inconsistencies caused by multiple instantiations. Moreover, the key-value pair mapping factory of the singleton pattern is created during the system initialization phase and loads the mapping relationship of predefined business scenarios and processing solutions. During subsequent business processing, each module of the system can access this mapping factory through a unified interface to obtain the required business processing solutions, thereby achieving efficient business scenario matching and processing logic invocation.
[0070] In some embodiments, the key-value pair mapping factory includes a global mapping container. The global mapping container stores the mapping relationship of business scenarios and processing solutions in the singleton pattern and adopts a lazy loading mechanism to load all mapping relationships only when the processing solution of the target business is first called. The method further includes:
[0071] Associating each processing solution with the corresponding Spring Bean instance and storing the references of these Spring Bean instances in the global mapping container.
[0072] Specifically, the global mapping container loads all mapping relationships only when the processing solution of the target business is first called, thus effectively optimizing the usage efficiency of system resources and enhancing the system initialization speed. Further, by designing the global mapping container using the singleton pattern and the lazy loading mechanism, the system can further improve the system performance and resource utilization efficiency on the basis of ensuring the global uniqueness and consistency of the mapping relationship. At the same time, by storing the references of Spring Bean instances in the global mapping container, the system can implement the invocation of business processing solutions in an efficient and flexible manner, further enhancing the scalability and maintainability of the system.
[0073] In some embodiments, the above system is used to process escort orders from multiple business scenarios. The above mapping relationship table is stored in any one of the comma-separated values.csv format,.xlsx format, or.xls format.
[0074] Among them, the.csv format, as a lightweight text file format, has the characteristics of simple structure, easy reading and writing, and strong compatibility, and is suitable for storing structured mapping relationship data. The.xlsx format and.xls format, as common formats of Excel spreadsheet files, support more complex data structures and rich data processing functions, and can conveniently perform operations such as editing, sorting, filtering, and analyzing on the mapping relationship table. Developers can flexibly select a suitable file format to store the mapping relationship table according to actual requirements and usage scenarios.
[0075] By adopting the above file format to store the mapping relation table, the service mapping processing system of the present application can implement the processing logic mapping of the accompany diagnosis orders in multiple service scenarios in an efficient, flexible and easy-to-manage manner (for example Figure 6 the processing logic mapping example shown), thereby providing strong support for the efficient operation of the system and subsequent maintenance management.
[0076] The present application provides a data processing system for multiple service scenarios according to a second aspect. This system is based on a service mapping processing system, which pre-constructs a mapping relation table between service scenarios and their processing solutions for multiple service scenarios. In this mapping relation table, the unique identifier corresponding to each service scenario includes multiple binary conditions, and each processing solution corresponds to a predefined Spring Bean name. The binary condition is a boolean value, as Figure 7 shown, this system includes:
[0077] A numerical format conversion module 110, configured to splice the binary conditions of each service scenario into a binary string and convert each binary string into a decimal value when receiving a startup instruction from the service mapping processing system.
[0078] A mapping factory construction module 120, configured to construct a key-value pair mapping factory based on each decimal value and each Spring Bean name.
[0079] A key-value generation module 130, configured to generate a target decimal key value according to the current service scenario specified by the service processing request and its corresponding binary condition when receiving a service processing request.
[0080] A Spring Bean name acquisition module 140, configured to acquire a target Spring Bean name from the key-value pair mapping factory according to the target decimal key value for invoking the processing solution of the target service.
[0081] In some embodiments, before reading the mapping relation table, the service mapping processing system is further configured to determine the arrangement order of each column in the mapping relation table according to the priority order set by the developer. According to the arrangement order of each column, determine the judgment priority of each binary condition. Among them, the priority order is used to reflect the importance degree of the services corresponding to each service scenario or the sequence of service processing, and the arrangement order of each column is the arrangement of each binary condition in the mapping relation table according to the priority order. When the service mapping processing system processes the service corresponding to the target service scenario, it sequentially performs judgment operations according to the judgment priority of the binary conditions.
[0082] In some embodiments, the system further includes a fallback solution invocation module 150, which is configured to record an error log according to the undefined binary condition when processing the service corresponding to the target business scenario and detecting that any binary condition of the target business scenario is not defined in the mapping relation table, and invoke the preset fallback processing solution for the target business scenario.
[0083] In some embodiments, when constructing a key-value pair mapping factory based on each decimal value and each Spring Bean name, the Spring Bean name acquisition module 140 is further configured to use each decimal value as the key of the corresponding Map in the mapping table, and each Spring Bean name as the value of the corresponding Map in the mapping table, so as to construct a key-value pair mapping factory.
[0084] In some embodiments, the key-value pair mapping factory includes a global mapping container. The global mapping container stores the mapping relationship between the business scenario and the processing solution in a singleton pattern, and adopts a lazy loading mechanism to load all mapping relationships only when the processing solution of the target business is called for the first time. The Spring Bean name acquisition module 140 is further configured to associate each processing solution with the corresponding Spring Bean instance, and store the references of these Spring Bean instances in the global mapping container.
[0085] For the specific limitations of the data processing system applicable to multiple business scenarios, reference can be made to the limitations of the data processing method applicable to multiple business scenarios in the foregoing text, which will not be elaborated here. Each module in the above data processing system applicable to multiple business scenarios can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
[0086] According to a third aspect of the present application, there is provided a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data processing method for multiple business scenarios in any one of the above embodiments are implemented.
[0087] According to a fourth aspect of the present application, there is provided a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes, the steps of the data processing method for multiple business scenarios in any one of the above embodiments are implemented.
[0088] In one embodiment, there is provided a computer device, which may be a server, and its internal structure diagram may be as Figure 8As shown in the figure. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to the data processing of multiple service scenarios. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it is used to implement the data processing method for any of the above multiple service scenarios.
[0089] Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in this application may include non-volatile and / or volatile memories. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (RamCUs), direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0090] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0091] The above embodiments only represent several implementation manners of this application, and their descriptions are relatively specific and detailed. However, it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can still be made, and these all belong to the protection scope of this application. Therefore, the protection scope of the patent of this application should be subject to the appended claims.
[0092] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent in such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.
Claims
1. A data processing method for multi-service scenarios, characterized in that, The method is applied to a service mapping processing system, which pre - constructs a mapping relation table between service scenarios and their processing solutions for multiple service scenarios; in the mapping relation table, the unique identifier corresponding to each service scenario includes multiple binary conditions, each processing solution corresponds to a predefined Spring Bean name, and the binary conditions are boolean values; the method includes: In response to the startup instruction of the service mapping processing system, splice the binary conditions of each service scenario into a binary string, and convert each binary string into a decimal value; Based on each decimal value and each Spring Bean name, construct a key - value pair mapping factory; In response to receiving a service processing request, generate a target decimal key value according to the current service scenario specified by the service processing request and its corresponding binary conditions; Obtain the target Spring Bean name from the key - value pair mapping factory according to the target decimal key value, so as to call the processing solution of the target service.
2. The method according to claim 1, wherein Before reading the mapping relation table, the method further includes: Determine the arrangement order of each column in the mapping relation table according to the priority order set by the developer; According to the arrangement order of each column, determine the judgment priority of each binary condition; Among them, the priority order is used to reflect the importance degree of the services corresponding to each service scenario or the sequence of service processing, and the arrangement order of each column is the arrangement of each binary condition in the mapping relation table according to the priority order; when the service mapping processing system processes the service corresponding to the target service scenario, it sequentially performs judgment operations according to the judgment priority of the binary conditions.
3. The method according to claim 2, wherein When processing the service corresponding to the target service scenario, the method further includes: When it is detected that any binary condition of the target service scenario is not defined in the mapping relation table, record an error log according to the undefined binary condition, and call the fallback processing solution preset for the target service scenario.
4. The method according to claim 1, characterized in that, The constructing the key - value pair mapping factory based on each decimal value and each Spring Bean name includes: Use each decimal value as the key value key of the corresponding Map in the mapping table, and use each Spring Bean name as the value value of the corresponding Map in the mapping table to construct the key - value pair mapping factory.
5. The method according to claim 4, wherein The key - value pair mapping factory stores the mapping relations between the multiple service scenarios and each processing solution in a singleton pattern.
6. The method according to claim 5, characterized in that, The key - value pair mapping factory includes a global mapping container, which stores the mapping relations between service scenarios and processing solutions in a singleton pattern and adopts a lazy - loading mechanism, and only loads all mapping relations when the processing solution of the target service is called for the first time; the method further includes: Associate each processing solution with the corresponding Spring Bean instance, and store the references of these Spring Bean instances in the global mapping container.
7. The method according to claim 1, wherein The service mapping processing system is used to process escort orders from multiple service scenarios; The mapping relation table is stored in any one of the comma-separated values.csv format,.xlsx format, or.xls format.
8. A data processing system for multi-service scenarios, characterized in that, The system is applied to a service mapping processing system, which pre-constructs a mapping relation table between multiple service scenarios and their processing solutions; in this mapping relation table, the unique identifier corresponding to each service scenario includes multiple binary conditions, and each processing solution corresponds to a predefined Spring Bean name, and the binary condition is a boolean value; the system includes: A numerical format conversion module, configured to splice the binary conditions of each service scenario into a binary string and convert each binary string into a decimal value when receiving the start instruction of the service mapping processing system; A mapping factory construction module, configured to construct a key-value pair mapping factory based on each decimal value and each Spring Bean name; A key value generation module, configured to generate a target decimal key value according to the current service scenario and its corresponding binary condition specified by the service processing request when receiving the service processing request; A Spring Bean name acquisition module, configured to acquire a target Spring Bean name from the key-value pair mapping factory according to the target decimal key value for invoking the processing solution of the target service.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.