Service information management method and device and storage medium

By constructing a state machine to manage business information, the problem of poor stability in the business system was solved, and the stability and response speed of the business system were improved, ensuring the continuity of business processes and data integrity.

CN121807856APending Publication Date: 2026-04-07TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing business information management methods result in poor stability of business systems, especially when servers crash, services restart, or unexpected disconnections occur, making it difficult to automatically restore the task state to its pre-crash state, thus affecting business continuity and user experience.

Method used

By parsing business information to obtain business identifiers, status data, event data, and transformation rule data, business tables, status definition tables, event definition tables, and transformation rule tables are constructed and stored in the target database. A state machine is then built to manage business information and achieve the stability of the business system.

Benefits of technology

It improved the stability and response speed of the business system, reduced error handling in abnormal situations, and ensured the continuity of business processes and data integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807856A_ABST
    Figure CN121807856A_ABST
Patent Text Reader

Abstract

The invention discloses a business information management method and device and a storage medium. The method relates to the field of data management, and comprises the following steps: acquiring first service information, and analyzing a first service identifier, first state data, first event data and first conversion rule data from the first service information; if it is detected that the target database does not contain the first service identifier, constructing a first service table, a first state definition table, a first event definition table and a first conversion rule table according to the first service identifier; storing the first business table, the first state definition table, the first event definition table and the first conversion rule table into a target database; and constructing a first state machine according to the first business table, the first state definition table, the first event definition table and the first conversion rule table in the target database, and managing the first business information according to the first state machine. Through the application, the problem of poor stability of a service system caused by a service information management method in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data management, and more specifically, to a method, apparatus, and storage medium for managing business information. Background Technology

[0002] In existing technologies, business state management is typically hard-coded into program logic. This not only limits the flexibility of business rules but also makes it difficult for the system to automatically recover to the task state before the crash in the face of emergencies such as server downtime, service restarts, or unexpected disconnections. This leads to data processing interruptions, impacting business continuity and user experience. Current business information management methods often deeply couple the definition of business states, event handling logic, and state transition rules into the system code. This means that any adjustment to the business process requires corresponding code modifications and system restarts, a process that is not only time-consuming but may also introduce new technical risks. Furthermore, when a business system experiences an interruption, the lack of an effective state persistence mechanism means that the system cannot accurately recover to the business state before the interruption after restarting, potentially leading to the failure to export critical data and harming the company's economic benefits.

[0003] There is currently no effective solution to the problem of poor stability of business systems caused by the business information management methods in related technologies. Summary of the Invention

[0004] The main objective of this application is to provide a method, apparatus, and storage medium for managing business information, in order to solve the problem of poor stability of business systems caused by business information management methods in related technologies.

[0005] To achieve the above objectives, according to one aspect of this application, a method for managing business information is provided. The method includes: acquiring first business information; parsing a first business identifier, first state data, first event data, and first conversion rule data from the first business information; if it is detected that the target database does not contain the first business identifier, then constructing a first business table based on the first business identifier, constructing a first state definition table based on the first state data and the first business identifier, constructing a first event definition table based on the first event data and the first business identifier, and constructing a first conversion rule table based on the first conversion rule data and the first business identifier; storing the first business table, the first state definition table, the first event definition table, and the first conversion rule table in the target database; constructing a first state machine based on the first business table, the first state definition table, the first event definition table, and the first conversion rule table in the target database, and managing the first business information based on the first state machine.

[0006] Optionally, a first state machine is constructed based on the first business table, first state definition table, first event definition table, and first transition rule table in the target database. Managing first business information based on the first state machine includes: creating a state machine framework; registering the state set from the first state definition table to the state machine framework, and registering the event set from the first event definition table to the state machine framework, resulting in a registered state machine framework; constructing a first state machine based on the registered state machine framework and the transition rule set from the first transition rule table; initializing the first state machine based on the initial state defined in the first state definition table; and integrating the initialized first state machine into the business system, managing first business information based on the first state machine in the business system.

[0007] Optionally, after constructing a first state machine based on the first business table, first state definition table, first event definition table, and first transition rule table in the target database, and managing the first business information based on the first state machine, the method further includes: recording the first state data and the occurrence time of the first event of the first business information in the log information, wherein the occurrence time of the first event is the time when the first state data determined according to the first transition rule data changes.

[0008] Optionally, after constructing a first state machine based on the first business table, first state definition table, first event definition table, and first transition rule table in the target database, and managing the first business information based on the first state machine, the method further includes: upon receiving a configuration change notification, determining whether the target database contains a second business identifier for the second business information, wherein the configuration change notification is used to indicate a change in the first business information; if the target database contains a second business identifier for the second business information, and the second business identifier is the same as the first business identifier in the target database, then pausing the first state machine and serializing and storing the first state data; constructing a second business table, a second state definition table, a second event definition table, and a second transition rule table based on the second business information; storing the second business table, the second state definition table, the second event definition table, and the second transition rule table in the target database; updating the first state machine based on the second business table, the second state definition table, the second event definition table, the second transition rule table, and the serialized and stored first state data in the target database, and managing the second business information based on the updated first state machine.

