CN110851207B - State transition management method and device, electronic equipment and storage medium - Google Patents

State transition management method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110851207B
CN110851207B CN201910986615.9A CN201910986615A CN110851207B CN 110851207 B CN110851207 B CN 110851207B CN 201910986615 A CN201910986615 A CN 201910986615A CN 110851207 B CN110851207 B CN 110851207B
Authority
CN
China
Prior art keywords
state
service
current service
current
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910986615.9A
Other languages
Chinese (zh)
Other versions
CN110851207A (en
Inventor
张甫
杨光润
朱蕾
彭小波
何继远
周忠恳
马培
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai I2finance Software Co ltd
Original Assignee
Shanghai I2finance Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai I2finance Software Co ltd filed Critical Shanghai I2finance Software Co ltd
Priority to CN201910986615.9A priority Critical patent/CN110851207B/en
Publication of CN110851207A publication Critical patent/CN110851207A/en
Application granted granted Critical
Publication of CN110851207B publication Critical patent/CN110851207B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4498Finite state machines

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a state transition management method and device, electronic equipment and a computer readable storage medium. In the state transition management method, when the service state of the current service in the target processing unit needs to be managed, a state machine component is constructed based on a state transition rule matched with the current service state in the service state management unit, a service unit example corresponding to the unit identifier, the current service content, the current service state, a state reader and a state updater, and then the state transition management is performed on the service state of the current service in the target service unit based on the state machine component.

Description

State transition management method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of information management technologies, and in particular, to a state transition management method and apparatus, and an electronic terminal.
Background
In the existing service scenario, there are many service states involved in a service and state transition conditions between service states, but in the existing service development, all state settings, state transition controls, and the like are dispersed in codes, so that information such as effective service states in the service scenario and how to transition between service states cannot be accurately known when service state management is performed, and further, the transition management of service states is very difficult.
Disclosure of Invention
The embodiment of the application provides a state transition management method, which is applied to a service state management unit in a service system, and the method comprises the following steps:
acquiring a unit identifier and current service content of a target service unit in a service system, and acquiring a current service state corresponding to the current service content of the target service unit;
constructing a state machine component based on a state transition rule matched with the current service state in the service state management unit, a service unit instance corresponding to the unit identifier, the current service content, the current service state, a preset state reader and a preset state updater, wherein the state transition rule comprises an initial state and a state transition path of the service;
and performing state transition management on the service state of the current service content in the target service unit based on the state machine component.
The embodiment of the present application further provides a state transition management device, which is applied to a service state management unit in a service system, and the device includes:
the information acquisition module is used for acquiring the unit identification and the current service content of a target service unit in a service system and acquiring the current service state corresponding to the current service content of the target service unit;
a state machine component construction module, configured to construct a state machine component based on a state transition rule matched with the current service state in the service state management unit, a service unit instance corresponding to the unit identifier, the current service content, the current service state, and a preset state reader and a state updater, where the state transition rule includes an initial state and a state transition path of the service;
and the state management module is used for carrying out state conversion management on the service state of the current service content in the target service unit based on the state machine component.
An embodiment of the present application further provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the method implements the steps of the state transition management method described above.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the state transition management method as described above.
In the technical scheme provided by the application, when the state transition management needs to be performed on the current service content in the target service unit in the service system, a state machine component can be constructed based on a state transition rule matched with the current service state in the service state management unit, a service unit instance corresponding to a unit identifier, the current service content, the current service state, a preset state reader and a state updater, and then the state transition management is performed on the service state of the current service in the target service unit based on the state machine component, so that the efficient management on the service state of the current service content in the service unit is achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic diagram of a state transition rule definition type information according to an embodiment of the present application.
Fig. 2 is a schematic diagram of a state transition rule according to an embodiment of the present application.
Fig. 3 is a flowchart illustrating steps of a state transition management method according to an embodiment of the present disclosure.
Fig. 4 is a schematic block structure diagram of a state transition management apparatus according to a third embodiment of the present application.
Fig. 5 is a schematic block structure diagram of an electronic device according to a fourth embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that in the following embodiments presented in this application, a state machine refers to a finite state machine, which is a model representing a finite number of states and transitions between these states. The event, condition or action triggers the conversion of the service state, when the state conversion occurs, the state before the conversion is called the current state, and the state after the conversion is called the secondary state.
The present application implements a general state transition management method, apparatus, electronic device, and computer-readable storage medium, and therefore, it is desirable to be able to apply to service state transition management in a variety of different service scenarios. However, the state enumeration and representation of transactions of different services may have very large differences, so that only the abstraction of "state" can be determined in advance when performing state transition management, and specific state representations can be separately and independently defined only in a specific service development stage.
For example, in the actual implementation process of the state machine, taking the development process of object-oriented programming as an example, the state abstraction is a predefined state interface or abstract class, and the concrete state representation is a concrete state representation implementation class. In a particular state representation class, there may be only one state field or multiple state fields, where the values of the multiple state fields combine to represent an independent state. In the state representation class, which optional values of each state field are to be determined, which is not described in this embodiment of the present application.
Based on the foregoing, the technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Example one
An application scenario in the technical solution provided in the first embodiment of the present application is a service system, and the service system may include a service state management unit and a plurality of service units corresponding to different service scenarios. On one hand, the service state management unit is configured to execute the state transition management method provided in the first embodiment of the present application. On the other hand, through the setting of the service state management unit, the state information such as the state transition rule corresponding to different service functions related in each service unit can be extracted so as to be managed in the service state management unit in a centralized way. In practice, all traffic state transitions are defined in a defined traffic state management unit, which typically corresponds to an online interface handler or a batch handler in the application. By corresponding the service state management units and the service processing units in the state rule one by one, the occurrence scene of state conversion can be quickly confirmed, and target program codes and the like can be quickly positioned.
For example, referring to fig. 1, in the embodiment of the present application, information such as an indication of a service state, a state reader, a state updater, definitions of an initial state and a terminating state, and a definition of a state transition rule related to a service function corresponding to each service unit in a service system may be set in a service state management unit in advance. When the service state transition management of the service in the service unit is needed, a state machine component can be constructed based on the information preset in the service state management unit, and then the state setting and the transition can be completed by calling the state machine component.
As an alternative implementation, please refer to fig. 2 in combination, for a specific service function, the initial state may be one, and the termination state may exist in multiple states, for example, the termination state related in the state transition rule corresponding to the state A1 may be a state B, a state C … … state N, etc., and the initial state corresponding to different termination states may be triggered by different trigger conditions, such as a condition 1, a condition 2 … … condition N, etc. In addition, the service state transition may be triggered by a condition (in the condition, a sub-condition may be split), or may be triggered by an action and a specific condition after the action occurs, which is not described in detail herein.
In practical implementation, if the information preset in the service state management unit is to be applied in the service state transition management, a state machine component suitable for the current service processing unit needs to be constructed, and then a state transition method of the state machine component is uniformly called by the state machine engine at all places where service state transition needs to be executed to complete state transition. It can be understood that the state machine engine is used to provide runtime support for service state transition management, and implement state transition control in the service processing process.
Further, as an implementation manner, when the state transition rule is defined in the manner shown in fig. 2, a plurality of states may be represented on one state node in a manner of listing a plurality of values on a single state field or in a manner of omitting a part of the state field, thereby simplifying writing of the state transition rule. The representation of the traffic state node may be performed, for example, in the manner of table 1 below. By adopting the mode, the number of the state transition rules can be effectively reduced, and a plurality of related rules are combined together.
TABLE 1
Figure GDA0004018462300000051
Further, please refer to fig. 3 in combination, which is a schematic flow chart of a state transition management method applied to a service state management unit in the service system according to an embodiment of the present application, where the state transition management method may include the following steps:
step 102, obtaining a unit identifier and current service content of a target service unit in a service system, and obtaining a current service state corresponding to the current service content of the target service unit.
In the first embodiment of the present application, one service system may include a plurality of service units, and one service unit may include a plurality of different service functions. The target service unit in the first embodiment of the present application refers to a service unit that needs to perform service state transition management in a service system. The unit identifier may be, but is not limited to, coding information, service information, etc. of the service unit, and the acquisition mode of the content of the service unit may be, but is not limited to, acquisition of a transaction serial number, service function information, etc.
And step 104, constructing a state machine component based on a state conversion rule matched with the current service state in the service state management unit, a service unit instance corresponding to the unit identifier, the current service content, the current service state, a preset state reader and a preset state updater.
The state transition rule may include, but is not limited to, an initial state, a state transition path, a termination state, a state transition trigger condition, and the like of the service. The state reader and the state updater are used for reading and updating the state of the service state of the current service content in the target service unit when the state machine engine is communicated with the state machine component.
As an optional implementation manner, the obtaining process of the state transition rule matched with the current service state in step 104 may be: detecting whether a state conversion rule with the initial state being the same as the current business state exists in the preset state conversion rules in the business state management unit, and judging that the state conversion rule is matched with the current business state when the state conversion rule with the initial state being the same as the current business state exists in the preset state conversion rules in the business state management unit.
It should be noted that, in the first embodiment, the current service state may be an initial state in the service states related to the service in the target service unit, or may be any intermediate state in the service states related to the service in the target service unit, and specifically, the current service state may be flexibly set according to different service functions.
And 106, performing state conversion management on the service state of the current service content in the target service unit based on the state machine component.
In the first embodiment, the state transition management can be performed on the service state of the current service content in the target service unit through communication between the state machine component and the state machine engine. For example, as an alternative implementation, step 106 can be implemented by steps 1060-1064 as follows:
step 1060, extracting the current service state and the current service content from the state machine component, and obtaining the service current state corresponding to the current service content through the state reader in the state machine component.
Step 1062, determining a service secondary state corresponding to the current service state based on the state transition path matched with the current service state and the current service content in the state machine component.
Step 1064, updating the current service state of the current service in the target service unit to a service state corresponding to the service secondary state by the state updater in the state machine component.
In the service state transition management process given in the above steps 1060 to 1064, in order to avoid a fault in the service state transition management or inconsistency in the state update caused by a problem that the service system does not use a unified state machine component for performing the state transition management or a concurrent update occurs outside the target processing unit, as an implementation manner, when the current service state acquired by the state reader in step 1060 does not change relative to the current service state, the step of updating the current service state of the current service content to the service state corresponding to the secondary service state by the state updater in the state machine component in step 1064 may be executed again.
In addition, optionally, when the service state of the current service content is successfully updated, the current service state included in the state machine component is updated to the service state corresponding to the service secondary state; and continuing to perform state conversion management on the service state of the current service content in the target service unit based on the state machine component after the state update. In practice, it can be determined whether the status update is successful by detecting whether the number of lines of the code affected by the status update operation is changed, for example, whether the number of lines affected by the status update operation is greater than 0.
As another implementation manner, an optimistic lock mechanism may also be used, and the version number and the current state in the transaction record are used as filtering conditions during state updating, so as to avoid a problem of state inconsistency caused by concurrent updating, which is not limited in this embodiment. It should be noted that in the actual implementation process, when there is no state transition rule with the same initial state as the current service state in the state transition rules in the state management unit, or the current service state read by the state reader changes relative to the current service state, a service state alarm prompt is performed.
For example, when the current service state of the current service content acquired by the state reader changes relative to the current service state, the service state is changed, and service state warning for the current state updating operation is not allowed to be executed. For another example, when a state transition rule having the same initial state as the current service state does not exist in the service state management unit, a state warning is performed that a state transition rule matching the current service state does not exist in the current service state management unit.
In addition, in actual implementation, in order to improve resource utilization, when the updated state is the same as the termination state, it may be determined that state transition management of the current service content in the target service unit is finished, and the constructed state machine component is released.
In the technical solution provided in the first embodiment of the present application, a state machine component is constructed based on a state transition rule preset in a service state management unit, and then transition control and management of a service state in a target service unit are implemented based on the state machine component, so as to improve efficiency of service state transition control.
In addition, based on the implementation scheme for performing centralized state transition management and transition control based on the state machine component provided in the embodiment of the present application, all state definitions, transition rules, and the like are extracted and preset into the independent state transition control unit, so that the effective states of the service functions and the state transition paths between the effective states can be more clearly understood, and even what kind of operation, condition, or event triggers each state transition and the like, so that the subsequent maintenance and optimization processes of information such as the service states and the like become easier and clearer. Meanwhile, whether the implementation scheme is feasible or not is more conveniently confirmed, the original business process is not damaged, and even when a production event occurs, the problem can be quickly positioned and solved based on the business state management unit.
For the working personnel or the business development personnel, even under the condition that no complete business state information management document exists, the business state information is not required to be inquired in a code-stealing mode, the management efficiency of the state information is improved, the accuracy of the inquiry result is ensured, and particularly for the business unit with a complex business function. In addition, in actual implementation, in order to further facilitate viewing and understanding, the state conversion rule and the like in the source code can be directly exported from the service state management unit to be a document with better readability, so that the complete state definition and the state conversion rule can be rapidly viewed and understood through the source code.
Example two
Compared with the first embodiment, before the state transition management method provided in the second embodiment initializes the state machine engine and loads all the state rule definitions to perform state transition management, the legal performance of the state transition rules is verified to improve the validity of information.
For example, as an implementation scheme, in the state transition management method provided in this embodiment two, before executing step 102, for each state transition rule, whether the state is legal is checked based on the initial state, the state transition path, and the terminating state included in the state transition rule, and when the initial state cannot be transitioned to the corresponding terminating state according to the corresponding state transition path, it is determined that the state transition rule including the initial state, the state transition path, and the terminating state is illegal.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a state transition management apparatus 200 according to the third embodiment of the present application, and in a software implementation, the state transition management apparatus 200 may include:
an information obtaining module 202, configured to obtain a unit identifier and current service content of a target service unit in a service system, and obtain a current service state corresponding to the current service content of the target service unit;
a state machine component construction module 204, configured to construct a state machine component based on a state transition rule matched with a current service state in the service state management unit, a service unit instance corresponding to the unit identifier, a current service content, a current service state, and a state machine engine, where the state transition rule includes an initial state of a service and a state transition path;
and the state management module 206 is configured to perform state transition management on the service state of the current service content in the target service unit based on the state machine component.
It should be understood that the state transition management device 200 in the embodiment of the present application has the same or corresponding technical features as the state transition management methods in the first embodiment or/and the second embodiment, and therefore, for the detailed description of the state transition management device 200 in the third embodiment of the present application, reference may be made to the detailed description of the state transition management methods in the first embodiment or the second embodiment, and further description of the third embodiment is omitted here. For example, the detailed description about the information acquisition module 202 may refer to the detailed description about the step 102 in the first embodiment, the detailed description about the state machine component construction module 204 may refer to the detailed description about the step 104 in the first embodiment, and the like.
Example four
Fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present application. Referring to fig. 5, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the shared resource access control device on the logic level. And the processor is used for executing the program stored in the memory and specifically executing specific operations related to the state changing management method in the first embodiment or/and the second embodiment. For example, the processor may be configured to perform the steps of:
acquiring a unit identifier and current service content of a target service unit in a service system, and acquiring a current service state corresponding to the current service content of the target service unit;
constructing a state machine component based on a state conversion rule matched with the current service state in the service state management unit, a service unit instance corresponding to the unit identifier, the current service content, the current service state and a state machine engine, wherein the state conversion rule comprises an initial state and a state conversion path of the service;
and performing state transition management on the service state of the current service content in the target service unit based on the state machine component.
The method executed by the state transition management device 200 according to the embodiment shown in fig. 4 in this specification can be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or by instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of this specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present specification may be embodied directly in a hardware decoding processor, or in a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the method shown in fig. 1, and implement the functions of the state transition management apparatus 20 in the embodiments shown in fig. 1 and fig. 3, which are not described herein again in this specification.
Of course, besides the software implementation, the electronic device of the embodiment of the present disclosure does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
EXAMPLE five
Embodiments of the present specification also propose a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, can cause the portable electronic device to perform the method of the embodiment shown in fig. 1. In other words, the computer-readable storage medium provided in the fifth embodiment has the same or corresponding technical features as the state transition management method provided in the first embodiment or/and the second embodiment, and therefore, for detailed description of the computer-readable storage medium, reference may be made to the detailed description of the state transition management method provided in the first embodiment or/and the second embodiment, and details of the fifth embodiment are not repeated herein.
In short, the above description is only a preferred embodiment of the present specification, and is not intended to limit the scope of the present specification. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present specification shall be included in the protection scope of the present specification.
The systems, apparatuses, modules or units described in the above embodiments may be specifically implemented by a computer chip or an entity, or implemented by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

Claims (9)

1. A state transition management method is applied to a service state management unit in a service system, and comprises the following steps:
acquiring a unit identifier and current service content of a target service unit in a service system, and acquiring a current service state corresponding to the current service content of the target service unit;
constructing a state machine component based on a state transition rule matched with the current service state in the service state management unit, a service unit instance corresponding to the unit identifier, the current service content, the current service state, and a preset state reader and a state updater, wherein the state transition rule comprises an initial state and a state transition path of the service;
based on the state machine component, performing state conversion management on the service state of the current service content in the target service unit;
wherein, based on the state machine component, the step of performing state transition management on the service state of the current service content in the target service unit includes:
extracting the current service state and the current service content from the state machine component, and acquiring the service current state of the current service content through a state reader in the state machine component;
determining a service secondary state corresponding to the current service state based on a state switching path matched with the current service state and the current service content in the state machine component;
and updating the current service state of the current service content in the target service unit into a service state corresponding to the secondary service state through a state updater in the state machine component.
2. The state transition management method according to claim 1, wherein the state transition rule matching the current traffic state is obtained by:
and when a state conversion rule with the initial state identical to the current service state exists in the preset state conversion rules in the service state management unit, judging that the state conversion rule is a state conversion rule matched with the current service state.
3. The state transition management method according to claim 1, wherein the step of performing state transition management on the service state of the current service content in the target service unit based on the state machine component further comprises:
and when the current service state acquired by the state reader does not change relative to the current service state, updating the current service state of the current service content in the target service unit to a service state corresponding to the secondary service state by a state updater in the state machine component.
4. The state transition management method according to claim 1, further comprising:
when the service state of the current service content is successfully updated, updating the current service state included in the state machine component to a service state corresponding to the service secondary state;
and continuing to perform state conversion management on the service state of the current service content in the target service unit based on the state machine component after the state update.
5. The state transition management method according to claim 1, further comprising:
and when the state conversion rule in the state management unit does not have the state conversion rule with the initial state identical to the current service state, or the current service state acquired by the state reader changes relative to the current service state, performing service state alarm prompting.
6. The state transition management method according to claim 1, further comprising a step of checking validity of information, the step comprising:
and checking whether the state transition rule is legal or not based on the initial state, the state transition path and the termination state which are included in the state transition rule, and judging that the state transition rule is illegal when the initial state can not be transferred to the corresponding termination state according to the corresponding state transition path.
7. A state transition management apparatus, applied to a service state management unit in a service system, the apparatus comprising:
the information acquisition module is used for acquiring the unit identification and the current service content of a target service unit in a service system and acquiring the current service state corresponding to the current service content of the target service unit;
a state machine component construction module, configured to construct a state machine component based on a state transition rule matched with the current service state in the service state management unit, a service unit instance corresponding to the unit identifier, the current service content, the current service state, and a preset state reader and a state updater, where the state transition rule includes an initial state and a state transition path of the service;
the state management module is used for carrying out state conversion management on the service state of the current service content in the target service unit based on the state machine component; the method is specifically used for:
extracting the current service state and the current service content from the state machine component, and acquiring the service current state of the current service content through a state reader in the state machine component;
determining a service secondary state corresponding to the current service state based on a state switching path matched with the current service state and the current service content in the state machine component;
and updating the current service state of the current service content in the target service unit to a service state corresponding to the service secondary state through a state updater in the state machine component.
8. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the state transition management method according to any one of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the state transition management method according to any one of claims 1 to 6.
CN201910986615.9A 2019-10-17 2019-10-17 State transition management method and device, electronic equipment and storage medium Active CN110851207B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910986615.9A CN110851207B (en) 2019-10-17 2019-10-17 State transition management method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910986615.9A CN110851207B (en) 2019-10-17 2019-10-17 State transition management method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110851207A CN110851207A (en) 2020-02-28
CN110851207B true CN110851207B (en) 2023-04-18

Family

ID=69596500

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910986615.9A Active CN110851207B (en) 2019-10-17 2019-10-17 State transition management method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110851207B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363449A (en) * 2020-09-30 2022-04-15 北京字跳网络技术有限公司 Service state switching method and device, electronic equipment and storage medium
CN112363869B (en) * 2020-11-19 2022-03-01 中国核动力研究设计院 Nuclear DCS (distributed control System) backtracking method and system based on three-state variable finite state machine
CN112907198A (en) * 2021-01-15 2021-06-04 浙江大搜车融资租赁有限公司 Service state circulation maintenance method and device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103497A (en) * 2009-12-18 2011-06-22 阿尔卡特朗讯 Finite state machine actuating device and method, and method for establishing and using finite state machine
CN109582398A (en) * 2018-11-23 2019-04-05 阿里巴巴集团控股有限公司 A kind of condition processing method, device and electronic equipment
CN109660605A (en) * 2018-12-03 2019-04-19 深圳智慧园区信息技术有限公司 A kind of intelligently control technology and its management-control method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9588779B2 (en) * 2014-12-09 2017-03-07 International Business Machines Corporation Maintaining state information in a multi-component, event-driven state machine

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103497A (en) * 2009-12-18 2011-06-22 阿尔卡特朗讯 Finite state machine actuating device and method, and method for establishing and using finite state machine
CN109582398A (en) * 2018-11-23 2019-04-05 阿里巴巴集团控股有限公司 A kind of condition processing method, device and electronic equipment
CN109660605A (en) * 2018-12-03 2019-04-19 深圳智慧园区信息技术有限公司 A kind of intelligently control technology and its management-control method

Also Published As

Publication number Publication date
CN110851207A (en) 2020-02-28

Similar Documents

Publication Publication Date Title
CN109347787B (en) Identity information identification method and device
CN110851207B (en) State transition management method and device, electronic equipment and storage medium
CN106899666B (en) Data processing method and device for service identification
CN110032599B (en) Data structure reading and updating method and device, and electronic equipment
CN109032825B (en) Fault injection method, device and equipment
CN109598407B (en) Method and device for executing business process
CN111461887B (en) Block chain consensus processing method and device and electronic equipment
CN109271359B (en) Log information processing method and device, electronic equipment and readable storage medium
CN107066519B (en) Task detection method and device
CN110503435B (en) Transaction early warning method, device and equipment based on blockchain
CN110780870A (en) Service execution method, device, equipment and storage medium
CN111104664A (en) Risk identification method of electronic equipment and server
CN111914194A (en) Business system changing method and device, electronic equipment and storage medium
CN109345081B (en) Data acquisition method and device and electronic equipment
CN108647102B (en) Service request processing method and device of heterogeneous system and electronic equipment
CN112712125B (en) Event stream pattern matching method and device, storage medium and processor
CN108710658B (en) Data record storage method and device
CN112907198A (en) Service state circulation maintenance method and device and electronic equipment
CN110018844B (en) Management method and device of decision triggering scheme and electronic equipment
CN110750271B (en) Service aggregation, method and device for executing aggregated service and electronic equipment
CN111858619B (en) Data self-circulation method and device and electronic equipment
CN114138888A (en) Processing method, system, medium and equipment for distributed data routing
CN113761581A (en) Authority control method and device in block chain and electronic equipment
CN111461647B (en) Business collaboration processing method and system based on block chain
CN110661792B (en) Service ordered calling method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Room 306, No. 799, Ximen Road, Chengqiao Town, Chongming District, Shanghai 202150

Applicant after: SHANGHAI I2FINANCE SOFTWARE CO.,LTD.

Address before: Room 2076, area C, building 8, No.2, Guanshan Road, Chengqiao Town, Chongming District, Shanghai 202150

Applicant before: SHANGHAI I2FINANCE SOFTWARE CO.,LTD.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant