Data state change method and device, equipment and readable storage medium

By acquiring the state transition scheme and determining the operation link, the systematic processing of data state changes is realized, and the problem of tight coupling between state change logic and business operations in the prior art is solved, reducing the maintenance cost of the business system and improving flexibility.

CN119537389APending Publication Date: 2025-02-28KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411521892.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the prior art, the logic of data state changes is closely coupled with the business operation processing, resulting in high maintenance costs of the business system, and frequent modification of the business code is required when the state change logic changes.

Method used

By responding to operation events, obtaining operation data and business scenarios, obtaining corresponding state transition plans, determining operation links and running business implementation classes, obtaining business operation results, and changing the data status in a successful situation.

Benefits of technology

Reduces the coupling between state and operation, reduces the development and maintenance costs of business systems, and improves the flexibility and accuracy of state changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537389A_ABST
    Figure CN119537389A_ABST
Patent Text Reader

Abstract

The invention relates to a data state changing method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: in response to triggering of an operation event, obtaining operation data corresponding to the operation event and a current service scene; obtaining a state conversion scheme corresponding to the current service scene; the state conversion scheme is obtained based on service demand configuration corresponding to a service scene; according to the state conversion scheme, determining an operation link corresponding to the operation data, and running a service implementation class corresponding to the operation link to obtain a service operation result; and under the condition that the business operation result is that the operation is successful, changing the state of the operation data. By adopting the method, the coupling degree between the business code and the state change control code can be reduced, and the development cost and the maintenance cost are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data state change method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] During the business system design process, some data has a long life cycle, and different life cycle stages correspond to different states, so that different operations can be performed. For example, personal tax data can be divided into multiple stages in its life cycle according to business scenarios, such as personnel reporting, tax data preparation, initial calculation and submission, tax bureau data introduction, confirmation of results and task completion, etc. The corresponding interface has different step nodes, and the data status is used to control which step node the data should be displayed in. Each step node can perform different operations on the data.

[0003] In the related technology, the logic of state change maintenance is bound together with each operation processing, and the business code is strongly coupled with the state change code. If a state change modification is involved, a large number of business code modifications may be involved, and the maintenance cost of the business system is high. Summary of the invention

[0004] Based on this, it is necessary to provide a data state change method, apparatus, computer equipment, computer-readable storage medium and computer program product that can reduce the maintenance cost of a business system in response to the above technical problems.

[0005] In a first aspect, the present application provides a data state change method, comprising:

[0006] In response to the triggering of an operation event, obtaining operation data corresponding to the operation event and a current business scenario;

[0007] Obtaining a state transition scheme corresponding to the current business scenario; the state transition scheme is configured based on the business requirements corresponding to the business scenario;

[0008] According to the state transition scheme, determine the operation link corresponding to the operation data, and run the business implementation class corresponding to the operation link to obtain the business operation result;

[0009] When the business operation result is that the operation is successful, the state of the operation data is changed.

[0010] In one of the embodiments, determining the operation link corresponding to the operation data according to the state transition scheme, and running the business implementation class corresponding to the operation link to obtain the business operation result includes:

[0011] According to the state transition scheme, determining the operation support object corresponding to the operation data; the operation support object includes the starting state and the ending state supported by the operation data;

[0012] Verifying the current state of the operation data according to the operation support object to obtain a state verification result;

[0013] If the status check result is that the check passes, an operation link is determined according to the start state and the end state, and the business implementation class corresponding to the operation link is run to obtain the business operation result.

[0014] In one embodiment, verifying the current state of the operation data according to the operation support object to obtain a state verification result includes:

[0015] If the current state of the operation data belongs to the initial state in the operation support object, the state verification result is obtained as verification passed;

[0016] If the current state of the operation data does not belong to the initial state in the operation support object, the state verification result is verification failure.

[0017] In one embodiment, when the business operation result is a successful operation, changing the state of the operation data includes:

[0018] When the business operation result is a successful operation, the state of the operation data is changed from the current state to the termination state.

[0019] In one of the embodiments, determining the operation link corresponding to the operation data according to the state transition scheme, and running the business implementation class corresponding to the operation link to obtain the business operation result includes:

[0020] Acquire the target state to be achieved corresponding to the operation data;

[0021] Determining an optimal operation path from a current state of the operation data to the target state according to the state transition scheme;

[0022] Run the business implementation class corresponding to the optimal operation path to obtain the business operation result.

[0023] In one embodiment, determining the optimal operation path from the current state of the operation data to the target state according to the state transition scheme includes:

[0024] Determining an operation direction of the operation data according to the state transition scheme;

[0025] In the operation direction, an optimal operation path from a current state of the operation data to the target state is determined according to the operation weight.

[0026] In one embodiment, when the business operation result is a successful operation, changing the state of the operation data includes:

[0027] When the business operation result is a successful operation, the state of the operation data is changed from the current state to the target state.