[0009] Optionally, after determining whether the target database contains a second business identifier for the second business information, the method further includes: if the target database does not contain a second business identifier for the second business information, constructing a third business table, a third state definition table, a third event definition table, and a third transition rule table based on the second business information; storing the third business table, the third state definition table, the third event definition table, and the third transition rule table in the target database; constructing a second state machine based on the third business table, the third state definition table, the third event definition table, and the third transition rule table; and managing the second business information based on the second state machine.

[0010] Optionally, after constructing a second state machine based on the third business table, the third state definition table, the third event definition table, and the third transition rule table, and managing the third business information based on the second state machine, the method further includes: recording the third state data and the occurrence time of the third event of the second business information in the log information, wherein the occurrence time of the third event is the time when the third state data changes as determined by the third transition rule data.

[0011] Optionally, after constructing a first state machine based on the first business table, first state definition table, first event definition table, and first transition rule table in the target database, and managing the first business information based on the first state machine, the method further includes: determining the first state data of the first business information based on log information in the event of a failure in the business system; and performing fault recovery on the business system based on the first state data.

[0012] To achieve the above objectives, according to another aspect of this application, a business information management apparatus is provided. The apparatus includes: an acquisition unit, configured to acquire first business information and parse a first business identifier, first state data, first event data, and first conversion rule data from the first business information; a first construction unit, configured to, if a target database does not contain the first business identifier, construct a first business table based on the first business identifier, construct a first state definition table based on the first state data and the first business identifier, construct a first event definition table based on the first event data and the first business identifier, and construct a first conversion rule table based on the first conversion rule data and the first business identifier; a first storage unit, configured to store the first business table, the first state definition table, the first event definition table, and the first conversion rule table in the target database; and a first management unit, configured to construct a first state machine based on the first business table, the first state definition table, the first event definition table, and the first conversion rule table in the target database, and manage the first business information based on the first state machine.

[0013] According to another aspect of this application, a computer-readable storage medium is provided, which includes a stored program, wherein, when the program is running, it controls the device where the computer-readable storage medium is located to perform a management method for any kind of business information.

[0014] According to another aspect of this application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include a management method for performing any kind of business information.

[0015] According to another aspect of this application, a computer program product is provided, including computer instructions, wherein when the computer instructions are executed by a processor, the steps of a method for managing business information as described above are implemented.

[0016] In this embodiment, by acquiring first business information, a first business identifier, first state data, first event data, and first conversion rule data are parsed from the first business information. If the target database does not contain the first business identifier, a first business table is constructed based on the first business identifier, a first state definition table is constructed based on the first state data and the first business identifier, a first event definition table is constructed based on the first event data and the first business identifier, and a first conversion rule table is constructed based on the first conversion rule data and the first business identifier. The first business table, the first state definition table, the first event definition table, and the first conversion rule table are stored in the target database. A first state machine is constructed based on the first business table, the first state definition table, the first event definition table, and the first conversion rule table in the target database. The first business information is managed based on the first state machine, thus solving the technical problem of poor stability of the business system caused by the business information management method in related technologies. In this application, key business identifiers, status data, event data, and conversion rule data are parsed from the acquired first business information. The system checks whether a business table structure related to the first business identifier already exists in the target database. If the target database does not have a table structure for the business identifier, a first business table, a first state definition table, a first event definition table, and a first conversion rule table are constructed and stored in the target database. A first state machine is constructed based on the first business table, the first state definition table, the first event definition table, and the first conversion rule table stored in the database. The first business information is managed based on the first state machine, thereby achieving the technical effect of improving the stability of the business system. Attached Figure Description

[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 A hardware structure block diagram of a computer terminal for implementing a method for managing business information is shown.

[0019] Figure 2 This is a flowchart of a business information management method provided according to an embodiment of this application;

[0020] Figure 3 This is a schematic diagram of the business table, state definition table, event definition table, and rule conversion table provided according to the embodiments of this application;

[0021] Figure 4 This is a schematic diagram illustrating the processing of business information according to an embodiment of this application;

[0022] Figure 5 This is a schematic diagram illustrating the creation of a state machine based on business information according to an embodiment of this application;

[0023] Figure 6 This is a design architecture diagram of the business information management method provided in this embodiment;

[0024] Figure 7 This is a schematic diagram of a business information management device according to an embodiment of this application;

[0025] Figure 8 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] It should be noted that all relevant information (including but not limited to business information, database information, etc.) and data (including but not limited to data used for storage, data parsing, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties. For example, if there is an interface between this system and the relevant user or organization, before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.

[0029] Example 1

[0030] According to an embodiment of this application, a method embodiment for managing business information is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0031] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for managing business information is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0032] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0033] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the business information management method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned business information management method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0034] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0035] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0036] Under the aforementioned operating environment, this application provides the following: Figure 2 The method for managing business information is shown. Figure 2 This is a flowchart of a business information management method according to Embodiment 1 of this application.

[0037] Step S201: Obtain the first business information, and parse the first business identifier, first status data, first event data, and first conversion rule data from the first business information.

