Business data processing method, apparatus, device, and medium
By decoupling business logic from environment configuration and using executors to execute data processing logic, the problems of code redundancy and data pollution in multiple environments are solved, code scalability and data processing consistency are achieved, and the stability and efficiency of the system are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA ASSET MANAGEMENT CO LTD
- Filing Date
- 2026-03-09
- Publication Date
- 2026-07-07
AI Technical Summary
In existing technologies, adapting to differences involves writing and maintaining nearly identical core code for different environments. This results in modifications to common logic needing to be synchronized across multiple codebases, which can easily lead to omissions or errors. It is difficult to ensure that the actual business logic of each environment is consistent, and there are also risks associated with rigid management of environment differences and data security during parallel testing in multiple environments.
By creating business execution objects, based on business and environment identification data, calling business execution sets and loading environment data, business logic and environment configuration are decoupled. The executor executes data processing logic, realizing the transmission and aggregation of data processing results. The executor is decoupled from the scheduling logic, supporting flexible adaptation and data isolation in multiple environments.
It reduces code maintenance costs, improves code scalability and overall process efficiency, ensures consistency of data processing logic and system stability, solves the problem of data contamination in multiple environments, and enhances system flexibility and security.
Smart Images

Figure CN122346321A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a business data processing method, apparatus, device, and medium. Background Technology
[0002] Business data processing systems in related technologies typically need to run in multiple environments, including development, testing, gray-scale (pre-production), and production. Sometimes, they also need to repair and modify historical business data by sharing core computing logic algorithms across different environments. These shared core computing logic algorithms differ in data sources, data acquisition, cleaning rules, and parameter configurations across various environments.
[0003] In related technologies, nearly identical core code is written and maintained for different environments to adapt to differences. This means that modifications to common logic need to be synchronized across multiple sets of code, which can easily lead to omissions or errors and makes it difficult to ensure that the actual business logic is consistent across different environments. Summary of the Invention
[0004] This application provides a business data processing method, apparatus, device, and medium to at least solve the problem in related technologies where adapting to differences by writing and maintaining nearly duplicate core code for different environments leads to the need for synchronization of modifications to common logic across multiple sets of code, which is prone to omissions or errors and makes it difficult to ensure that the actual business logic of each environment is consistent.
[0005] This application provides a business data processing method, comprising: in response to a triggered execution operation, creating a business execution object corresponding to the execution operation, the business execution object including business identification data and environment identification data; based on the business identification data, calling a business execution set corresponding to the business identification data, the business execution set including at least one executor, the executor being used to execute preset data processing logic; based on the environment identification data, loading environment data corresponding to the environment identification data; based on the initial executor in the business execution set, calling the environment data, executing the data processing logic in the initial executor, obtaining intermediate processing results, transmitting the intermediate processing results to the business execution object, and transmitting the intermediate processing results to subsequent executors based on the business execution object, until the executors in the business execution set have completed their execution, thereby obtaining the business processing result corresponding to the execution operation.
[0006] This application also provides a business data processing apparatus, comprising: a triggering module, configured to create a business execution object corresponding to the execution operation in response to a triggered execution operation, the business execution object including business identification data and environment identification data; a calling module, configured to call a business execution set corresponding to the business identification data based on the business identification data, the business execution set including at least one executor, the executor being used to execute preset data processing logic; a loading module, configured to load environment data corresponding to the environment identification data based on the environment identification data; and an execution module, configured to call the environment data based on the initial executor in the business execution set, execute the data processing logic in the initial executor, obtain intermediate processing results, transmit the intermediate processing results to the business execution object, and transmit the intermediate processing results to subsequent executors based on the business execution object, until the executors in the business execution set have completed their execution, thereby obtaining the business processing result corresponding to the execution operation.
[0007] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described business data processing methods.
[0008] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described business data processing methods.
[0009] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described business data processing methods.
[0010] By decoupling business logic from environment configuration and executors from scheduling logic, code maintenance costs can be reduced. At the same time, executors can be reused in multiple environments. Adding new business only requires configuring the business execution set, and adding new execution logic only requires developing a new executor. This makes the solution highly scalable and can also improve the overall process efficiency. Attached Figure Description
[0011] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A flowchart illustrating the business data processing method provided in this application is shown; Figure 2 Another flowchart illustrating the business data processing method provided in this application is shown; Figure 3 A schematic diagram of the constituent modules of the business data processing apparatus provided in this application is shown; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0014] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0015] Related technologies adapt to differences by writing and maintaining nearly identical core code for different environments. Besides issues of code redundancy and logical consistency, this approach also suffers from rigid environment difference management and security risks associated with parallel testing data across multiple environments. Specifically, these technologies hard-code environment-specific differences into the business logic, making adjustments and switching cumbersome and lacking flexible, centralized configuration management capabilities. Furthermore, when multiple environments share data sources or table structures, parallel testing is prone to data overwriting or interference (data pollution), leading to unreliable verification results.
[0016] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0017] This application provides a business data processing method that can be applied to terminal devices, such as desktop computers, laptops, or servers. Figure 1 A flowchart illustrating the business data processing method provided in this application is shown, such as... Figure 1 As shown, the business data processing method provided in this application includes: Step S101: In response to the triggered execution operation, a business execution object corresponding to the execution operation is created. The business execution object includes: business identification data and environment identification data.
[0018] Specifically, business data represents data directly related to business processes and objects; it is business-meaning data generated during system operation. Execution operations represent specific actions that trigger a particular type of business, such as API calls. Business execution objects represent Java objects (Beans) and can encapsulate data such as business identifiers, environment identifiers, intermediate results, and execution status. Business identifier data is used to match its corresponding set of executors. Environment identifier data is used to load the configuration or data of its corresponding environment.
[0019] Specifically, after obtaining the business execution operation, the business execution object creation process is triggered. The business execution object includes business identification data and environment identification data.
[0020] Step S102: Based on the business identification data, call the business execution set corresponding to the business identification data. The business execution set includes at least one executor, which is used to execute preset data processing logic.
[0021] The business execution set, or business execution process template, represents an assembly line carried by specific executors. It is an ordered set whose elements are multiple executors that conform to a unified interface and represent the smallest unit of computational logic. Executors represent atomic logical units that encapsulate standardized data processing operations, such as data extraction, rule calculation, and result storage. Each business execution set can flexibly support its unique and differentiated processing flow by adjusting the execution order, combination method, or injecting environment-specific parameters of the executors.
[0022] Specifically, based on the pre-defined mapping relationship between business identifier data and executor sets, the processing logic of different businesses is broken down into multiple executors of the smallest granularity, and then combined into an ordered business execution set according to the business process sequence. By predefining reusable business execution sets, such as sets for production environment execution, test verification, canary regression, or historical data repair, task orchestration for different scenarios can be achieved. Each business execution set includes sequentially executed executors. In the Spring framework, the business execution process can be templated into business execution sets using Extensible Markup Language (XML) configuration files.
[0023] In this way, complex business logic is broken down into reusable executor units, and different business logic calls are made through identifier matching, which can avoid business logic fragmentation and hard coding.
[0024] Step S103: Based on the environmental identification data, load the environmental data corresponding to the environmental identification data.
[0025] The environment data includes data sources, table name mappings, interface addresses, and parameter rules. The dynamic configuration library includes environment identifier data and environment data, independent of business code, used to uniformly store and manage differentiated parameters for various environments (development, testing, canary deployments, production, etc.). Environment data includes: data source mappings, table name replacement rules, and differentiated configurations. Data source mappings record the correspondence between environment identifiers and actual database instances. Table name replacement rules maintain a dynamic mapping dictionary from logical table names to physical table names in different environments. Differentiated configurations are used to set the differentiated conditions required for this task, such as data filtering rules, calculation time ranges, and other business-related parameters.
[0026] A key-value configuration structure can be adopted, allowing configurations to be persistently stored in an independent database or integrated into configuration management platforms such as Nacos and Apollo. When executing tasks, the system dynamically obtains the corresponding data source connection information and table name mapping rules based on the input environment identifier data, thereby achieving seamless adaptation to the data access needs of multiple environments with a single codebase.
[0027] Specifically, the system categorizes and stores environment-specific configurations, such as data source information, table name mapping rules, interface addresses, and parameter thresholds, according to the dimensions of environment identifier data and their corresponding environment data. By dynamically loading environment data through environment identifier data, a single set of business logic can adapt to multiple environments, avoiding the high switching costs caused by hard-coding environment information.
[0028] Step S104: Based on the initial executor call environment data in the business execution set, execute the data processing logic in the initial executor to obtain intermediate processing results, transmit the intermediate processing results to the business execution object, and transmit the intermediate processing results to subsequent executors based on the business execution object, until the executors in the business execution set have finished executing, and obtain the business processing results corresponding to the execution operation.
[0029] The intermediate processing results are used to characterize the data generated after a single executor is executed, and can be stored in the business execution object.
[0030] Specifically, during system runtime, the business execution set sequentially calls its executors in a pre-defined order, coordinating state and data through a globally shared business execution object (task context object). The business execution sets defined in XML are uniformly instantiated and managed by the Spring Inversion of Control (IoC) container at application startup. First, the initial executor is called, using the environment data bound to the business execution object as input parameters, triggering its built-in pre-defined data processing logic. After the initial executor completes its execution, the generated intermediate processing results are encapsulated in a pre-defined format and automatically written to the result storage area of the business execution object. Subsequent executors do not need to manually pass parameters; instead, they use the business execution object as a unified data entry point, reading the intermediate processing results from the previous executor's result storage area, combining them with the current environment data to execute their own logic, and writing the new intermediate results back to this area upon completion. When all executors in the sequence have finished executing, the system aggregates all intermediate processing results from the business execution object and generates the final business processing result according to the pre-defined aggregation rules.
[0031] In this way, by decoupling business logic from environment configuration and executors from scheduling logic, code maintenance costs can be reduced. At the same time, executors can be reused in multiple environments. Adding new business only requires configuring the business execution set, and adding new execution logic only requires developing a new executor, which makes this solution highly scalable and can also improve the overall process efficiency.
[0032] In some optional implementations, the aforementioned business data processing method further includes: in response to a triggered first execution operation, creating a first business execution object corresponding to the first execution operation, the first business execution object including first business identification data; based on the first business identification data, invoking a first business execution set corresponding to the first business identification data, the first business execution set including a first executor, the first executor being used to execute first data processing logic; in response to a triggered second execution operation, creating a second business execution object corresponding to the second execution operation, the second business execution object including second business identification data; based on the second business identification data, invoking the second business execution set corresponding to the second business identification data, wherein if the second execution operation includes first data processing logic, the second business execution set includes a first executor.
[0033] In this implementation, the system pre-decomposes all data processing logic into atomic executors with minimal granularity and no business coupling. Each executor encapsulates only a single, independent processing logic, and all executors adhere to a unified interface specification. The system establishes an executor registry center, assigns a unique identifier to each executor, and associates it with its corresponding processing logic characteristics, supporting retrieval and invocation based on logical characteristics.
[0034] Specifically, when the first execution operation is a user placing an order, a first business execution object is created based on the aforementioned logic, bound to first business identifier data, and a preset first business execution set is invoked based on this identifier. This set contains the sequence of executors required to complete the order placement, including a first executor used to execute the first data processing logic, such as a balance check executor. When the second execution operation is a user refund, a second business execution object is similarly created, bound to second business identifier data, and the invocation process of the second business execution set is triggered.
[0035] The business requirements of the second execution operation are analyzed, and all data processing logic it contains is extracted. For example, a refund operation needs to include logic for checking the balance, checking the order, refunding the balance, and sending a notification. The extracted processing logic is matched with the executor characteristics in the executor registry. If the second execution operation is found to contain the first data processing logic (e.g., the refund operation also needs to check the balance), the first executor can be invoked. The reused first executor is combined with the second business-specific executor according to the flow sequence of the refund operation to form the final second business execution set.
[0036] The first executor executes as an independent unit in both the first and second business execution sets: In the first business process, the first executor calls the environmental data corresponding to the order placement business, and writes the intermediate results to the first business execution object after execution; in the second business process, the same first executor calls the environmental data corresponding to the refund business, and writes the intermediate results to the second business execution object after execution. The binding of the reused executor to its respective business execution set only takes effect during the execution phase. The executor itself does not store any business or environment-related state data. All inputs (environmental data) and outputs (intermediate results) are passed through the business execution object to which it belongs, ensuring the independence and statelessness of the same executor when executing in different business processes.
[0037] In this way, atomic executors can be shared by multiple services, which can reduce the amount of code with the same data processing logic, reduce the overall code size of the system, reduce code redundancy and maintenance costs, and ensure the consistency of data processing logic. At the same time, the stateless design of the executor avoids cross-service execution conflicts, which can improve system stability. In addition, the globally shared executor instance reduces the number of executor objects in memory, which can reduce system memory usage and improve system operating efficiency.
[0038] In some optional implementations, the first business execution object includes first environment identification data, and the second business execution object includes second environment identification data. The aforementioned business data processing method further includes: if the first execution operation and the second execution operation are triggered in the same application environment, the first environment identification data and the second environment identification data are the same; based on the first environment identification data, loading the first environment data corresponding to the first environment identification data, copying the first environment data to a first location, and calling the first environment data at the first location based on the executor in the first business execution set; based on the second environment identification data, loading the first environment data, copying the first environment data to a second location, and calling the first environment data at the second location based on the executor in the second business execution set.
[0039] In this implementation, the system pre-assigns a unique and globally unified environment identifier to each application environment, such as a production environment or a testing environment. When all business execution objects are created, they read the currently running application environment identifier from the system context, i.e., the business execution object, and write it into their own environment identifier data field. When the first execution operation and the second execution operation are triggered, the system first compares the environment identifier data in the corresponding first business execution object and second business execution object: if they are determined to be the same application environment, the environment data is marked as reusable, and the basic environment data corresponding to that environment, i.e., the first environment data, is locked; if they are determined to be different application environments, the data of each environment is loaded according to the original logic, and the subsequent reuse logic is not triggered.
[0040] For environment identifiers that are determined to be identical, an environment data loading operation is performed to read the complete first environment data corresponding to that identifier from the environment data storage center. A first location is allocated for the first execution operation, and the complete first environment data is copied to this location to form an environment data copy corresponding to the first execution operation; a second location is allocated for the second execution operation, and the same first environment data is copied to this location to form an environment data copy corresponding to the second execution operation; all locations have read-write isolation characteristics, that is, when the environment data copy in a certain location is modified, it only affects the corresponding business process and will not be synchronized to other locations or the original first environment data.
[0041] Specifically, regarding data isolation during parallel verification in the same environment, consider a set of code implementing a certain business function. Two individuals, A and B, simultaneously modify the code in a development environment to achieve their respective requirements. When A and B are testing the correctness of their code in parallel, since they are using the same database and tables, data isolation issues arise due to shared data resources. For example, if both want to manipulate table X, mutual interference prevents either from continuing verification.
[0042] To solve this problem, B can copy the original data from table X to table Y. Simultaneously, a table replacement parameter can be passed in during system startup.<X,Y> Let X be the key and Y be the value. The system's default table X is modified to Y. User A does not need to set this startup parameter. When user B starts the system, the program will dynamically replace table X with table Y during execution, thus allowing both users to operate on data independently without interference.
[0043] Similarly, A can also adjust the data source parameters (i.e., without changing the table name, directly modify the database being read) and set the data source configuration to be replaced when the system starts up. In this way, the system operates on table X in another database when it starts up, which will also achieve data isolation.
[0044] In this way, within the same application environment, the environment data is loaded only once, and then copied to different isolated locations, allowing executors of different services to call their respective copies. This achieves the dual goals of load reuse and call isolation. At the same time, it can eliminate the performance loss of repeatedly loading environment data in the same environment, resolve call conflicts of shared environment data, and improve the addressing efficiency of environment data.
[0045] In some optional implementations, the business execution object also includes a mapping relationship between logical table names and physical table names. Based on the initial executor call environment data in the business execution set, the data processing logic in the initial executor is executed to obtain intermediate processing results, including: determining the initial structured instruction based on the initial executor; locating the initial logical table name in the initial structured instruction, replacing the initial logical table name with the physical table name corresponding to the initial logical table name, generating the target structured instruction; and executing the target structured instruction to obtain intermediate processing results.
[0046] In this implementation, the mapping relationship between logical table names and physical table names is configured based on the environment and business dimensions. When a business execution object is created, in addition to the business identifier and environment identifier, the corresponding mapping relationship between logical table names and physical table names is extracted from the loaded environment data based on the environment identifier and written into the business execution object.
[0047] The initial executor has built-in preset data processing logic, the core of which is the initial structured instruction, such as a Structured Query Language (SQL) statement, which uses logical table names. When the initial executor is triggered, it first extracts the initial structured instruction to be executed from its own preset logic. This instruction is a general instruction decoupled from physical storage and relies on the logical table name to describe the data access target.
[0048] The system scans the initial structured instructions using a structured instruction parsing engine, identifies all logical table names within them, and marks them as initial logical table names to be replaced. Based on the logical table name-physical table name mapping relationship bound in the business execution object, each initial logical table name in the initial structured instructions is replaced with its corresponding physical table name. After the replacement is complete, the system calls the data source configuration in the environment data, executes the target structured instruction, and obtains the raw data returned by the underlying storage. The executor performs pre-defined processing on the raw data, generates standardized intermediate processing results, and writes the results to the business execution object for subsequent executor calls.
[0049] Specifically, this can be achieved by implementing the StatementInspector interface provided by JPA / Hibernate and overriding its inspect(String sql) method. Within this method, the system can perform real-time analysis and placeholder replacement on the raw SQL string to be executed, based on the dynamic mapping dictionary in the current task context, thereby enabling dynamic rewriting of table names at runtime.
[0050] In this way, the differences in table names in different environments are reflected through mapping relationships. The same executor can bind different mapping relationships through business execution objects to adapt to physical tables in different environments. This eliminates the need to develop multiple versions of the executor and improves system development efficiency.
[0051] In some optional implementations, the business execution object further includes a mapping relationship between logical table names and physical table names. Based on the initial executor call environment data in the business execution set, the data processing logic in the initial executor is executed to obtain intermediate processing results. It also includes: in the object relation mapping stage, based on the mapping relationship, mapping the first logical table name in the initial executor to the first physical table name corresponding to the first logical table name; generating a first structured instruction based on the first physical table name; and executing the first structured instruction to obtain intermediate processing results.
[0052] In this implementation, when creating a business execution object, in addition to binding the mapping relationship between logical table name and physical table name, the mapping relationship is also integrated with the configuration of the underlying Object-Relational Mapping (ORM) framework. A new mapping rule between logical table name and physical table name is added to the ORM framework, and the mapping rule between logical table name and physical table name is written into the ORM configuration field of the business execution object as a prerequisite rule for ORM transformation.
[0053] When the initial executor is triggered to execute the data processing logic, the process first enters the object-relational mapping (ORM) phase. The executor no longer directly defines instructions containing logical table names; instead, it calls the data access logic through the ORM framework's interface. This logic only references the first logical table name and contains no information related to physical table names. During this phase, the ORM framework reads the mapping relationship bound to the business execution object, executes the mapping from logical table names to physical table names, and resolves the logical table name (i.e., the first logical table name) corresponding to the ORM interface called by the executor. It then matches the first physical table name corresponding to this logical table name from the mapping relationship, writes the first physical table name into the ORM framework's execution context, overwriting the placeholder for the original logical table name. After completing the table name mapping, the ORM framework, based on the replaced first physical table name and the executor's business logic parameters, automatically generates the first structured instruction, calls the data source configuration in the environment data, executes the first structured instruction, and obtains the intermediate processing result.
[0054] Specifically, this can be achieved by inheriting Hibernate's `PhysicalNamingStrategyStandardImpl` class and overriding the `toPhysicalTableName` method. This intervention occurs at the ORM layer during the entity name to physical table name mapping stage. Based on context information, it directly returns the physical table name of the target environment, thus completing table name replacement at an earlier mapping stage without intruding on upper-layer business code. For example, if the original SQL is `SELECT 3 FROM #{A}`, but the key-value pair configuration in the dynamic configuration library is `A:FUND_INFO`, then this logic will be replaced with `SELECT 3 FROM FUND_INFO`, thereby achieving the data configuration for that process and environment.
[0055] In this way, table name mapping is integrated into the ORM stage and deeply integrated with the rules of the ORM framework. The mapped physical table name directly serves as the basis for ORM generation instructions, avoiding conflicts between external substitutions and ORM rules, and ensuring the compatibility and accuracy of instruction generation.
[0056] In some optional implementations, the business execution object further includes an environment adaptation rule set, which stores executor arrangement rules corresponding to different environment identifiers. Before calling the environment data, the method further includes: matching the target arrangement rule in the environment adaptation rule set with the environment identifier data; arranging the initial business execution set according to the target arrangement rule to obtain the target business execution set adapted to the environment identifier data; the arrangement includes at least one of the following: adding, deleting, or adjusting the execution order of executors; and calling the environment data based on the initial executors in the target business execution set.
[0057] In this implementation, before calling environment data and executing executors, the system triggers a rule matching process: extracting current environment identifier data and business identifier data from the business execution object; using the environment identifier and business identifier as search conditions, matching the corresponding target arrangement rule from the environment adaptation rule set. Based on the matched target arrangement rule, a structured arrangement operation is performed on the initial business execution set, such as: executor addition: inserting a new executor at the position specified by the rule; executor deletion: removing a specified executor according to the rule, without affecting the dependencies of other executors. During this process, dependencies are automatically verified. If the deleted executor is a prerequisite for other executors, an alarm will be triggered and the adjustment will be terminated; execution order adjustment: adjusting the order of executors according to the rule, and re-verifying the dependencies of the executor sequence after adjustment to ensure the formation of a valid execution chain. After the arrangement is completed, the target business execution set is generated.
[0058] In this way, by managing the set of environment adaptation rules, we can ensure the standardization of business data processing flow while allowing for differentiated adjustments in local environments. This allows us to adapt to multiple environments, avoid code redundancy in multiple versions of business execution sets, and further reduce code maintenance costs.
[0059] In some optional implementations, the business execution object further includes a result aggregation module, and the business execution set further includes executor dependency description information, which is used to characterize the pre-dependencies of each executor. The aforementioned business data processing method further includes: constructing an executor dependency graph based on the executor dependency description information; determining the executor group that can be executed in parallel and the executor sequence that can be executed serially based on the executor dependency graph; executing the executor group in parallel, transmitting the processing results of each executor in the executor group to the result aggregation module, aggregating the processing results of each executor to obtain the aggregated result; and transmitting the aggregated result to the target executor in the executor sequence based on the executor dependency graph, wherein the target executor has a pre-dependency relationship with the executor group.
[0060] In this implementation, each executor in the business execution set is configured with executor dependency description information. The dependency description information of all executors in the business execution set is read to construct an executor dependency graph in the form of a directed acyclic graph (DAG): each executor is a node in the graph, and the node attributes include executor identifier, processing logic type, etc.; the preceding dependencies are the directed edges of the graph; after construction, the validity of the graph is automatically verified: if there are circular dependencies or missing dependencies, an exception is triggered and the specific problem is prompted to avoid subsequent scheduling errors.
[0061] The dependency graph is topologically sorted and decomposed based on the dependencies between nodes to obtain parallel executor groups and serial executor sequences. Parallel executor groups are those executors in the graph with no direct or indirect predecessor dependencies and no subsequent dependencies pointing to each other; these are grouped into the same parallel group. If there are multiple subsets of dependency-free executors, they can be divided into multiple parallel groups. Serial executor sequences are those executors in the graph with direct predecessor dependencies, arranged in dependency order as a serial sequence. Each executor in the sequence depends only on the aggregation result of its predecessor executor or parallel group.
[0062] Each parallel executor is assigned an independent execution thread. Threads access environment data through a copy of the business execution object's environment data to avoid data conflicts. After each executor completes its execution, it transmits its processing result to the result aggregation module in the business execution object. The result carries information such as executor identifier, execution time, and data type. The result aggregation module stores all results categorized by executor identifier, forming a key-value mapping between executors and results.
[0063] Based on the executor dependency graph, target executors that have prerequisite dependencies with the parallel executor group are identified. The aggregation results in the result aggregation module are passed to the execution context of the target executor through the business execution object. The target executor reads the aggregation results as input, combines them with environmental data to execute its own logic, and writes the results to the business execution object after execution. Subsequent executors in the serial sequence read the results or aggregation results of the preceding executors in turn and execute them serially according to the dependency order until all serial executors are completed.
[0064] In this way, the parallel execution of dependency-free executors can reduce the processing time of business data and improve the efficiency of business data processing. At the same time, by constructing the executor dependency graph, issues such as circular dependencies and missing dependencies can be verified, avoiding process interruptions during business execution.
[0065] Figure 2 Another flowchart illustrating the business data processing method provided in this application is shown, such as... Figure 2 As shown, another process of the business data processing method includes: Step S201: Create multiple business execution sets.
[0066] Step S202: Create a dynamic configuration library.
[0067] Step S203: In response to the triggered execution operation, a business execution object corresponding to the execution operation is created. The business execution object includes business identification data and environment identification data.
[0068] Step S204: Based on the business identifier data, obtain the business execution set corresponding to the business identifier data from the Spring container, and proceed to step S206.
[0069] Step S205: Based on the environmental identification data, access the dynamic configuration library to obtain the environmental data corresponding to the environmental identification data, and proceed to step S206.
[0070] Step S206: Initialize the business execution set based on the business execution object, and execute the executors in the business execution set.
[0071] Step S207: Rewrite based on physical naming strategy to replace table name; or, based on structured query language interception to replace structured query language placeholders.
[0072] Among them, by rewriting the physical naming strategy and intercepting the structured query language, the dynamic replacement of logical table names to physical table names can be achieved.
[0073] Step S208: Access the physical data source and perform actual business calculations.
[0074] Step S209: Determine whether it is the last executor in the business execution set. If yes, proceed to step S211; otherwise, proceed to step S210.
[0075] Step S210: Obtain the next executor in the business execution set, and proceed to step S208.
[0076] Step S211: Write the business processing result corresponding to the operation into the database. Based on the execution mode of the business processing result, the process is divided. If it is the test verification mode, proceed to step S212; if it is the grayscale regression mode, proceed to step S213; if it is the history repair mode, proceed to step S214.
[0077] Step S212: Write to the test library.
[0078] Step S213: Perform data comparison.
[0079] Step S214: Backfill the production history database.
[0080] Specifically, when the system starts, it matches the corresponding execution process template based on the input business identifier data, and loads the corresponding data source mapping, table name replacement rules and task parameters from the dynamic configuration library based on the environment identifier data.
[0081] The execution engine then dynamically replaces the logical SQL in the program with physical table names that are adapted to the current environment based on these configurations, thereby achieving automatic adaptation of the data access layer.
[0082] During this process, the system generates and initializes a business execution object, which runs through the entire execution chain and is responsible for transferring status and data between processing units. After each smallest processing unit executes, it encapsulates the intermediate results and status and updates them to the business execution object, which is then passed to the next unit. This ensures controllable data flow and consistent status maintenance within the process.
[0083] In this way, by building a multi-environment adaptive system based on unified code and dynamic configuration, a single codebase can be executed adaptively and securely in isolation across various environments, including development, testing, canary deployments, and production. This improves the reliability of change verification, reduces the risk of inconsistencies in core logic caused by multiple codebases coexisting, and ensures the determinism of business calculations. Centralized and dynamic management of environmental differences allows the system to flexibly adapt to different environments without code modification, resolving data contamination issues in parallel testing within the same environment. Therefore, this provides a comprehensive technical solution for improving consistency, flexibility, security, and operational efficiency for business systems.
[0084] This embodiment also provides a business data processing apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0085] This embodiment provides a business data processing device. Figure 3 A schematic diagram of the constituent modules of the business data processing apparatus provided in this application is shown, such as... Figure 3 As shown, the system includes: a trigger module 301, used to create a business execution object corresponding to the triggering execution operation in response to the triggering operation. The business execution object includes business identification data and environment identification data; a calling module 302, used to call a business execution set corresponding to the business identification data based on the business identification data. The business execution set includes at least one executor, which is used to execute preset data processing logic; a loading module 303, used to load environment data corresponding to the environment identification data based on the environment identification data; and an execution module 304, used to call the environment data based on the initial executor in the business execution set, execute the data processing logic in the initial executor, obtain intermediate processing results, transmit the intermediate processing results to the business execution object, and transmit the intermediate processing results to subsequent executors based on the business execution object, until the executors in the business execution set have finished executing, and obtain the business processing result corresponding to the execution operation.
[0086] In some optional embodiments, the aforementioned business data processing apparatus further includes: a multiplexing module, configured to, in response to a triggered first execution operation, create a first business execution object corresponding to the first execution operation, the first business execution object including first business identification data; based on the first business identification data, invoke a first business execution set corresponding to the first business identification data, the first business execution set including a first executor, the first executor being used to execute first data processing logic; in response to a triggered second execution operation, create a second business execution object corresponding to the second execution operation, the second business execution object including second business identification data; based on the second business identification data, invoke the second business execution set corresponding to the second business identification data, wherein if the second execution operation includes first data processing logic, the second business execution set includes the first executor.
[0087] In some optional implementations, the aforementioned business data processing apparatus further includes: a first module, configured to: if a first execution operation and a second execution operation are triggered under the same application environment, the first environment identifier data and the second environment identifier data are the same; based on the first environment identifier data, load the first environment data corresponding to the first environment identifier data, copy the first environment data to a first location, and call the first environment data at the first location based on the executor in the first business execution set; based on the second environment identifier data, load the first environment data, copy the first environment data to a second location, and call the first environment data at the second location based on the executor in the second business execution set.
[0088] In some optional implementations, the execution module includes an execution module first unit, configured to determine an initial structured instruction based on the initial executor; locate the initial logical table name in the initial structured instruction; replace the initial logical table name with the physical table name corresponding to the initial logical table name; generate a target structured instruction; and execute the target structured instruction to obtain intermediate processing results.
[0089] In some optional implementations, the execution module further includes a second execution module unit, used to, during the object relation mapping stage, map the first logical table name in the initial executor to a first physical table name corresponding to the first logical table name based on the mapping relationship; generate a first structured instruction based on the first physical table name; and execute the first structured instruction to obtain intermediate processing results.
[0090] In some optional implementations, the aforementioned business data processing device further includes: a second module, configured to match the target arrangement rules corresponding to the environment identification data in the environment adaptation rule set, arrange the initial business execution set according to the target arrangement rules to obtain the target business execution set adapted to the environment identification data, wherein the arrangement includes at least one of the following: adding, deleting, or adjusting the execution order of executors; and calling environment data based on the initial executors in the target business execution set.
[0091] In some optional implementations, the aforementioned business data processing apparatus further includes: a third module, configured to construct an executor dependency graph based on executor dependency description information; determine, based on the executor dependency graph, a group of executors that can be executed in parallel and a sequence of executors that can be executed serially; execute the executor group in parallel, transmit the processing results of each executor in the executor group to the result aggregation module, aggregate the processing results of each executor to obtain an aggregated result; and transmit the aggregated result to the target executor in the executor sequence based on the executor dependency graph, wherein the target executor has a prior dependency relationship with the executor group.
[0092] The business data processing apparatus provided in this application embodiment can execute the business data processing method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0093] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0094] The following is a detailed reference. Figure 4 The diagram illustrates a structural schematic suitable for implementing the electronic device described in the embodiments of this application. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from memory 408 into random access memory (RAM) 403. The RAM 403 also stores various programs and data required for the operation of the electronic device. The processor 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0095] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0096] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from memory 408, or installed from ROM 402. When the computer program is executed by processor 401, it performs the functions defined in the business data processing method of embodiments of this application.
[0097] Figure 4 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0098] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the business data processing methods shown in the above embodiments are implemented.
[0099] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0100] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and all such modifications and variations fall within the scope defined by the appended claims.
Claims
1. A business data processing method, characterized in that, include: In response to a triggered execution operation, a business execution object corresponding to the execution operation is created, the business execution object including: business identification data and environment identification data; Based on the business identification data, the business execution set corresponding to the business identification data is invoked. The business execution set includes at least one executor, which is used to execute preset data processing logic. Based on the environmental identification data, load the environmental data corresponding to the environmental identification data; The environment data is invoked based on the initial executor in the business execution set. The data processing logic in the initial executor is executed to obtain an intermediate processing result. The intermediate processing result is transmitted to the business execution object. Based on the business execution object, the intermediate processing result is transmitted to the subsequent executors until the executors in the business execution set have completed their execution, and the business processing result corresponding to the execution operation is obtained.
2. The business data processing method according to claim 1, characterized in that, The method further includes: In response to the triggered first execution operation, a first business execution object corresponding to the first execution operation is created, the first business execution object including first business identification data; Based on the first service identifier data, the first service execution set corresponding to the first service identifier data is invoked. The first service execution set includes a first executor, which is used to execute the first data processing logic. In response to the triggered second execution operation, a second service execution object corresponding to the second execution operation is created, the second service execution object including second service identification data; Based on the second service identifier data, the second service execution set corresponding to the second service identifier data is invoked. If the second execution operation includes the first data processing logic, the second service execution set includes the first executor.
3. The business data processing method according to claim 2, characterized in that, The first service execution object includes first environment identification data, the second service execution object includes second environment identification data, and the method further includes: If the first execution operation and the second execution operation are triggered in the same application environment, the first environment identifier data and the second environment identifier data are the same; Based on the first environment identifier data, load the first environment data corresponding to the first environment identifier data, copy the first environment data to the first location, and call the first environment data at the first location based on the executor in the first business execution set; Based on the second environment identifier data, the first environment data is loaded, the first environment data is copied to the second location, and the first environment data in the second location is invoked based on the executor in the second business execution set.
4. The business data processing method according to claim 1, characterized in that, The business execution object also includes a mapping relationship between logical table names and physical table names. The step of calling the environment data based on the initial executor in the business execution set, executing the data processing logic in the initial executor, and obtaining intermediate processing results includes: Based on the initial executor, the initial structured instructions are determined; Locate the initial logical table name in the initial structured instruction, replace the initial logical table name with the physical table name corresponding to the initial logical table name, and generate the target structured instruction; The target structured instructions are executed to obtain the intermediate processing results.
5. The business data processing method according to claim 1, characterized in that, The business execution object also includes a mapping relationship between logical table names and physical table names. The step of calling the environment data based on the initial executor in the business execution set, executing the data processing logic in the initial executor, and obtaining intermediate processing results also includes: In the object-relational mapping stage, based on the mapping relationship, the first logical table name in the initial executor is mapped to the first physical table name corresponding to the first logical table name; Based on the first physical table name, generate the first structured instruction; Execute the first structured instruction to obtain the intermediate processing result.
6. The business data processing method according to claim 1, characterized in that, The business execution object also includes an environment adaptation rule set, which stores executor arrangement rules corresponding to different environment identifiers. Before calling the environment data, it also includes: Match the target arrangement rule corresponding to the environment identification data in the environment adaptation rule set, and arrange the initial business execution set according to the target arrangement rule to obtain the target business execution set adapted to the environment identification data. The arrangement includes at least one of the following: adding, deleting, or adjusting the execution order of executors. The environment data is invoked based on the initial executor in the target business execution set.
7. The business data processing method according to claim 1, characterized in that, The business execution object further includes: a result aggregation module; the business execution set further includes: executor dependency description information, the executor dependency description information being used to characterize the pre-dependencies of each executor; the method further includes: Based on the executor dependency description information, an executor dependency graph is constructed; Based on the actuator dependency graph, determine the groups of actuators that can be executed in parallel and the sequences of actuators that can be executed in sequence; The executor group is executed in parallel, and the processing results of each executor in the executor group are transmitted to the result aggregation module to aggregate the processing results of each executor to obtain an aggregated result; Based on the executor dependency graph, the aggregation result is transmitted to the target executor in the executor sequence, wherein the target executor has a prior dependency relationship with the executor group.
8. A business data processing device, characterized in that, include: The triggering module is used to create a business execution object corresponding to the triggering execution operation in response to the triggering execution operation. The business execution object includes: business identification data and environment identification data. The calling module is used to call the business execution set corresponding to the business identification data based on the business identification data. The business execution set includes at least one executor, which is used to execute preset data processing logic. The loading module is used to load environmental data corresponding to the environmental identification data based on the environmental identification data; The execution module is used to call the environment data based on the initial executor in the business execution set, execute the data processing logic in the initial executor, obtain intermediate processing results, transmit the intermediate processing results to the business execution object, and transmit the intermediate processing results to subsequent executors based on the business execution object, until the executors in the business execution set have completed their execution, and obtain the business processing result corresponding to the execution operation.
9. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the steps of the business data processing method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the steps of the business data processing method according to any one of claims 1 to 7.