[0028] In one of the embodiments, the state transition scheme includes a directional relationship between a data state and an operation, and the attributes of the operation include at least one of an operation direction, whether continuous execution is supported, whether automatic execution is supported, and an operation weight.

[0029] In a second aspect, the present application further provides a data state changing device, comprising:

[0030] An operation data acquisition module, used to obtain the operation data corresponding to the operation event and the current business scenario in response to the triggering of the operation event;

[0031] A conversion scheme acquisition module is used to acquire a state conversion scheme corresponding to the current business scenario; the state conversion scheme is configured based on the business requirements corresponding to the business scenario;

[0032] An operation link determination module, used to determine the operation link corresponding to the operation data according to the state transition scheme, and run the business implementation class corresponding to the operation link to obtain the business operation result;

[0033] The data status changing module is used to change the status of the operation data when the business operation result is a successful operation.

[0034] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the data state change method provided in the first aspect when executing the computer program.

[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the data state changing method provided in the first aspect are implemented.

[0036] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the data state change method provided in the first aspect.

[0037] The above-mentioned data state change method, device, computer equipment, computer-readable storage medium and computer program product determine the operation link corresponding to the operation data according to the state transition scheme corresponding to the current business scenario, and run the business implementation class corresponding to the operation link to obtain the business operation result. When the business operation result is a successful operation, the state of the operation data is changed, so that the data state change becomes more systematic. It is only necessary to change the data state when the business operation result is a successful operation. The state change logic is implemented based on the state transition scheme obtained by configuration. If the state change logic changes, it is only necessary to change the corresponding state transition scheme configuration. There is no need to pay attention to fragmented operation results. The coupling between state and operation can be reduced, thereby reducing the development cost and maintenance cost of the business system, and at the same time, the flexibility of state change can be improved; the business implementation class can be selected and packaged according to the actual business scenario, further improving the flexibility and freedom of business system operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0039] FIG1 is an application environment diagram of a data state changing method in one embodiment;

[0040] FIG2 is a schematic diagram of a flow chart of a method for changing a data state in one embodiment;

[0041] FIG3 is a schematic diagram of a state transition scheme in one embodiment;

[0042] FIG4 is a schematic diagram of a state transition scheme in another embodiment;

[0043] FIG5 is a schematic diagram of a state dimension view in one embodiment;

[0044] FIG6 is a schematic diagram of an operation dimension view in one embodiment;

[0045] FIG7 is a schematic flow chart of a method for changing data status in another embodiment;

[0046] FIG8 is a schematic flow chart of a method for changing data status in another embodiment;

[0047] FIG9 is a structural block diagram of a data state changing device in one embodiment;

[0048] FIG. 10 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0050] The data state change method provided in the embodiment of the present application can be applied in the application environment shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. In response to the triggering of the operation event, the terminal 102 obtains the operation data corresponding to the operation event and the current business scenario. The terminal 102 sends the obtained operation data and the current business scenario to the server 102, and the server 102 obtains the state transition scheme corresponding to the current business scenario, determines the operation link corresponding to the operation data according to the state transition scheme, and runs the business implementation class corresponding to the operation link to obtain the business operation result. When the business operation result is a successful operation, the state of the operation data is changed. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. It should be noted that the data state change method provided in the embodiment of the present application is not only applicable to the application scenario of the above-mentioned terminal and server interaction, but also to the application scenario corresponding to a single terminal or a single server.

[0051] In an exemplary embodiment, as shown in FIG2 , a data state change method is provided, which is described by taking the method applied to the server in FIG1 as an example, and includes the following steps 202 to 208. Among them:

[0052] Step 202: in response to the triggering of the operation event, obtain the operation data corresponding to the operation event and the current business scenario.

[0053] Among them, an operation event refers to an event that triggers a business operation. For example, when a user clicks an operation control on a business interface or executes an operation instruction issued by a server, a corresponding operation event will be generated. The operation event is the event corresponding to the corresponding triggering operation control or operation instruction. An operation event may include one or more events corresponding to an operation. If there are multiple operations, it can be called an operation chain, that is, an operation event may be an event corresponding to an operation chain. Operation data may include data such as the operation name, operation subject, and operation object. For example, an operation may be processing logic such as calculation, undo calculation, lock, undo lock, and derive a declaration form.

[0054] The current business scenario refers to the scenario corresponding to the current business. Different businesses correspond to different business scenarios, where the business includes, for example, individual tax business, corporate income tax business, salary business, etc. It is easy to understand that the current business scenario can be determined based on the business environment in which the operation event is located. In some actual application scenarios, when entering the corresponding business interface, the business scenario corresponding to the business interface can be obtained. For example, when entering the individual tax business interface, clicking the operation control of the individual tax business interface can generate the corresponding operation event, and at the same time, the current business scenario can be obtained as the individual tax business scenario, and when entering the salary business interface, the current business scenario can be obtained as the salary business scenario.