[0038] Optionally, the aforementioned first business information refers to business-related information within the business system. The first business identifier is a unique identifier for the business, used to distinguish different business instances or types, such as business ID, order ID, transaction ID, etc. The first state data reflects the current state of the business; for example, in an order processing flow, it could be "unprocessed," "processing," or "completed." The first event data records the events that trigger state transitions; for example, in an order process, this could be "payment successful," "goods shipped," or "user refund request," etc. The first transition rule data defines the rules for transitioning from one state to another under a specific event, including the transition conditions, actions, and target state. By parsing the business information, the business identifier, current state, triggering events, and transition rules can be obtained, which forms the basis for state machine configuration.

[0039] Step S202: If the target database does not contain the first service identifier, then a first service table is constructed based on the first service identifier, a first state definition table is constructed based on the first state data and the first service identifier, a first event definition table is constructed based on the first event data and the first service identifier, and a first conversion rule table is constructed based on the first conversion rule data and the first service identifier.

[0040] Optionally, the first business table stores basic business information, including business ID, business name, etc. The first state definition table stores the states that occur in the business process; for example, in an order process, states such as "unpaid," "paid," "shipped," and "completed" are defined. The first event definition table stores events that may trigger state changes, along with detailed descriptions and attributes of these events. The first transition rule table stores the rules governing how the state machine transitions from one state to another upon event triggering.

[0041] For example, Figure 3 The diagram shows a business table, a state definition table, an event definition table, and a rule conversion table provided according to an embodiment of this application. These four tables are associated through a business ID. The business table includes a business ID and a business name. The state definition table includes a state ID, a business ID, a state code, a state name, a state start identifier, and a state end identifier. The event definition table includes an event ID, a business ID, an event code, and an event name. The conversion rule table includes a rule ID, a business ID, a source state code, a target state code, and an event code.

[0042] Step S203: Store the first business table, the first state definition table, the first event definition table, and the first conversion rule table into the target database.

[0043] Optionally, the first business table, the first state definition table, the first event definition table, and the first transformation rule table are stored in the target database. Even after the business system restarts or fails, the system can quickly restore the business process to the correct state by reading the information in the target database, thereby ensuring the continuity of the business process and the integrity of the data.

[0044] Step S204: Construct a first state machine based on the first business table, first state definition table, first event definition table and first transition rule table in the target database, and manage the first business information based on the first state machine.

[0045] Optionally, the constructed first state machine can perform state transitions based on the events that occur, thereby improving the response speed of the business system, reducing error handling in abnormal situations, and improving the overall stability and efficiency of the business system.

[0046] For example, such as Figure 4 The diagram illustrates the processing of business information. First, the front end receives the business information, which is the configuration data of the state machine. Then, the server receives the business information and parses out the business ID, state data, event data, and transformation rule data from it. The existence of the business is verified by checking if the business ID exists in the target database. If the business ID exists, the processing is confirmed to be complete. If the business ID does not exist, the constructed business table is stored in the target database. A state definition table is constructed based on the business ID and state data, an event definition table is constructed based on the event data and business ID, and a transformation rule table is constructed based on the transformation rule data and business ID. The state definition table, event definition table, and rule transformation table are then stored in the database.

[0047] The business information management method provided in this application provides a method for parsing key business identifiers, status data, event data, and conversion rule data from the acquired first business information. It then checks whether a business table structure related to the first business identifier already exists in the target database. If the target database does not have a table structure for the business identifier, it constructs a first business table, a first state definition table, a first event definition table, and a first conversion rule table, and stores these four tables in the target database. Based on the first business table, first state definition table, first event definition table, and first conversion rule table stored in the database, it constructs a first state machine. The first business information is then managed using the first state machine. This method solves the technical problem of poor stability in business systems caused by business information management methods in related technologies, and achieves the technical effect of improving the stability of business systems.

[0048] To improve the stability of the business system, optionally, in the business information management method provided in this application embodiment, a first state machine is constructed based on a first business table, a first state definition table, a first event definition table, and a first transition rule table in the target database, and the management of first business information based on the first state machine includes:

[0049] The first step is to create the state machine framework.

[0050] Alternatively, a state machine framework is a software architecture that provides a set of rules and APIs for defining and managing the behavior of state machines.

[0051] The second step is to register the set of states in the first state definition table into the state machine framework, and to register the set of events in the first event definition table into the state machine framework, thus obtaining the registered state machine framework.

[0052] Alternatively, you can read the definition data of states and events from the target database and use the APIs provided by the state machine framework, such as registerState() and registerEvent(), to register the state set and event set into the framework.

[0053] The third step is to construct the first state machine based on the registered state machine framework and the set of transition rules in the first transition rule table.

[0054] Optionally, a specific state machine instance can be constructed based on the registered state machine framework and the transition rules in the first transition rule table. The transition rules in the first transition rule table are parsed and applied to the state machine framework, defining the transition logic between states.

[0055] The fourth step is to initialize the first state machine according to the initial state defined in the first state definition table.

[0056] Optionally, by querying the first state definition table in the target database, the corresponding initial state can be found. The state machine framework is initialized based on the initial state, and the first state machine can start running from the correct starting point.

[0057] The fifth step is to integrate the initialized first state machine into the business system and manage the first business information based on the first state machine in the business system.

[0058] Optionally, the initialized first state machine is integrated into the business system and can become part of the business process automation. The business logic in the business system calls the first state machine. Based on the current state and the triggering event, the state machine performs state transitions and saves the state context to the target database.

[0059] In summary, through the above steps, a state machine based on state data was constructed to manage business information, thereby enhancing the stability and responsiveness of the business system.

[0060] To improve the smoothness of business processes, optionally, in the business information management method provided in the embodiments of this application, after constructing a first state machine based on the first business table, the first state definition table, the first event definition table and the first transition rule table in the target database, and managing the first business information according to the first state machine, the method further includes: recording the first state data and the occurrence time of the first event of the first business information in the log information, wherein the occurrence time of the first event is the time when the first state data determined according to the first transition rule data changes.

[0061] Optionally, when the state machine transitions to a new state according to the first transition rule data, the log information records this transition event, including the first state data (i.e., the state before / after the transition), the first event that triggered the state transition, and the time when the first event occurred. By recording detailed information about state changes and events in the log information, every step of the business process can be tracked, which helps to quickly locate problems when the business system fails or crashes. The log information can be used to restore the business process to the state before the failure point.

[0062] To improve the continuity of business processes, optionally, in the business information management method provided in the embodiments of this application, after constructing a first state machine based on a first business table, a first state definition table, a first event definition table, and a first transition rule table in the target database, and managing the first business information based on the first state machine, the method further includes:

[0063] The first step, upon receiving a configuration change notification, is to determine whether the target database contains a second service identifier for the second service information. The configuration change notification is used to indicate a change to the first service information.

[0064] Optionally, the configuration change notification is used to indicate a change in the configuration information of the first state machine, that is, a change in the first service information. The second service identifier is a unique identifier for the service information to be updated (i.e., the second service information mentioned above), used to verify whether the configuration change is related to the currently processed service.

[0065] The second step is to pause the first state machine and serialize and store the first state data if the target database contains the second service identifier of the second service information and the second service identifier is the same as the first service identifier in the target database.

[0066] Optionally, upon detecting a configuration change related to the current first service, the running first state machine will be paused, the current state data of the first state machine will be serialized and saved to persistent storage, so that the state machine can be restored to the correct state after an update.

[0067] The third step is to construct a second business table, a second state definition table, a second event definition table, and a second conversion rule table based on the second business information.

[0068] Optionally, updated business tables, status definition tables, event definition tables, and transformation rule tables can be constructed based on the second business information in the configuration change notification, namely the aforementioned second business table, second status definition table, second event definition table, and second transformation rule table, to reflect the new changes in the business process.

[0069] The fourth step is to store the second business table, the second state definition table, the second event definition table, and the second transformation rule table into the target database.

[0070] Optionally, the updated second business table, second state definition table, second event definition table, and second transition rule table in the target database provide a data foundation for subsequent state machine updates, ensuring the real-time validity of business rules.

[0071] The fifth step is to update the first state machine based on the second business table, second state definition table, second event definition table, second transformation rule table and serialized first state data in the target database, and to manage the second business information based on the updated first state machine.

[0072] Optionally, based on the data in the second business table, the second state definition table, the second event definition table, and the second transition rule table, the definition of the first state machine is updated, its state logic and transition rules are adjusted, and the state of the first state machine is restored using the serialized stored first state data, ensuring that the update process does not affect the continuity of the current business process. The updated first state machine continues to run, managing the second business information according to the latest business rules.

[0073] In summary, by following the steps above, checking the correlation between the configuration change notification and the currently processed first business information, serializing and storing the current state data, constructing and updating the table structure in the target database based on the second business information, providing a data foundation for updating the first state machine, and then updating the state machine and restoring the state data, the continuity of the business process and the integrity of the data are improved.

[0074] For example, Figure 5The diagram shown is a schematic diagram of creating a state machine based on business information according to an embodiment of this application. First, new configuration information is generated based on the received new business information, and a configuration change message is pushed to the state machine service. The state machine service pauses the current state machine and serializes and stores the current state machine's state information. A new table structure is generated based on the acquired new configuration information, the previous state is deserialized, the state machine state is restored, and the state machine is updated.

[0075] To improve the stability of the business system, optionally, in the business information management method provided in this application embodiment, after determining whether the target database contains a second business identifier of the second business information, the method further includes:

[0076] The first step is to construct a third business table, a third state definition table, a third event definition table, and a third conversion rule table based on the second business information if the target database does not contain the second business identifier.

[0077] Optionally, upon receiving a configuration change notification, the system checks whether a record corresponding to the second service identifier in the configuration change notification exists in the target database. If no corresponding record is found in the target database, a third service table, a third state definition table, a third event definition table, and a third conversion rule table will be constructed based on the new service information contained in the configuration change notification.

[0078] The second step is to store the third business table, the third state definition table, the third event definition table, and the third transformation rule table into the target database.