[0055] Exemplarily, a user triggers an operation control of a business interface to generate an operation event. In response to the triggering of the operation event, the server obtains the operation data corresponding to the operation event, that is, obtains the operation data corresponding to the operation control, and obtains the current business scenario based on the business interface where the operation control is located and the operation control.

[0056] Step 204, obtaining a state transition solution corresponding to the current business scenario; wherein the state transition solution is configured based on the business requirements corresponding to the business scenario.

[0057] Among them, different business scenarios correspond to different business conversion schemes. The server can save the corresponding relationship between the business scenario and the business conversion scheme. Based on the corresponding relationship, the state conversion scheme corresponding to the current business scenario is obtained. The state conversion scheme is a scheme used to characterize the conversion relationship between the state and the operation. In the state conversion scheme, the state conversion or change may be caused by the operation. The state conversion scheme may include operations, states, and the conversion relationship between operations and states. The conversion relationship between states is used to indicate the relationship between the data state from one state to another. Based on the state conversion scheme, the operation support object and the state support object can be obtained. The operation support object refers to the start state and the end state supported by each operation, and the state support object refers to the operation supported by each state. The state conversion scheme can be obtained based on the business demand configuration corresponding to the business scenario, that is, based on which operation in the business scenario will cause the data state to flow from one state to another state, which are pre-configured. There is at least one operation and at least two states in the state conversion scheme. Usually, there are multiple states and operations in the state conversion scheme.

[0058] In one example, the state transition scheme is shown in FIG3 , where the boxes represent states, and arrows represent operations. Obviously, operations will cause the state to flow or change. For example, if the current state is "new", the "calculate" operation can transfer or change the current state from "new" to "calculated". It is easy to understand that the attributes of the operation in the state transition scheme may include the operation direction, that is, the same state transition scheme may include operations of multiple operation directions, and the state flow methods corresponding to operations of different operation directions are not the same. The operations in the state transition scheme in FIG3 include two operation directions, that is, different operation directions can be represented by the forward and reverse directions of the arrows, respectively.

[0059] Step 206: According to the state transition scheme, determine the operation link corresponding to the operation data, and run the business implementation class corresponding to the operation link to obtain the business operation result.

[0060] An operation link refers to a link composed of operations, and an operation link may include one operation or multiple operations. It is easy to understand that different operation data correspond to different operation links, and the state transition scheme may include not only the pointing relationship between operations and states, but also the execution order between operations and the change order between states.

[0061] Optionally, the state supported by the operation data may be determined according to the state transition scheme, and then the operation link may be determined according to the state supported by the operation data. Alternatively, the operation path may be determined according to the target state to be achieved by the operation data and the current state of the operation data.

[0062] In actual application scenarios, each operation can mount one or more business implementation classes, and the corresponding business processing is implemented through the business implementation class. Triggering an operation is equivalent to triggering the business implementation class mounted by the operation. After determining the operation link, the business logic of the operation link is run, and the mounted business implementation class is run accordingly to obtain the business operation result. Among them, a business implementation class can be understood as a business service. The business logic can be abstracted by defining an interface, and isolated implementation classes can be developed for different business operations. It should be noted that the one or more business implementation classes mounted by the operation can be business processing corresponding to different business scenarios. The business implementation classes corresponding to different business scenarios can be registered as named services through SPI (Service Provider Interface), and then the corresponding business implementation class is called through the service name for processing. SPI is a service discovery mechanism that allows a third party to provide an implementation for an interface or abstract class, and enables applications to discover and use these implementations at runtime. The core idea of ​​the SPI mechanism is to configure the full class name of the interface implementation class in a text file. The application obtains the full class name of the interface implementation class by reading this file, and then uses the reflection mechanism to create an instance and call the method.

[0063] For example, an operation has two business implementation classes mounted, namely class A and class B. In business scenario A, class A is running, and in business scenario B, class B is running, that is, the business implementation class running is the business implementation class corresponding to the corresponding business scenario. In an optional application scenario, it can be first detected whether the operation link has a business implementation class mounted. If a business implementation class is mounted, the business implementation class corresponding to the operation link is run to obtain the business operation result; if no business implementation class is mounted, the operation corresponding to the operation link is directly executed to obtain the business operation result.

[0064] Step 208: When the business operation result is successful, the state of the operation data is changed.

[0065] Among them, when obtaining operation data, the current state of the operation corresponding to the operation data can be obtained. When the operation link corresponding to the operation data is determined, the target state of the corresponding change of the operation data can be determined. Then, when the business operation result is that the operation is successful, the state of the operation data is changed from the current state to the target state, that is, the state change of the operation data is realized.

[0066] In the above data state change method, the operation link corresponding to the operation data is determined according to the state transition scheme corresponding to the current business scenario, and the business implementation class corresponding to the operation link is run to obtain the business operation result. When the business operation result is a successful operation, the state of the operation data is changed, so that the data state change becomes more systematic. It is only necessary to change the data state when the business operation result is a successful operation. The state change logic is implemented based on the state transition scheme obtained by configuration. If the state change logic changes, it is only necessary to change the corresponding state transition scheme configuration. There is no need to pay attention to fragmented operation results. The coupling between state and operation can be reduced, thereby reducing the development cost and maintenance cost of the business system, and at the same time, the flexibility of state change can be improved. The business implementation class can be selected and encapsulated according to the actual business scenario to further improve the flexibility and freedom of business system operation.

[0067] In an exemplary embodiment, according to the state transition scheme, determining the operation link corresponding to the operation data, and running the business implementation class corresponding to the operation link to obtain the business operation result step 206 includes:

[0068] According to the state transition plan, determine the operation support object corresponding to the operation data; the operation support object includes the starting state and ending state supported by the operation data; verify the current state of the operation data according to the operation support object to obtain the state verification result; if the state verification result is verification passed, determine the operation link according to the starting state and ending state, and run the business implementation class corresponding to the operation link to obtain the business operation result.

[0069] Among them, the state conversion scheme includes the pointing relationship between the data state and the operation. According to the state conversion scheme, the operation support object is easily obtained. The operation support object includes the starting state and the ending state supported by the operation data. Each operation has a state pair consisting of the corresponding starting state and the ending state that can be supported, and an operation can support one state pair or multiple state pairs. For example, in the example shown in FIG3, the corresponding starting state supported for the "export declaration form" operation is "calculated", and the corresponding target state is "export only". At the same time, the starting state supported is "locked only", and the corresponding target state is "export and lock". For the "calculation" operation, the corresponding starting state supported is "newly added", and the corresponding target state is "calculated", etc. It should be noted that in actual application scenarios, an operation at most changes the data state by one state, that is, it can only cause a change in state once. Then, the starting state and the ending state in the operation support object corresponding to the operation data of an operation are a continuous state change process. Therefore, the operation link between the starting operation and the ending operation in the operation support object corresponding to an operation can only include one operation process.

[0070] Optionally, the current state of the operation data is verified according to the operation support object, and the state verification result can be obtained according to whether the current state of the operation data belongs to the starting state in the operation support object. The state verification result may include a verification pass and a verification fail. In the case where the state verification result is a verification pass, the operation link is determined according to the corresponding starting state and ending state, and the starting state at this time is the current state of the operation data, and then the business implementation class corresponding to the operation link is run to obtain the business operation result.

[0071] In one example, the operation data may include multiple continuous operations. When the user operates the business system, the server determines the corresponding multiple operation support objects based on the operation data, verifies the initial state of the operation data based on the operation support objects, groups the operation data that pass the verification according to the initial state, and determines the operation link for the operation data in the same group according to the corresponding initial state and terminal state. For the operation data that fails the verification, the operation process of state change is stopped. If there is a mounted business implementation class in the operation link, the corresponding business implementation class is run to obtain the business operation result. If the business operation result is a successful operation, the initial state of the operation data is changed to the terminal state.

[0072] In this embodiment, the operation link is determined by the starting state and the ending state supported by the operation data in the state transition scheme, and then the business implementation class corresponding to the operation link is run to obtain the business implementation result. The starting state and the ending state supported by the operation data can be quickly determined through the state transition scheme, thereby determining the operation link and improving the efficiency of determining the operation link.

[0073] In some embodiments, the current state of the operation data is verified according to the operation support object to obtain a state verification result, including:

[0074] If the current state of the operation data belongs to the initial state in the operation support object, the state verification result is verification passed; if the current state of the operation data does not belong to the initial state in the operation support object, the state verification result is verification failed.

[0075] After determining the operation support object corresponding to the operation data, the current state of the operation data can be verified through the initial state in the operation support object to obtain a state verification result. That is, it is determined whether the current state of the operation data belongs to the initial state in the operation support object. If the current state of the operation data belongs to the initial state in the operation support object, a state verification result of passing the verification is obtained. If the current state of the operation data does not belong to the initial state in the operation support object, a state verification result of failing the verification is obtained. The operation data can be verified quickly and accurately, thereby improving the efficiency and accuracy of obtaining the state verification result.

[0076] In some embodiments, when the business operation result is successful, the state of the operation data is changed, including:

[0077] When the business operation result is successful, the state of the operation data is changed from the current state to the terminated state.

[0078] The business operation result is the processing result of the business logic corresponding to the operation data. When the business operation result is a successful operation, it means that the corresponding operation processing has been completed, and the state caused by the operation processing can be transferred, thereby changing the state of the operation data from the current state to the terminated state. In this embodiment, when the business operation result is a successful operation, the state of the operation data is changed from the current state to the terminated state, which can improve the accuracy of the data state change.