[0079] Optionally, the data in the constructed third business table, third state definition table, third event definition table, and third transformation rule table are stored in the target database, realizing the persistent storage of business rules and facilitating the management of subsequent business processes.

[0080] The third step is to construct a second state machine based on the third business table, the third state definition table, the third event definition table, and the third transition rule table, and then manage the second business information based on the second state machine.

[0081] Optionally, a second state machine can be constructed based on the data stored in the third business table, third state definition table, third event definition table, and third transition rule table in the target database to reflect the specific rules and processes of the new business.

[0082] In summary, by following the steps above, a corresponding table structure is constructed based on the new business information and stored in the target database. A second state machine is constructed based on the new table structure, and the second business information is managed based on the second state machine, thereby improving the efficiency and accuracy of the business process.

[0083] To improve the smoothness of business processes, optionally, in the business information management method provided in the embodiments of this application, after constructing a second state machine based on a third business table, a third state definition table, a third event definition table, and a third transition rule table, and managing the third business information based on the second state machine, the method further includes: recording the third state data of the second business information and the occurrence time of the third event in the log information, wherein the occurrence time of the third event is the time when the third state data changes as determined by the third transition rule data.

[0084] Optionally, when the second state machine performs a state transition according to the third transition rule data, it generates corresponding log information, recording the third state data before and after the transition, as well as the third event that triggered the state change and the time of occurrence of the third event, for subsequent query and analysis. By recording detailed information about states and events in the log information, a complete historical trajectory of business process execution can be provided, which is helpful for troubleshooting, auditing, and business decision-making.

[0085] To improve the smoothness of business processes, optionally, in the business information management method provided in the embodiments of this application, after constructing a first state machine based on the first business table, the first state definition table, the first event definition table, and the first transition rule table in the target database, and managing the first business information according to the first state machine, the method further includes:

[0086] The first step is to determine the first state data of the first business information based on the log information in the event of a failure in the business system.

[0087] Optionally, when a failure is detected in the business system, the latest status and event records related to the first business information can be retrieved by accessing the log information. By parsing the log information, the first state data of the first business information before the failure occurred can be determined, that is, the last known valid state of the business process.

[0088] The second step is to perform fault recovery on the business system based on the first state data.

[0089] Optionally, once the initial state data is determined, the business system can be restored based on this data. The recovery process may include restarting the service, restoring the database, or resetting the business processes to the state point represented by the initial state data.

[0090] In summary, by following the steps outlined above, when a business system faces a failure, the pre-recorded log information can be used to determine the interruption point of the business process. During the fault recovery process, the business process can continue execution from the correct state point instead of starting from the beginning, which greatly saves recovery time and improves the smoothness of the business process.

[0091] Figure 6The diagram shows the design architecture of the business information management method provided in this embodiment, including an application layer, a business layer, and a data storage layer. The application layer includes a Data Flow Engine (DFE), which is a data engine used to receive data requests, trigger events, and coordinate the processing of state data. The business layer includes a state data construction interface and a state machine service. The state data construction interface includes business data construction, state data construction, event data construction, and rule data construction. The state machine service includes state machine construction, state machine update, state machine listener, and state machine context storage. State machine construction is used to dynamically construct a state machine based on state data, event data, and rule data. State machine update is used to update the state machine configuration when the configuration center data changes. The state machine listener is used to continuously listen for and process event signals from the DFE or other application layers. Upon detecting a trigger event, it determines the state transition of the state machine based on the current state and transition rules, and executes the corresponding business actions. The state machine context storage persists the current state of the state machine, business data, event records, and transition logic to the data storage layer to prevent the loss of critical information due to system failures. The state data construction interface and state machine service interact with the configuration / management module. The data storage layer includes Oracle, OceanBase, and Redis. Oracle and OceanBase, as relational databases, are used to store long-term persistent information such as business data, state definitions, event definitions, and transition rules. Redis, as a high-speed caching database, provides fast access to state data, making it particularly suitable for scenarios with frequent state transitions and ensuring the efficient operation of the state machine service. When the DFE receives a business event, it passes the event information to the state data construction interface of the business layer. The corresponding submodule in the interface is responsible for parsing the event, constructing the corresponding business data, state data, event data, and rule data, and then passing this data to the state machine service. The state machine service constructs or updates the state machine based on the received data, and the state machine listener waits for event signals to drive state transitions. During each state transition, the state machine context storage module saves the latest state information and business data to the data storage layer, ensuring data security and consistency. When the business system restarts or recovers from a fault for various reasons, the state machine service can recover the state information from the data storage layer, thereby quickly restoring to the correct operating state and reducing the risk of data loss.

[0092] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0093] Example 2

[0094] This application also provides a business information management device. It should be noted that the business information management device of this application can be used to execute the business information management method provided in this application. The business information management device provided in this application is described below.

[0095] According to embodiments of this application, an apparatus for implementing the above-described business information management method is also provided, such as... Figure 7 As shown, the device includes: an acquisition unit 701, a first construction unit 702, a first storage unit 703, and a first management unit 704.

[0096] Specifically, the acquisition unit 701 is used to acquire the first service information and parse the first service identifier, the first status data, the first event data and the first conversion rule data from the first service information;