[0079] In an exemplary embodiment, according to the state transition scheme, determining the operation link corresponding to the operation data, and running the business implementation class corresponding to the operation link to obtain the business operation result step 206 includes:

[0080] Obtain the target state to be achieved corresponding to the operation data; determine the optimal operation path from the current state of the operation data to the target state based on the state transition plan; run the business implementation class corresponding to the optimal operation path to obtain the business operation result.

[0081] Among them, the target state is a data state that is different from the current state of the operation data. The target state can be specified by the user, for example, the user can input the target state through a human-computer interaction interface or interface. In actual application scenarios, the target state may be the data state achieved by revoking the current state, that is, through a series of undo operations, the operation data can be changed from the current state to the target state. There may be one or more operation paths between the current state and the target state, and the optimal operation path refers to the operation path with the least number of operations between the two states. The operation link includes the optimal operation path, and the optimal operation path can be determined based on the operation weight between the current state of the operation data and the target state.

[0082] Optionally, the server obtains the target state to be achieved corresponding to the operation data, determines the optional operation path between the current state of the operation data and the target state according to the state transition plan, and then determines the optimal operation path from the optional operation paths. If the operation in the optimal operation path is mounted with a business implementation class, the business implementation class corresponding to the optimal operation path is run to obtain the business operation result.

[0083] In this embodiment, the optimal operation path between the current state and the target state of the operation data is determined as the operation link according to the state transition plan, and then the business implementation class corresponding to the optimal operation path is run to obtain the business operation result. That is, by running the business operation logic through the optimal operation path, the business operation result can be obtained more quickly, thereby improving the efficiency of data state changes.

[0084] In some embodiments, determining an optimal operation path from a current state of the operation data to a target state according to the state transition scheme includes:

[0085] According to the state transition plan, the operation direction of the operation data is determined; in the operation direction, the optimal operation path from the current state of the operation data to the target state is determined according to the operation weight.

[0086] The operation direction may include forward operation and reverse operation, and the business processing logic corresponding to different operation directions is completely different.

[0087] According to the state accessibility between the current state and the target state in the state transition scheme, the operation direction of the operation data is determined. State accessibility refers to the transition from one state to another. The meaning of state accessibility is explained again through the example in Figure 3. In Figure 3, the transition from the state "only lead-out" to the state "lead-out and locked" can be achieved through the path corresponding to the operation "lead-out declaration form", which means it is reachable; while the transition from the state "only lead-out" to the state "only locked" is not reachable, because there is no path in the same direction from the state "only lead-out" to the state "only locked", that is, state accessibility refers to whether the state in the same operation direction can be converted. If there is an operation path in the same direction from the current state to the target state, it means that the state is reachable, and the corresponding operation direction is the operation direction of the operation data; if there is no operation path in the same direction from the current state to the target state, it means that the state is not reachable.

[0088] Optionally, after determining the operation direction of the operation data, determine the candidate operation paths that may exist between the current state and the target state in the operation direction, and determine the optimal operation path from the candidate operation paths according to the operation weights of the operation paths. The candidate operation paths are operation paths in the same operation direction. Among them, the operation weight of the operation path can be determined according to the operation weight of the operation, and each operation corresponds to a corresponding operation weight. The operation weight of the operation can be preset, or the corresponding operation weight can be determined according to the performance of the operation. The operation weight of the operation is used to characterize the amount of resources required to change the state through the operation. Exemplarily, the weighted sum of the operation weights of each operation in the operation path can be used as the operation weight of the operation path. For example, the sum of the operation weights of each operation in the operation path can be used as the operation weight of the operation path.

[0089] Exemplarily, different operations can be performed respectively by data of different magnitudes. When performing each operation for each magnitude of data, the time increment corresponding to the unit data is counted, and the average time increment corresponding to all unit data is calculated to obtain the average time increment of each magnitude of data for each operation. The common divisor of the average time increment of the same operation of data of different magnitudes is used as the operation weight corresponding to the operation, or the average time increment of the same operation of data of different magnitudes is linearly fitted, and the slope of the fitted straight line is used as the operation weight of the corresponding operation. Among them, the common divisor can be the greatest common divisor or the least common divisor, and the different magnitudes are, for example, 10,000, 100,000, 500,000 or 1 million, etc. It is easy to understand that the more magnitudes there are, the more accurate the corresponding operation weight is. The unit data can be set according to the actual application scenario, for example, every 100 or 500 data is a unit data. Alternatively, the operation weight can be preset to 1 or 2, etc. In an optional application scenario, when the operation data corresponding to each operation reaches a corresponding level, the time increment corresponding to the unit data can be automatically recorded to calculate a new operation weight, and the historical operation weights can be dynamically updated according to the new operation weight.

[0090] In this embodiment, the optimal operation path from the current state to the target state is determined according to the operation weight in the operation direction, so that the optimal operation path can be determined quickly and accurately from multiple operation paths.

[0091] In some embodiments, when the business operation result is successful, the state of the operation data is changed, including:

[0092] When the business operation result is successful, the state of the operation data is changed from the current state to the target state.

[0093] In actual application scenarios, if the optimal operation path from the current state of the operation data to the target state is mounted with a business implementation class, the business implementation class corresponding to the optimal operation path is run to obtain the business operation result. When the business operation result is a successful operation, the state of the operation data is changed from the current state to the target state, thereby realizing the state change of the operation data and improving the accuracy of the data change.

[0094] In some embodiments, the state transition scheme includes a directional relationship between a data state and an operation, and the attributes of the operation include at least one of an operation direction, whether continuous execution is supported, whether automatic execution is supported, and an operation weight.

[0095] The directional relationship between the state and the operation is used to characterize the state change logic caused by the operation. Different businesses have different corresponding state change logics, so different businesses have different corresponding state transition schemes. The directional relationship between the data state and the operation included in the state transition scheme can be seen in the arrow direction shown in Figure 3.

[0096] The operation direction is used to characterize the direction of the state change caused by the operation. The operation direction may include a forward operation and a reverse operation. In the example shown in FIG3 , the solid line represents the forward operation direction, and the dotted line represents the reverse operation direction.

[0097] Whether continuous execution is supported is used to indicate whether the operation can be driven by other operations. For example, if the attribute of operation B is to support continuous execution, the server will continuously execute operation B after operation A. In other words, when the data reaches the state condition of operation A, operation A is executed, and it will not be judged whether the state condition of operation B is reached, that is, operation B is executed continuously. In a possible application scenario, when performing operation B, it is necessary to receive user input parameters, and continuous execution cannot be supported. Whether continuous execution is supported includes supporting continuous execution and not supporting continuous execution.

[0098] Whether to execute automatically is used to indicate that several subsequent operations will be automatically executed after the operation is performed. For example, in the example shown in Figure 3, the data will be automatically "locked" after "exporting the declaration form" and "pushed back to the source system" after "importing the tax bureau results". In actual application scenarios, in the attributes of the same operation, automatic execution means supporting continuous execution, but supporting continuous execution does not necessarily mean automatic execution. Whether to execute automatically includes automatic execution and non-automatic execution.

[0099] The operation weight is used to characterize the number of resources required to change the state through the operation. The operation weights corresponding to different operations can be the same or different. It can be understood that the smaller the operation weight, the smaller the number of resources required. The calculation method of the operation weight can refer to the description of the corresponding content in the above embodiment, which will not be repeated here.

[0100] Optionally, the attributes of the operation may also include whether to mount the business implementation class. If the attribute is to mount the business implementation class, it may also include the service name corresponding to the business service class. The same operation can support the configuration of multiple business service classes. Through the encapsulation and mounting of the business implementation class, the cohesion of the code can be increased, the complexity of functional expansion can be reduced, the reusability of the code can be improved, the communication cost of developers can be reduced, and the development efficiency can be improved. In an optional application scenario, the state transition scheme corresponding to the individual tax business is shown in Figure 4. In different businesses, the corresponding implementation methods of operations such as "exporting the declaration form" and "introducing the tax bureau results" may be different. For example, it may be introduced or exported through the corresponding application (APP), or directly introduced or exported from the tax bureau through the tax bureau interface. Then, the corresponding business implementation class can be mounted under the corresponding operation without intrusion into the main process of the state change, that is, the corresponding business implementation class corresponding to the introduction and extraction of the tax bureau data through the application and the introduction and extraction of the tax bureau data through the tax bureau interface is mounted. When the conditions are met, the corresponding business implementation class can be loaded.

[0101] Exemplarily, the state transition scheme can be stored in the form of XML (Extensible Markup Language), JSON or graph database, or can be converted to be stored with state or operation as the main dimension. For example, taking the state transition scheme shown in FIG. 3 as an example, the state dimension view obtained by storing with state as the main dimension is shown in FIG. 5. The state dimension view includes the operations supported by each state, and the terminal state and attributes corresponding to the supported operations. FIG. 5 shows the state dimension view corresponding to the main dimension of the starting state "calculated", "only extracted", "only locked" and "extracted and locked". The operation dimension view obtained by storing with operation as the main dimension is shown in FIG. 6. The operation dimension view includes the attributes of each operation, the operation identifier, and the operation support object corresponding to the operation. FIG. 6 shows the operation dimension view stored with "calculation", "cancel calculation", "extract declaration form", "lock" and other operations as the main dimensions. Among them, the operation identifier is used to uniquely identify the operation, for example, it can be represented by the operation code. The mounted service is the mounted business implementation class, which can be represented by the name of the mounted business implementation class. For example, the business implementation class mounted by the "calculate" operation is named "calculate", and the business implementation class mounted by the "undo calculation" operation is named "calculate_calcel", and the same applies to the business implementation classes mounted by other operations.