[0097] The first construction unit 702 is configured to, if the target database does not contain the first service identifier, construct a first service table based on the first service identifier, construct a first state definition table based on the first state data and the first service identifier, construct a first event definition table based on the first event data and the first service identifier, and construct a first conversion rule table based on the first conversion rule data and the first service identifier;

[0098] The first storage unit 703 is used to store the first business table, the first state definition table, the first event definition table and the first conversion rule table into the target database;

[0099] The first management unit 704 is used to construct a first state machine based on the first business table, the first state definition table, the first event definition table, and the first transition rule table in the target database, and to manage the first business information based on the first state machine.

[0100] The business information management device provided in this application embodiment acquires first business information through an acquisition unit 701, and parses a first business identifier, first state data, first event data, and first conversion rule data from the first business information. If the first construction unit 702 detects that the target database does not contain the first business identifier, it constructs a first business table based on the first business identifier, a first state definition table based on the first state data and the first business identifier, a first event definition table based on the first event data and the first business identifier, and a first conversion rule table based on the first conversion rule data and the first business identifier. The first storage unit 703 stores the first business table, the first state definition table, the first event definition table, and the first conversion rule table in the target database. The first management unit 704 constructs a first state machine based on the first business table, the first state definition table, the first event definition table, and the first conversion rule table in the target database, and manages the first business information based on the first state machine. This solves the technical problem of poor stability of the business system caused by the business information management method and achieves the technical effect of improving the stability of the business system.

[0101] Optionally, in the business information management device provided in this application embodiment, the first management unit 704 includes: a creation module for creating a state machine framework; a registration module for registering the state set in the first state definition table to the state machine framework and the event set in the first event definition table to the state machine framework, thereby obtaining a registered state machine framework; a construction module for constructing a first state machine based on the registered state machine framework and the set of transition rules in the first transition rule table; an initialization module for initializing the first state machine based on the initial state defined in the first state definition table; and a management module for integrating the initialized first state machine into the business system and managing the first business information based on the first state machine in the business system.

[0102] Optionally, in the business information management device provided in the embodiments of this application, the device further includes: a first recording unit, configured to, after constructing a first state machine based on a first business table, a first state definition table, a first event definition table and a first conversion rule table in a target database, and managing the first business information according to the first state machine, record the first state data and the occurrence time of the first event of the first business information in the log information, wherein the occurrence time of the first event is the time when the first state data determined according to the first conversion rule data changes.

[0103] Optionally, in the business information management device provided in this application embodiment, the device further includes: a receiving unit, configured to, after constructing a first state machine based on a first business table, a first state definition table, a first event definition table, and a first conversion rule table in a target database, and managing the first business information based on the first state machine, determine whether the target database contains a second business identifier of the second business information upon receiving a configuration change notification, wherein the configuration change notification is used to indicate a change in the first business information; a second storage unit, configured to, if the target database contains a second business identifier of the second business information, and the second business identifier is the same as the first business identifier in the target database, then suspend the first state machine and serialize and store the first state data; a second construction unit, configured to construct a second business table, a second state definition table, a second event definition table, and a second conversion rule table based on the second business information; a third storage unit, configured to store the second business table, the second state definition table, the second event definition table, and the second conversion rule table in the target database; and a second management unit, configured to update the first state machine based on the second business table, the second state definition table, the second event definition table, the second conversion rule table, and the serialized first state data in the target database, and manage the second business information based on the updated first state machine.

[0104] Optionally, in the business information management device provided in the embodiments of this application, the device further includes: a third construction unit, configured to, after determining whether the target database contains the second business identifier of the second business information, if the target database does not contain the second business identifier of the second business information, construct a third business table, a third state definition table, a third event definition table, and a third conversion rule table based on the second business information; a fourth storage unit, configured to store the third business table, the third state definition table, the third event definition table, and the third conversion rule table in the target database; and a third management unit, configured to construct a second state machine based on the third business table, the third state definition table, the third event definition table, and the third conversion rule table, and manage the second business information based on the second state machine.

[0105] Optionally, in the business information management device provided in the embodiments of this application, the device further includes: a second recording unit, used to record the third state data and the occurrence time of the third event of the second business information in the log information after constructing a second state machine according to the third business table, the third state definition table, the third event definition table and the third transition rule table, and managing the third business information according to the second state machine, wherein the occurrence time of the third event is the time when the third state data determined according to the third transition rule data changes.

[0106] Optionally, in the business information management device provided in the embodiments of this application, the device further includes: a determining unit, configured to, after constructing a first state machine based on a first business table, a first state definition table, a first event definition table and a first conversion rule table in a target database, and managing the first business information based on the first state machine, determine the first state data of the first business information based on log information in the event of a failure in the business system; and a recovery unit, configured to perform fault recovery on the business system based on the first state data.

[0107] It should be noted that the aforementioned acquisition unit 701, first construction unit 702, first storage unit 703, and first management unit 704 correspond to steps S201 to S204 in Embodiment 1. The four units and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the aforementioned modules or units can be hardware or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). These modules can also run as part of a device in the computer terminal 10 provided in Embodiment 1.

[0108] Example 3

[0109] Embodiments of this application may provide a computer terminal, which may be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the aforementioned computer terminal may also be replaced with a mobile terminal or an electronic device, etc.

[0110] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.

[0111] In this embodiment, the computer terminal described above can execute the program code for the following steps in the business information management method: obtaining first business information, parsing out a first business identifier, first state data, first event data, and first conversion rule data from the first business information; if the target database does not contain the first business identifier, constructing a first business table based on the first business identifier, constructing a first state definition table based on the first state data and the first business identifier, constructing a first event definition table based on the first event data and the first business identifier, and constructing a first conversion rule table based on the first conversion rule data and the first business identifier; storing the first business table, the first state definition table, the first event definition table, and the first conversion rule table in the target database; constructing a first state machine based on the first business table, the first state definition table, the first event definition table, and the first conversion rule table in the target database, and managing the first business information based on the first state machine.

[0112] Optionally, the aforementioned computer terminal can execute the program code for the following steps in the business information management method: constructing a first state machine based on the first business table, first state definition table, first event definition table, and first transition rule table in the target database; managing the first business information based on the first state machine includes: creating a state machine framework; registering the state set in the first state definition table to the state machine framework, and registering the event set in the first event definition table to the state machine framework, thus obtaining a registered state machine framework; constructing a first state machine based on the registered state machine framework and the transition rule set in the first transition rule table; initializing the first state machine based on the initial state defined in the first state definition table; integrating the initialized first state machine into the business system, and managing the first business information based on the first state machine in the business system.

[0113] Optionally, the computer terminal described above can execute the program code for the following steps in the business information management method: after constructing a first state machine based on the first business table, the first state definition table, the first event definition table, and the first transition rule table in the target database, and managing the first business information based on the first state machine, the method further includes: recording the first state data and the occurrence time of the first event of the first business information in the log information, wherein the occurrence time of the first event is the time when the first state data changes as determined by the first transition rule data.

[0114] Optionally, the computer terminal described above can execute the program code for the following steps in the business information management method: after constructing a first state machine based on the first business table, first state definition table, first event definition table, and first conversion rule table in the target database, and managing the first business information based on the first state machine, the method further includes: upon receiving a configuration change notification, determining whether the target database contains a second business identifier for the second business information, wherein the configuration change notification is used to indicate a change in the first business information; if the target database contains a second business identifier for the second business information, and the second business identifier is the same as the first business identifier in the target database, then pausing the first state machine and serializing and storing the first state data; constructing a second business table, a second state definition table, a second event definition table, and a second conversion rule table based on the second business information; storing the second business table, the second state definition table, the second event definition table, and the second conversion rule table in the target database; updating the first state machine based on the second business table, the second state definition table, the second event definition table, the second conversion rule table, and the serialized and stored first state data in the target database, and managing the second business information based on the updated first state machine.

[0115] Optionally, the computer terminal described above can execute the program code for the following steps in the business information management method: after determining whether the target database contains a second business identifier of the second business information, the method further includes: if the target database does not contain a second business identifier of the second business information, then constructing a third business table, a third state definition table, a third event definition table, and a third conversion rule table based on the second business information; storing the third business table, the third state definition table, the third event definition table, and the third conversion rule table in the target database; constructing a second state machine based on the third business table, the third state definition table, the third event definition table, and the third conversion rule table, and managing the second business information based on the second state machine.

[0116] Optionally, the computer terminal described above can execute the program code for the following steps in the business information management method: after constructing a second state machine based on the third business table, the third state definition table, the third event definition table, and the third transition rule table, and managing the third business information based on the second state machine, the method further includes: recording the third state data of the second business information and the occurrence time of the third event in the log information, wherein the occurrence time of the third event is the time when the third state data changes as determined by the third transition rule data.

[0117] Optionally, the computer terminal described above can execute the program code for the following steps in the business information management method: after constructing a first state machine based on the first business table, the first state definition table, the first event definition table, and the first transition rule table in the target database, and managing the first business information based on the first state machine, the method further includes: in the event of a failure in the business system, determining the first state data of the first business information based on log information; and performing fault recovery on the business system based on the first state data.

[0118] Optionally, Figure 8 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 8 As shown, the electronic device may include: one or more ( Figure 8 (Only one is shown) processor 802, memory 804, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0119] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the business information management method and apparatus in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned business information management method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0120] The processor can access the information and application programs stored in the memory via the transmission device to execute the steps described above in the business information management method.

[0121] This application provides a solution for managing business information. By acquiring first business information, a first business identifier, first state data, first event data, and first conversion rule data are parsed from the first business information. If the target database does not contain the first business identifier, a first business table is constructed based on the first business identifier; a first state definition table is constructed based on the first state data and the first business identifier; a first event definition table is constructed based on the first event data and the first business identifier; and a first conversion rule table is constructed based on the first conversion rule data and the first business identifier. The first business table, first state definition table, first event definition table, and first conversion rule table are stored in the target database. A first state machine is constructed based on the first business table, first state definition table, first event definition table, and first conversion rule table in the target database. The first business information is managed using the first state machine. This solution addresses the technical problem of poor stability in business systems caused by traditional business information management methods, and improves the stability of business systems.