[0102] In this embodiment, according to the property setting of the state transition scheme, the state transition scheme corresponding to different business scenarios can be flexibly configured, and data state conversion based on the state transition scheme can make the state transition more systematic, and the business logic can be dynamically mounted on the operation to achieve a high degree of decoupling between the operation and the state transition, greatly reducing the coupling between the business code and the state transition control code, and reducing the communication cost between the business logic development department and the state change control department, thereby reducing the development cost of the business system. In addition, the state transition scheme configuration corresponding to the existing business scenario can be modified to obtain the state transition scheme corresponding to the new business scenario, that is, through a simple configuration of the state transition scheme, the zero-intrusive integration of the main process corresponding to the second opening can be achieved, reducing development costs and maintenance costs.

[0103] In an exemplary embodiment, as shown in FIG. 7 , the data state changing method includes the following steps 702 to 712 .

[0104] Step 702: in response to triggering the operation control, obtain corresponding operation data and the current application scenario.

[0105] Step 704: Obtain a state transition solution corresponding to the current application scenario, where the state transition solution is configured based on the business requirements corresponding to the business scenario.

[0106] Step 706: Determine the operation support object corresponding to the operation data according to the state transition scheme. The operation support object includes the start state and the end state supported by the operation data.

[0107] Step 708, determine whether the current state of the operation data belongs to the starting state supported by the operation data, if so, obtain a state verification result of passing the verification, and determine the operation link between the starting state and the ending state.

[0108] Step 710: Run the business implementation class mounted corresponding to the operation link to obtain the business operation result.

[0109] Step 712: When the business operation result is successful, the state of the operation data is changed from the current state to the terminated state.

[0110] In this embodiment, the state transition scheme obtained through configuration is used to determine the operation support object corresponding to the operation data, and the initial state of the operation data is verified based on the operation support object. When the verification passes, the business implementation class corresponding to the operation link between the start state and the end state in the operation support object is loaded and run. When the operation result is that the operation is successful, the state of the operation data is changed to the end state. This can achieve efficient determination of the operation link, improve the accuracy of the state change, and at the same time, can systematize the originally fragmented and disordered operations, reduce the coupling between the operation code and the state change code, improve the reusability of the business code, and reduce development costs and maintenance costs.

[0111] In another exemplary embodiment, as shown in FIG. 8 , the data state changing method includes the following steps 802 to 810 .

[0112] Step 802, in response to triggering the operation control, obtain corresponding operation data, the current application scenario, and the target state to be achieved corresponding to the operation data.

[0113] Step 804, obtaining a state transition solution corresponding to the current application scenario, where the state transition solution is configured based on the business requirements corresponding to the business scenario.

[0114] Step 806: Determine the optimal operation path from the current state of the operation data to the target state according to the state transition plan.

[0115] Step 808: Run the business implementation class corresponding to the optimal operation path to obtain the business operation result.

[0116] Step 810: When the business operation result is successful, the state of the operation data is changed from the current state to the target state.

[0117] In the above embodiment, by giving the target state to be achieved by the operation data, according to the state transition scheme, the optimal operation path between the current state of the operation data and the target state is determined, and then the business implementation class mounted corresponding to the optimal operation path is run to obtain the business operation result. When the business operation result is successful, the operation data state is changed to the target state, and the state change of the operation data is realized by loading the business logic of the optimal operation path, which can improve the accuracy of the state change. At the same time, the state change is realized by configuring the state transition scheme, which can reduce the coupling between the business code and the state change control code, and reduce the development cost and maintenance cost.

[0118] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0119] Based on the same inventive concept, the embodiment of the present application also provides a data state change device for implementing the data state change method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data state change device embodiments provided below can refer to the limitations of the data state change method above, and will not be repeated here.

[0120] In an exemplary embodiment, as shown in FIG. 9 , a data state change device is provided, including: an operation data acquisition module 902, a conversion scheme acquisition module 904, an operation link determination module 906 and a data state change module 908, wherein:

[0121] The operation data acquisition module 902 is used to obtain the operation data corresponding to the operation event and the current business scenario in response to the triggering of the operation event;

[0122] The conversion scheme acquisition module 904 is used to acquire a state conversion scheme corresponding to the current business scenario; the state conversion scheme is configured based on the business requirements corresponding to the business scenario;

[0123] The operation link determination module 906 is used to determine the operation link corresponding to the operation data according to the state transition scheme, and run the business implementation class corresponding to the operation link to obtain the business operation result;

[0124] The data status changing module 908 is used to change the status of the operation data when the business operation result is that the operation is successful.

[0125] In some embodiments, the operation link determination module 906 is also used to determine the operation support object corresponding to the operation data according to the state transition scheme; the operation support object includes the starting state and the ending state supported by the operation data; the current state of the operation data is verified according to the operation support object to obtain the state verification result; if the state verification result is that the verification passes, the operation link is determined according to the starting state and the ending state, and the business implementation class corresponding to the operation link is run to obtain the business operation result.

[0126] In some embodiments, the operation link determination module 906 is also used to obtain a status verification result of passed verification if the current status of the operation data belongs to the starting status in the operation support object; and obtain a status verification result of failed verification if the current status of the operation data does not belong to the starting status in the operation support object.

[0127] In some embodiments, the data status changing module 908 is further configured to change the status of the operation data from the current status to the terminated status when the business operation result is that the operation is successful.

[0128] In some embodiments, the operation link determination module 906 is also used to obtain the target state to be achieved corresponding to the operation data; determine the optimal operation path from the current state of the operation data to the target state according to the state transition plan; run the business implementation class corresponding to the optimal operation path to obtain the business operation result.

[0129] In some embodiments, the operation link determination module 906 is also used to determine the operation direction of the operation data according to the state transition scheme; in the operation direction, the optimal operation path from the current state of the operation data to the target state is determined according to the operation weight.

[0130] In some embodiments, the data state changing module 908 is further configured to change the state of the operation data from the current state to the target state when the business operation result is that the operation is successful.

[0131] Each module in the above-mentioned data state change device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0132] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG10. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store state transition schemes corresponding to business scenarios. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data state change method is implemented.

[0133] Those skilled in the art will understand that the structure shown in FIG. 10 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0134] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the data state changing method in the above embodiment are implemented.

[0135] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data state changing method in the above embodiment are implemented.

[0136] In one embodiment, a computer program product is provided, including a computer program, which implements the steps of the data state changing method in the above embodiment when executed by a processor.

[0137] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0138] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0139] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0140] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data state change method, characterized in that: The method comprises: In response to the triggering of an operation event, obtaining operation data corresponding to the operation event and the current business scenario; Obtaining a state transition scheme corresponding to the current business scenario; the state transition scheme is configured based on the business requirements corresponding to the business scenario; According to the state transition scheme, determine the operation link corresponding to the operation data, and run the business implementation class corresponding to the operation link to obtain the business operation result; When the business operation result is that the operation is successful, the state of the operation data is changed.

2. The method according to claim 1, characterized in that The step of determining the operation link corresponding to the operation data according to the state transition scheme, and running the business implementation class corresponding to the operation link to obtain the business operation result includes: According to the state transition scheme, determining the operation support object corresponding to the operation data; the operation support object includes the starting state and the ending state supported by the operation data; Verifying the current state of the operation data according to the operation support object to obtain a state verification result; If the status check result is that the check passes, an operation link is determined according to the start state and the end state, and the business implementation class corresponding to the operation link is run to obtain the business operation result.

3. The method according to claim 2, characterized in that The verifying the current state of the operation data according to the operation support object to obtain a state verification result includes: If the current state of the operation data belongs to the initial state in the operation support object, the state verification result is obtained as verification passed; If the current state of the operation data does not belong to the initial state in the operation support object, the state verification result is verification failure.

4. The method according to claim 2 or 3, characterized in that: When the result of the business operation is that the operation is successful, changing the state of the operation data includes: When the business operation result is a successful operation, the state of the operation data is changed from the current state to the termination state.

5. The method according to claim 1, characterized in that The step of determining the operation link corresponding to the operation data according to the state transition scheme, and running the business implementation class corresponding to the operation link to obtain the business operation result includes: Acquire the target state to be achieved corresponding to the operation data; Determining an optimal operation path from a current state of the operation data to the target state according to the state transition scheme; Run the business implementation class corresponding to the optimal operation path to obtain the business operation result.

6. The method according to claim 5, characterized in that The determining, according to the state transition scheme, an optimal operation path from the current state of the operation data to the target state comprises: Determining an operation direction of the operation data according to the state transition scheme; In the operation direction, an optimal operation path from a current state of the operation data to the target state is determined according to the operation weight.

7. The method according to claim 5 or 6, characterized in that: When the result of the business operation is that the operation is successful, changing the state of the operation data includes: When the business operation result is a successful operation, the state of the operation data is changed from the current state to the target state.

8. The method according to claim 1, characterized in that The state transition scheme includes a directional relationship between a data state and an operation, and the attributes of the operation include at least one of an operation direction, whether continuous execution is supported, whether automatic execution is supported, and an operation weight.

9. A data status changing device, characterized in that: The device comprises: An operation data acquisition module, used to obtain the operation data corresponding to the operation event and the current business scenario in response to the triggering of the operation event; A conversion scheme acquisition module is used to acquire a state conversion scheme corresponding to the current business scenario; the state conversion scheme is configured based on the business requirements corresponding to the business scenario; An operation link determination module, used to determine the operation link corresponding to the operation data according to the state transition scheme, and run the business implementation class corresponding to the operation link to obtain the business operation result; The data status changing module is used to change the status of the operation data when the business operation result is a successful operation.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.