[0122] Those skilled in the art will understand that Figure 8 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 8 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 8 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 8 The different configurations shown.

[0123] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0124] Example 4

[0125] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the business information management method provided in Embodiment 1.

[0126] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0127] This application also provides a computer program product, which, when executed on a data processing device, is suitable for performing steps of a management method for business information.

[0128] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0129] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0130] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0131] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0132] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0133] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0134] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for managing business information, characterized in that, include: Obtain first business information, and parse the first business identifier, first status data, first event data, and first conversion rule data from the first business information; If the target database does not contain the first service identifier, then a first service table is constructed based on the first service identifier, a first state definition table is constructed based on the first state data and the first service identifier, a first event definition table is constructed based on the first event data and the first service identifier, and a first conversion rule table is constructed based on the first conversion rule data and the first service identifier. Store the first business table, the first state definition table, the first event definition table, and the first conversion rule table into the target database; A first state machine is constructed based on the first business table, the first state definition table, the first event definition table, and the first transformation rule table in the target database, and the first business information is managed based on the first state machine.

2. The method according to claim 1, characterized in that, A first state machine is constructed based on the first business table, the first state definition table, the first event definition table, and the first transition rule table in the target database. Managing the first business information based on the first state machine includes: Create a state machine framework; Register the set of states in the first state definition table to the state machine framework, and register the set of events in the first event definition table to the state machine framework to obtain the registered state machine framework. The first state machine is constructed based on the registered state machine framework and the set of transition rules in the first transition rule table; Initialize the first state machine according to the initial state defined in the first state definition table; The initialized first state machine is integrated into the business system, and the first business information is managed according to the first state machine in the business system.

3. The method according to claim 2, characterized in that, After constructing a first state machine based on the first business table, the first state definition table, the first event definition table, and the first transition rule table in the target database, and managing the first business information based on the first state machine, the method further includes: The log information records the first state data and the occurrence time of the first event of the first business information, wherein the occurrence time of the first event is the time when the first state data changes, as determined by the first conversion rule data.

4. The method according to claim 3, characterized in that, After constructing a first state machine based on the first business table, the first state definition table, the first event definition table, and the first transition rule table in the target database, and managing the first business information based on the first state machine, the method further includes: Upon receiving a configuration change notification, determine whether the target database contains a second service identifier for the second service information, wherein the configuration change notification is used to indicate a change to the first service information; If the target database contains a second service identifier for the second service information, and the second service identifier is the same as the first service identifier in the target database, then the first state machine is paused, and the first state data is serialized and stored. Construct a second business table, a second state definition table, a second event definition table, and a second conversion rule table based on the second business information; The second business table, the second state definition table, the second event definition table, and the second conversion rule table are stored in the target database; The first state machine is updated based on the second business table, the second state definition table, the second event definition table, the second conversion rule table, and the serialized first state data in the target database, and the second business information is managed based on the updated first state machine.

5. The method according to claim 4, characterized in that, After determining whether the target database contains a second business identifier for the second business information, the method further includes: If the target database does not contain a second business identifier for the second business information, then a third business table, a third state definition table, a third event definition table, and a third conversion rule table are constructed based on the second business information. The third business table, the third state definition table, the third event definition table, and the third conversion rule table are stored in the target database; A second state machine is constructed based on the third business table, the third state definition table, the third event definition table, and the third transition rule table, and the second business information is managed based on the second state machine.

6. The method according to claim 5, characterized in that, After constructing a second state machine based on the third business table, the third state definition table, the third event definition table, and the third transition rule table, and managing the third business information based on the second state machine, the method further includes: The log information records the third state data of the second business information and the occurrence time of the third event, wherein the occurrence time of the third event is the time when the third state data changes, as determined by the third conversion rule data.

7. The method according to claim 3, characterized in that, After constructing a first state machine based on the first business table, the first state definition table, the first event definition table, and the first transition rule table in the target database, and managing the first business information based on the first state machine, the method further includes: In the event of a failure in the business system, the first status data of the first business information is determined based on the log information; The business system is restored from failure based on the first status data.

8. A business information management device, characterized in that, include: The acquisition unit is used to acquire first service information and parse first service identifier, first status data, first event data and first conversion rule data from the first service information; The first construction unit is configured to, if the target database does not contain the first service identifier, construct a first service table based on the first service identifier, construct a first state definition table based on the first state data and the first service identifier, construct a first event definition table based on the first event data and the first service identifier, and construct a first conversion rule table based on the first conversion rule data and the first service identifier; The first storage unit is used to store the first business table, the first state definition table, the first event definition table, and the first conversion rule table into the target database; The first management unit is configured to construct a first state machine based on the first business table, the first state definition table, the first event definition table, and the first conversion rule table in the target database, and to manage the first business information based on the first state machine.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device where the computer-readable storage medium is located to perform the business information management method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program executes the business information management method according to any one of claims 1 to 7 when it runs.

11. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the business information management method according to any one of claims 1 to 7.