CN112860454B - Service processing system and method - Google Patents

Service processing system and method Download PDF

Info

Publication number
CN112860454B
CN112860454B CN202110163775.0A CN202110163775A CN112860454B CN 112860454 B CN112860454 B CN 112860454B CN 202110163775 A CN202110163775 A CN 202110163775A CN 112860454 B CN112860454 B CN 112860454B
Authority
CN
China
Prior art keywords
service
class
flow
event
data
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
CN202110163775.0A
Other languages
Chinese (zh)
Other versions
CN112860454A (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.)
Bigo Technology Pte Ltd
Original Assignee
Bigo Technology Pte 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 Bigo Technology Pte Ltd filed Critical Bigo Technology Pte Ltd
Priority to CN202110163775.0A priority Critical patent/CN112860454B/en
Publication of CN112860454A publication Critical patent/CN112860454A/en
Application granted granted Critical
Publication of CN112860454B publication Critical patent/CN112860454B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • 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/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a service processing system and a service processing method, and belongs to the technical field of software architecture. The system comprises a model layer, a view layer and a service logic control layer, wherein the service logic control layer comprises a context environment class for external interaction, the context environment class comprises a plurality of service flows of a service processing system, and a single service flow comprises a plurality of service state classes; the context environment class is used for acquiring service processing events from the view layer and/or the model layer and distributing the service processing events to the service flow for processing; the service flow is used for switching the service state class based on the received service processing event; and the service state class is used for executing service logic corresponding to the service processing event and updating the user interface and/or the service data. The embodiment of the application improves the maintainability and the expansibility of the service processing system by integrating the service state class in the service logic control layer into the service flow and integrating the service flow into the context environment class.

Description

Service processing system and method
Technical Field
The embodiment of the application relates to the technical field of software architecture, in particular to a business processing system and a business processing method.
Background
Currently, in the development of a service processing system, common service processing systems include an MVC (Model-View-Controller) mode, an MVP (Model-View-PRESENTER, model-View-host) mode, an MVVM (Model-View-ViewModel, model-View Model) mode, and the like.
Taking MVP mode as an example, in MVP mode, the moderator layer is responsible for processing business logic, the model layer is responsible for providing data, and the view layer is responsible for displaying user interfaces, i.e., all business logic is deployed at the moderator layer.
With the iteration of the service version, the service functions required to be realized by the service processing system are gradually increased, so that the service logic in a service logic control layer (such as a host layer) is gradually increased, and further the service logic is accumulated in a bulkiness way, and the maintainability and the expansibility of the service processing system are poor.
Disclosure of Invention
The embodiment of the application provides a service processing system and a service processing method, which can reduce the coupling between service logics and improve the cohesiveness between the service logics and increase the maintainability and the expansibility of the service processing system by providing a service state class for executing the service logics, converging the service state class into a plurality of service flows and converging the service flows into a context environment class. The technical scheme is as follows:
According to an aspect of an embodiment of the present application, there is provided a service processing system, the system including a model layer, a view layer, and a service logic control layer, the service logic control layer including a context class for external interaction, the context class including a plurality of service flows of the service processing system, a single service flow including a plurality of service state classes;
The model layer is used for storing service data of the service processing system;
the view layer is used for displaying a user interface of the service processing system based on the service data;
The context environment class is used for acquiring service processing events from the view layer and/or the model layer and distributing the service processing events to the service flow for processing;
The service flow is used for switching the service state class based on the received service processing event;
the service state class is used for executing the service logic corresponding to the service processing event and updating the user interface and/or the service data.
According to an aspect of an embodiment of the present application, there is provided a service processing method, where the method is applied to a service processing system, the system includes a model layer, a view layer, and a service logic control layer, the service logic control layer includes a context class for external interaction, the context class includes a plurality of service flows of the service processing system, and a single service flow includes a plurality of service state classes;
The method comprises the following steps:
The model layer stores service data of the service processing system;
the view layer displays a user interface of the service processing system based on the service data;
The context environment class acquires service processing events from the view layer and/or the model layer, and distributes the service processing events to the service flow for processing;
the service flow switches the service state class based on the received service processing event;
and the service state class executes the service logic corresponding to the service processing event and updates the user interface and/or the service data.
According to an aspect of an embodiment of the present application, there is provided a service processing apparatus, applied to a service processing system, where the system includes a model layer, a view layer, and a service logic control layer, where the service logic control layer includes a context class for external interaction, where the context class includes a plurality of service flows of the service processing system, and a single service flow includes a plurality of service state classes;
The device comprises:
the business data storage module is used for storing business data of the business processing system through the model layer;
the user interface display module is used for displaying a user interface of the service processing system based on the service data through the view layer;
the processing event distribution module is used for acquiring service processing events from the view layer and/or the model layer through the context environment class and distributing the service processing events to the service flow for processing;
a service state class switching module, configured to switch, through the service flow, the service state class based on the received service processing event;
And the service logic executing module is used for executing the service logic corresponding to the service processing event through the service state class and updating the user interface and/or the service data.
According to an aspect of an embodiment of the present application, there is provided a terminal including a processor and a memory, in which a computer program is stored, the computer program being loaded and executed by the processor to implement the above-mentioned service processing method.
According to an aspect of an embodiment of the present application, there is provided a computer readable storage medium having stored therein a computer program loaded and executed by a processor to implement the above-described service processing method.
According to an aspect of embodiments of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the terminal performs the service processing method described above.
The technical scheme provided by the embodiment of the application can bring the following beneficial effects:
The service state classes for executing the service logics are provided, the service state classes are integrated into service flows, and the service flows are integrated into context environment classes, so that the high cohesion among the service logics is realized, the whole flow of the service flows can be known through the service state classes, the service functions of the corresponding service flows can be known through the context environment classes, the reading and understanding are convenient, and the maintainability of the service processing system is improved.
In addition, each service state class is used for executing the service logic corresponding to each service state class, each service stream is used for switching the service state class corresponding to each service stream, so that low coupling between the service state classes and low coupling between the service streams are realized, each state stream can be assembled and disassembled with low cost, or each service state class is assembled and disassembled with low cost, and further, the service processing system has good expansibility.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a block diagram of a business processing system provided in one embodiment of the present application;
FIG. 2 is a flow chart of active handoff of a traffic state class provided by one embodiment of the present application;
FIG. 3 is a schematic diagram of internal interactions of a business processing system provided by one embodiment of the present application;
FIG. 4 is a schematic diagram of an interaction initiation point of a business processing system provided by one embodiment of the present application;
FIG. 5 is a schematic diagram of an interface relationship in a code architecture corresponding to a service logic control layer according to an embodiment of the present application;
FIG. 6 is a flow chart of a business processing method provided by an embodiment of the present application;
Fig. 7 is a block diagram of a service processing apparatus according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
Referring to fig. 1, a schematic diagram of a service processing system according to an embodiment of the present application is shown. The service processing system may include: the service logic control layer 103 comprises a context environment class for external interaction, wherein the context environment class comprises a plurality of service flows of the service processing system, and a single service flow comprises a plurality of service state classes.
The model layer 101 is used for storing service data of the service processing system. The service data refers to data required by the service processing system to execute service logic, and may include code data corresponding to the service logic, data required by the service processing system to display, and the like. For example, the data required for the service processing system to display may be data such as pictures, words, symbols, etc. required for the user interface, page, etc. to display. Alternatively, a business processing system refers to a system that processes business events according to a family of business logic. For example, a task system of an application program such as a video class, a live class, a music class, etc. may be implemented based on the business processing system. The business event may be, for example, a display user interface, a user interaction, a data change of the system, etc. The service processing system executes the service logic to process the service event, and generates a service logic execution result, wherein the result can comprise change display data of a user interface, update adjustment data of a page and the like. Optionally, the model layer 101 may also be used for loading of business data. For example, the model layer 101 obtains business data from a network or a local database.
View layer 102 is used to display a user interface of the business processing system based on the business data. The view layer 102 visually displays the business data through a user interface. For example, the view layer 102 constructs content of a user interface based on the business data, the user interface displaying the constructed content to a user. View layer 102 may also update the display user interface based on the business logic execution results described above. Optionally, the view layer 102 may also provide a user with an interactive manner through a user interface. In response to a user interaction with respect to a user interface, such as clicking, pressing, sliding, etc., the view layer 102 displays display content corresponding to the interaction through the user interface. For example, in response to a user interaction with playing of a video in a user interface, the view layer 102 displays the corresponding video through the user interface.
Alternatively, when the view layer 102 needs to present some service data, the required service data may be obtained from the model layer 101 through the service logic control layer 103.
Wherein the service logic control layer 103 is configured to process service logic of the service processing system. Business logic refers to rules and procedures for data processing, such as data operation logic, data acquisition logic, data display logic, and the like. For example, the service logic control layer 103 executes service data acquisition logic, and invokes the model layer 101 to acquire corresponding service data.
Optionally, the context class in the business logic control layer 103 is the interaction summary portal of the business logic control layer 103. The context classes may be used to obtain business process events from view layer 102 and/or model layer 101 and distribute the business process events to the business streams for processing. For example, the context class may be used to obtain user interactions (e.g., gesture clicks, etc.) from the view layer 102, the context class may be used to obtain data change notifications from the model layer 101, etc., which are not limited by the embodiments of the application.
The view layer 102 or the model layer 101 may obtain service flow deployment in the service logic control layer 103 and a service state class corresponding to the service flow through a context class. For example, referring to fig. 1, the view layer 102 may obtain that at least 2 traffic flows, each including at least 3 traffic state classes, are included in the logical control layer 103 through the context class.
The context class is a collection class of traffic flows. A context class may include a plurality of traffic streams, each having a unique property, any two of which are independent of each other. For example, a context class includes traffic A and traffic B, and whether traffic A is invoked or not does not affect traffic B.
Optionally, different context classes correspond to different types of traffic flow sets. For example, taking a service processing system corresponding to a video class application as an example, a first context class of the service processing system may include praise, forwarding, commentary, etc. for an existing video. The second context class of the service processing system may include recording, adjusting, uploading, etc. the service stream for the video.
The service flow is a service chain, and has complete service functions. A service flow may include a plurality of service state classes, each having a unique property. For example, referring to fig. 1, traffic flow a may include a plurality of traffic state classes, such as traffic state class 1, traffic state class 2, traffic state class 3, and so on. The service flow may be used to switch the service state class based on the received service processing event. For example, taking the comment service flow as an example, the comment service flow may include a selection service status class, an edit service status class, and a post service status class. The current service state class of the service flow is a selected service state class, and if the service flow receives a service processing event input by a processing user, the service flow switches the selected service state class to an edited service state class.
Optionally, the traffic flow further comprises an observable data storage class. The observable data storage class is used for driving the service state class switching in the service flow, and the specific content of the observable data storage class can be as follows: the service flow is used for executing a state class switching method of the service flow, and updating data in the observable data storage class; the observable data storage class is used for responding to a data updating event in the observable data storage class, generating updating callback information, and the updating callback information is used for acquiring a first service state class; the service flow is used for switching the current service state class of the service flow to the first service state class based on the update callback information. Wherein the first service state class may be any service state class in the service flow. The observable data storage class may be user-defined. For example, observable data storage class LiveData (real-time data) may be used in application component Activity.
In one example, the service state class may also actively perform service state class switching through a service flow, which specifically includes the following: the service state class is used for executing switching logic in the service state class, sending the identification information of the second service state class to the service flow, and updating the data in the observable data storage class by calling a state class switching method of the service flow; the observable data storage class is used for responding to a data updating event in the observable data storage class, generating the updating callback information, and the updating callback information comprises the identification information of the second service state class; the service flow is configured to switch a current service state class of the service flow to a second service state class based on the update callback information. Wherein the second service state class may be any service state class in the service flow.
For example, referring to fig. 2, in process 201, service state class a performs switching logic of service state class a, acquires identification information of service state class B, and sends the identification information of service state class B to a service flow, and at the same time, service state class a performs a service state class a release method to release held service data. And then the service state class A updates the data in the observable data storage class of the service flow by calling a state class switching method in the service flow. The observable data storage class generates update callback information, the service flow obtains a corresponding service state class B based on the update callback information, and executes a hit method of the service state class B, so that the service state class B starts to execute corresponding service logic.
Optionally, one traffic flow corresponds to one context class. For example, traffic flow a cannot exist in both context class 1 and context 2, traffic flow a exists either only in context class 1 or only in context 2, and traffic flow a receives only traffic handling events corresponding to the context class.
The business state class is an interactive outlet and can be used for executing business logic corresponding to the business processing event and updating the user interface and/or business data. For example, taking the above selected service state class as an example, if the current service state class of the service flow is the selected service state class, the selected service state class executes the service logic corresponding to the user selected interactive operation, processes the user selected interactive operation, and controls the user interface to display the interface effect corresponding to the user selected interactive operation. Optionally, the business state classes may also include user interface logic, data update logic, and the like. The user interface logic is used for processing the business data corresponding to the user interface, and the data updating logic is used for processing the business data in the model layer.
Optionally, one traffic state class corresponds to one traffic flow. For example, the service state class a cannot exist in both the service flow 1 and the service flow 2, the service state class a exists in either the service flow 1 or the service flow 2, and the service state class a is only responsive to the switching process of the corresponding service flow.
Optionally, the service data is shared between the service state class and the service state through a service flow. For example, consider a comment traffic flow. And selecting a service state class, editing the service state class and publishing the service state class, and sharing part of comment data through the comment service flow.
In summary, according to the technical scheme provided by the embodiment of the application, the service state class for executing the service logic is provided, the service state classes are integrated into the service flows, and the service flows are integrated into the context environment class, so that the high cohesion between the service logics is realized, the whole flow of the service flows can be known through the service state class, the service functions of the corresponding service flows can be known through the context environment class, the reading and understanding are convenient, and the maintainability of the service processing system is improved.
In addition, each service state class is used for executing the service logic corresponding to each service state class, each service stream is used for switching the service state class corresponding to each service stream, so that low coupling between the service state classes and low coupling between the service streams are realized, each state stream can be assembled and disassembled with low cost, or each service state class is assembled and disassembled with low cost, and further, the service processing system has good expansibility.
In addition, the service state class is switched by the observable data class in the service flow, so that the automatic switching of the service state class is realized without manual switching, and the efficiency of the service processing system for processing the service event is further improved.
In one exemplary embodiment, referring to FIG. 3, the interaction relationship between the model layer, the view layer, and the business logic control layer may be as follows:
The model layer 301 and the service logic control layer 303 are in a bidirectional interaction relationship, and the service logic control layer 303 can obtain service data from the model layer 301. The model layer 301 may send a business process event to the business logic control layer 303.
A two-way interaction is between the view layer 302 and the service logic control layer 303. View layer 302 may send a business process event to business logic control layer 303, and business logic control layer 303 may control view layer 302 to update a user interface displaying the business process system.
It should be noted that the model layer 301 and the view layer 302 do not directly interact. View layer 302 obtains business data from model layer 301 through business logic control 303.
Optionally, the interaction relationship between the view layer, model layer, context class, traffic flow and traffic state class may be as follows:
A one-way interaction relationship is between the view layer 302 and the context class 304. The context environment class 304 is provided with an interaction interface for interaction of the view layer 302, and the view layer 302 obtains a current service state class of each service flow in the context environment class 304 through the corresponding interaction interface, and sends a service processing event to the context environment class 304 to inform the context environment class 304 to switch the service state class. The context class 304 cannot actively operate on the view layer 302.
A one-way interaction relationship is between the context class 304 and the traffic flow 305. The context class 304 may actively operate on the traffic flow 305. For example, context class 304 may obtain or update a current traffic state class of traffic flow 305. Traffic flow 305 cannot actively operate on context class 304.
A two-way interaction is between traffic flow 305 and traffic state class 306. Traffic flow 305 may actively switch traffic state flow 306 and traffic state flow 306 may also actively switch traffic flow 305.
Optionally, the service flow 305 and the model layer 301 are also in a unidirectional interaction relationship. Traffic flow 305 requires corresponding traffic data in model layer 301 when constructing a new traffic flow or adjusting a traffic flow. The service flow 305 may actively update service data in the model layer, and may also operate methods in the model layer 301, such as methods of resource loading, searching, modifying, deleting, and the like. Model layer 301 cannot actively operate on traffic flow 305.
A one-way interaction relationship is between the business state class 306 and the model layer 301. The business state class 305 may actively update business data in the model layer, and may also operate methods in the model layer 301, such as methods of resource loading, searching, modifying, deleting, and the like. The model layer 301 cannot actively operate on the business state classes 306.
Optionally, the business state class 306 also has a unidirectional interaction with the view layer 302. Business state class 306 executes corresponding user interface logic to update the display user interface through view layer 302. View layer 302 cannot actively operate on business state class 306.
The model layer 301 and the context exchange environment class 304 are in a one-way interaction relationship. The model layer 301 may actively send business process events to the context switch environment class 304. For example, when the data in the model layer 301 (such as the service data required for displaying the user interface) changes, the model layer 301 sends the corresponding data change event to the context class 304, and notifies the context class 304 to invoke the target service state class in the corresponding service flow.
In one exemplary embodiment, referring to fig. 4, the interaction initiation point of the business processing system may include at least the following three points:
1. the interaction starting point 401 corresponds to an interface operation event of a stress layer, and the specific interaction process is as follows:
The context environment class is used for acquiring interface operation events from the view layer; determining a first service flow associated with an interface operation event from a plurality of service flows; and distributing the interface operation event to the first service flow for processing. The interface operation event refers to the interactive operation of the user on the user interface. For example, the triggering operation of the user for the resource download control, the triggering operation of the user for the video playing control, and the like, which is not limited by the embodiment of the present application.
For example, take the triggering operation of the user for the resource download control as an example. The view layer informs the context environment class of the interface operation event through the corresponding interface in the context environment class. The context class distributes the interface operation event to the corresponding traffic stream. The service flow is switched to a corresponding service state class, corresponding service resource acquisition logic is executed, a model layer is called to load corresponding resources, after the loading of the resources is completed, the model layer informs a context environment class that the resources are completed, the context environment class calls the data from the model layer through the service state class, then the context environment class controls the service flow to be switched to the service state class for executing user interface logic, and finally the data is displayed to a user through a view layer.
2. The interaction starting point 402 corresponds to a data update event of a model layer, and the specific interaction process is as follows:
the context class is used for acquiring data update events from the model layer; determining a second traffic stream associated with the data update event from the plurality of traffic streams; and distributing the data updating event to the second service flow for processing. The data update event may refer to code data corresponding to service logic, update event of data such as data required by the service processing system to display, and the like.
For example, the service processing system displays the required data. The model layer notifies the context class of the data update event through a corresponding interface in the context class. The context class distributes the interface operation event to the corresponding traffic stream. The service flow is switched to the corresponding service state class, corresponding user interface logic is executed, and the user interface is updated through the view layer.
3. The interaction start point 403, which corresponds to a global event triggered by the system (or application), has the following specific interaction procedure:
The service flow is used for acquiring a global event triggered by the system, the global event is registered in the service flow in advance, and the service state class is switched based on the global event; the service state class is used for executing the service logic corresponding to the global event and updating the user interface and/or the service data. Wherein the global event is used to prompt the traffic flow system (or application) to change. Different global events are registered in different traffic flows. For example, global events such as GPS (Global Positioning System ), network, etc. may be registered in the traffic flow for positioning. Events such as network, foreground and background switching and the like can be registered in the service flow for downloading the resources. Optionally, the registration and the de-registration of the global event are both in the traffic flow, and when the global event is triggered, the traffic flow directly receives the corresponding global event.
For example, a network global event (e.g., network outage, etc.) is taken as an example. The context class distributes the network global event to the corresponding traffic stream after receiving the network global event. The service flow is switched to the corresponding service state class, corresponding user interface logic is executed, and the network global event is displayed to the user through the view layer.
In an exemplary embodiment, referring to fig. 5, the interface relationship in the code architecture corresponding to the service logic control layer may be as follows:
In the code corresponding to the service logic control layer, the context class interface 501 is represented by IContext interface, the service flow interface 502 is represented by IFlow interface, the service state class interface 504 is represented by IState interface, and the model layer interface 503 is represented by IData interface. The IContext interfaces include a plurality of IFlow interfaces, and the IFlow interfaces include a plurality of IState interfaces. Meanwhile, IFlow interfaces and IState interfaces rely on IData interfaces.
The method and properties of IFlow interface may be as follows:
1. Map < UniqueKey, IState > attributes that define the set of traffic state classes that the current traffic flow contains, each specific traffic flow may contain a different set of traffic state classes. This attribute needs to be implemented in a specific traffic flow.
2. IData attributes, which are used to represent specific model objects. The service logic control layer needs to build a complete service flow according to IData, which can be implemented in AbsFlow (base class service flow).
3. An IState attribute for indicating a current traffic state class of a traffic flow. This attribute is updated when the service state class is switched.
4. UniqueKey attribute, which is used to flag the uniqueness of the traffic stream, this attribute can be implemented in a specific traffic stream.
5. And the destroymethod is used for controlling the current service flow to release the held resources and destroying the current service flow. It may be implemented in AbsFlow, or may be implemented specifically in a specific traffic flow according to the actual situation.
6. SetState methods for switching traffic state classes, which may be implemented in AbsFlow.
7. ObservableData attributes, which define observable data storage classes, can be used to drive traffic state class switching. Alternatively LiveData may be used as the observable data class, or the observable data storage class may be user-defined. This attribute may be implemented in AbsFlow.
The method and properties of the IState interface may be as follows:
1. UniqueKey attributes, which are used to flag the uniqueness of the service state class, may be implemented in a specific service state class.
2. IFlow attribute, which is used to represent the service flow to which the current service state class belongs, is implemented in AbsState (base class service state class).
3. The Hit method is used for hitting a target service state class and executing service logic corresponding to the target service state class, and each service state class corresponds to different service logic. The method may be implemented in a specific service state class.
4. Next method for representing switching logic from a current traffic state class to a Next traffic state class, each traffic state class corresponding to a different switching logic. The method may be implemented in a specific service state class.
5. The destroyer method, which is used for controlling the current service state class to release the held resources, can be implemented in AbsState, and can also be specifically implemented in the specific service state class according to the actual situation.
The most core part in the code architecture corresponding to the service logic control layer is to construct common AbsFlow and AbsState. After the two base classes are built, if a new simple service flow needs to be built, the codes corresponding to the corresponding service flow and the service state class only need to be simply filled. Alternatively, the code may be implemented based on a programming language Kotlin (ketlin).
From the interface methods and attributes of IFlow and IState, it can be known that when AbsFlow and AbsState are relatively perfect, only the map < UniqueKey, IState > attribute in IFlow, the hit method and the next method in IState need to be simply filled in to add a simple service chain.
For example, the model layer further includes a base class service flow and a base class service state class, the base class service flow refers to a general service flow, the base class service state class refers to a general service state class, and the specific content of the service processing system for constructing a new service flow may be as follows: the context environment class is used for acquiring a base class service stream and a base class service state class from the model layer, determining a base class service state class set included in the base class service stream, determining service logic and switching logic respectively corresponding to each base class service state class in the base class service state class set, and generating a new service stream.
In summary, according to the technical scheme provided by the embodiment of the application, the service state class for executing the service logic is provided, the service state classes are integrated into the service flows, and the service flows are integrated into the context environment class, so that the high cohesion between the service logics is realized, the whole flow of the service flows can be known through the service state class, the service functions of the corresponding service flows can be known through the context environment class, the reading and understanding are convenient, and the maintainability of the service processing system is improved.
In addition, each service state class is used for executing the service logic corresponding to each service state class, each service stream is used for switching the service state class corresponding to each service stream, so that low coupling between the service state classes and low coupling between the service streams are realized, each state stream can be assembled and disassembled with low cost, or each service state class is assembled and disassembled with low cost, and further, the service processing system has good expansibility.
In addition, by setting the basic service flow and the basic service state class, the service flow can be conveniently and newly added.
The following are embodiments of the method according to the application, for details not described in detail in the embodiments of the method according to the application, reference may be made to embodiments of the system according to the application.
Referring to fig. 6, a flowchart of a service processing method according to an embodiment of the application is shown. The method can be applied to the service processing system described in the above embodiment. The method may include the following steps (601-605):
In step 601, the model layer stores business data of a business processing system.
In step 602, the view layer displays a user interface of the business processing system based on the business data.
In step 603, the context class obtains the service processing event from the view layer and/or the model layer, and distributes the service processing event to the service flow for processing.
In one example, the specific processing content of a context class for a business process event from the view layer may be as follows: the context environment class acquires interface operation events from the view layer; the context environment class determines a first service flow associated with the interface operation event from a plurality of service flows; the context class distributes the interface operation event to the first service flow for processing.
In one example, the specific processing content of the context class on the business process events from the model layer may be as follows: the context environment class acquires a data update event from the model layer; the context class determining a second traffic flow associated with the data update event from the plurality of traffic flows; the context class distributes the data update event to the second traffic stream for processing.
In step 604, the service flow switches the service state class based on the received service processing event.
Optionally, the service flow may further include an observable data storage class, and the service flow may switch the service state through the observable data storage class, and the specific content may be as follows: the service flow executes the state class switching method of the service flow, and updates the data in the observable data storage class; the observable data storage class responds to a data update event in the observable data storage class, generates update callback information, and the update callback information is used for acquiring a first service state class; and the service flow switches the current service state class of the service flow to the first service state class based on the update callback information.
Optionally, the service flow may also switch the service state class based on a global event triggered by the system, and the specific content may be as follows: the service flow obtains the global event triggered by the system, the global event is registered in the service flow in advance, and the service state class is switched based on the global event. The business state class executes business logic corresponding to the global event and updates the user interface and/or the business data.
In one example, the service state class may also actively perform service state class switching through the service flow, and the specific content may be as follows: the service state class executes switching logic in the service state class, sends the identification information of the second service state class to the service flow, and updates the data in the observable data storage class by calling a state class switching method of the service flow; the observable data storage class responds to a data update event in the observable data storage class, and generates update callback information which comprises identification information of a second service state class; and the service flow switches the current service state class of the service flow to a second service state class based on the update callback information.
In one example, the model layer further includes a base class service flow and a base class service state class, where the base class service flow refers to a generic service flow, and the base class service state class refers to a generic service state class. The context class can construct a new service flow through the base class service flow and the base class service state class, and the specific content of the context class can be as follows: the context environment class obtains a base class service stream and a base class service state class from the model layer, determines a base class service state class set included in the base class service stream, determines service logic and switching logic respectively corresponding to each base class service state class in the base class service state class set, and generates a new service stream.
Optionally, any two traffic flows are independent of each other.
In step 605, the service state class executes the service logic corresponding to the service processing event, and updates the user interface and/or the service data.
Optionally, one traffic flow corresponds to one context class; one traffic state class corresponds to one traffic flow.
In summary, according to the technical scheme provided by the embodiment of the application, the service state class for executing the service logic is provided, the service state classes are integrated into the service flows, and the service flows are integrated into the context environment class, so that the high cohesion between the service logics is realized, the whole flow of the service flows can be known through the service state class, the service functions of the corresponding service flows can be known through the context environment class, the reading and understanding are convenient, and the maintainability of the service processing system is improved.
In addition, each service state class is used for executing the service logic corresponding to each service state class, each service stream is used for switching the service state class corresponding to each service stream, so that low coupling between the service state classes and low coupling between the service streams are realized, each state stream can be assembled and disassembled with low cost, or each service state class is assembled and disassembled with low cost, and further, the service processing system has good expansibility.
The following are examples of the apparatus of the present application that may be used to perform the method embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the system of the present application.
Referring to fig. 7, a block diagram of a service processing apparatus according to an embodiment of the present application is shown. The device has the function of realizing the service processing method example, and the function can be realized by hardware or can be realized by executing corresponding software by hardware. The device may be the terminal described above or may be provided in the terminal. The apparatus 700 may include: a business data storage module 701, a user interface display module 702, a processing event distribution module 703, a business state class switching module 704, and a business logic execution module 705.
A service data storage module 701, configured to store service data of the service processing system through the model layer.
A user interface display module 702, configured to display, through the view layer, a user interface of the service processing system based on the service data.
And the processing event distribution module 703 is configured to obtain, through the context environment class, a service processing event from the view layer and/or the model layer, and distribute the service processing event to the service flow for processing.
And a service state class switching module 704, configured to switch, through the service flow, the service state class based on the received service processing event.
And the service logic executing module 705 is configured to execute the service logic corresponding to the service processing event through the service status class, and update the user interface and/or the service data.
In an exemplary embodiment, any two of the traffic flows are independent of each other.
In an exemplary embodiment, the processing event distribution module 703 is configured to:
acquiring interface operation events from the view layer through the context environment class;
Determining a first service flow associated with the interface operation event from the plurality of service flows through the context class;
and distributing the interface operation event to the first service flow for processing through the context environment class.
In an exemplary embodiment, the processing event distribution module 703 is further configured to:
Acquiring a data update event from the model layer through the context environment class;
Determining a second traffic flow associated with the data update event from the plurality of traffic flows through the context class;
And distributing the data updating event to the second service flow for processing through the context environment class.
In one exemplary embodiment, the business state class switching module 704 is configured to:
the global event triggered by the service flow acquisition system is registered in the service flow in advance, and the service state class is switched based on the global event;
the service logic executing module 705 is further configured to execute, by using the service status class, a service logic corresponding to the global event, and update the user interface and/or the service data.
In one exemplary embodiment, the traffic flow further comprises an observable data storage class;
the service state class switching module 704 is further configured to:
Updating data in the observable data storage class through the state class switching method of the service flow executed by the service flow;
Generating update callback information by the observable data storage class in response to a data update event in the observable data storage class, wherein the update callback information is used for acquiring a first service state class;
And switching the current service state class of the service flow to the first service state class based on the updating callback information through the service flow.
In an exemplary embodiment, the service status class switching module 704 is further configured to:
Executing switching logic in the service state class through the service state class, sending identification information of a second service state class to the service flow, and updating data in the observable data storage class by calling a state class switching method of the service flow;
generating the update callback information by the observable data storage class in response to a data update event in the observable data storage class, wherein the update callback information comprises identification information of the second service state class;
and switching the current service state class of the service flow to the second service state class based on the updating callback information through the service flow.
In one exemplary embodiment, one traffic flow corresponds to one context class; one traffic state class corresponds to one traffic flow.
In an exemplary embodiment, the model layer further includes a base class service flow and a base class service state class, where the base class service flow refers to a general service flow, and the base class service state class refers to a general service state class;
The processing event distribution module 703 is further configured to obtain the base class service flow and the base class service state class from the model layer through the context environment class, determine a base class service state class set included in the base class service flow, and determine service logic and switching logic corresponding to each base class service state class in the base class service state class set, so as to generate a new service flow.
In summary, according to the technical scheme provided by the embodiment of the application, the service state class for executing the service logic is provided, the service state classes are integrated into the service flows, and the service flows are integrated into the context environment class, so that the high cohesion between the service logics is realized, the whole flow of the service flows can be known through the service state class, the service functions of the corresponding service flows can be known through the context environment class, the reading and understanding are convenient, and the maintainability of the service processing system is improved.
In addition, each service state class is used for executing the service logic corresponding to each service state class, each service stream is used for switching the service state class corresponding to each service stream, so that low coupling between the service state classes and low coupling between the service streams are realized, each state stream can be assembled and disassembled with low cost, or each service state class is assembled and disassembled with low cost, and further, the service processing system has good expansibility.
It should be noted that, when the apparatus provided in the foregoing embodiment performs the functions thereof, only the division of the foregoing functional modules is used as an example, in practical application, the foregoing functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to perform all or part of the functions described above. In addition, the device and the system embodiment provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the device and the system embodiment are detailed in the system embodiment, which is not described herein again.
In an exemplary embodiment, there is also provided a terminal including a processor and a memory, the memory having stored therein a computer program loaded and executed by the processor to implement a service processing method as described above.
In one exemplary embodiment, there is also provided a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the above-described service processing method.
Alternatively, the computer-readable storage medium may include: ROM (Read-Only Memory), RAM (Random-Access Memory), SSD (Solid State disk), or optical disk. The random access memory may include, among other things, reRAM (RESISTANCE RANDOM ACCESS MEMORY, resistive random access memory) and DRAM (Dynamic Random Access Memory ).
In one exemplary embodiment, a computer program product or computer program is also provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the terminal reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the terminal executes the service processing method.
It should be understood that references herein to "a plurality" are to two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. In addition, the step numbers described herein are merely exemplary of one possible execution sequence among steps, and in some other embodiments, the steps may be executed out of the order of numbers, such as two differently numbered steps being executed simultaneously, or two differently numbered steps being executed in an order opposite to that shown, which is not limiting.
The foregoing description of the exemplary embodiments of the application is not intended to limit the application to the particular embodiments disclosed, but on the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the application.

Claims (13)

1. A business processing system, wherein said system comprises a model layer, a view layer and a business logic control layer, said business logic control layer comprising a context class for external interaction, said context class comprising a plurality of business flows of said business processing system, different said context class corresponding to a collection of different types of said business flows, a single said business flow comprising a plurality of business state classes, one said business flow corresponding to one said context class, one said business state class corresponding to one said business flow;
The model layer is used for storing service data of the service processing system;
the view layer is used for displaying a user interface of the service processing system based on the service data;
The context environment class is used for acquiring service processing events from the view layer and/or the model layer and distributing the service processing events to the service flow for processing;
The service flow is used for switching the service state class based on the received service processing event;
the service state class is used for executing the service logic corresponding to the service processing event and updating the user interface and/or the service data.
2. The system of claim 1, wherein any two of said traffic flows are independent of each other.
3. The system of claim 1, wherein the context environment class is configured to:
Acquiring an interface operation event from the view layer;
determining a first service flow associated with the interface operation event from the plurality of service flows;
And distributing the interface operation event to the first service flow for processing.
4. The system of claim 1, wherein the context environment class is configured to:
acquiring a data update event from the model layer;
determining a second traffic stream associated with the data update event from the plurality of traffic streams;
And distributing the data updating event to the second service flow for processing.
5. The system of claim 1, wherein the system further comprises a controller configured to control the controller,
The service flow is further used for acquiring a global event triggered by the system, wherein the global event is registered in the service flow in advance and is used for switching the service state class based on the global event;
the service state class is used for executing the service logic corresponding to the global event and updating the user interface and/or the service data.
6. The system of claim 1, wherein the traffic stream further comprises an observable data storage class;
The service flow is further used for executing a state class switching method of the service flow, and updating data in the observable data storage class;
The observable data storage class is used for responding to a data update event in the observable data storage class and generating update callback information, and the update callback information is used for acquiring a first service state class;
And the service flow is further used for switching the current service state class of the service flow to the first service state class based on the update callback information.
7. The system of claim 6, wherein the system further comprises a controller configured to control the controller,
The service state class is further used for executing switching logic in the service state class, sending identification information of a second service state class to the service flow, and updating data in the observable data storage class by calling a state class switching method of the service flow;
the observable data storage class is used for responding to a data update event in the observable data storage class and generating the update callback information, wherein the update callback information comprises the identification information of the second service state class;
and the service flow is further used for switching the current service state class of the service flow to the second service state class based on the update callback information.
8. The system according to any one of claims 1 to 7, wherein the model layer further includes a base class service flow and a base class service state class, the base class service flow is a generic service flow, and the base class service state class is a generic service state class;
The context environment class is further used for acquiring the base class service flow and the base class service state class from the model layer, determining a base class service state class set included in the base class service flow, determining service logic and switching logic corresponding to each base class service state class in the base class service state class set, and generating a new service flow.
9. A service processing method, wherein the method is applied to a service processing system, the system comprises a model layer, a view layer and a service logic control layer, the service logic control layer comprises a context environment class for external interaction, the context environment class comprises a plurality of service flows of the service processing system, different context environment classes correspond to different types of sets of service flows, a single service flow comprises a plurality of service state classes, one service flow corresponds to one context environment class, and one service state class corresponds to one service flow;
The method comprises the following steps:
The model layer stores service data of the service processing system;
the view layer displays a user interface of the service processing system based on the service data;
The context environment class acquires service processing events from the view layer and/or the model layer, and distributes the service processing events to the service flow for processing;
the service flow switches the service state class based on the received service processing event;
and the service state class executes the service logic corresponding to the service processing event and updates the user interface and/or the service data.
10. A service processing device, characterized in that, the system comprises a model layer, a view layer and a service logic control layer, the service logic control layer comprises a context environment class for external interaction, the context environment class comprises a plurality of service flows of the service processing system, different context environment classes correspond to different types of sets of the service flows, a single service flow comprises a plurality of service state classes, one service flow corresponds to one context environment class, and one service state class corresponds to one service flow;
The device comprises:
the business data storage module is used for storing business data of the business processing system through the model layer;
the user interface display module is used for displaying a user interface of the service processing system based on the service data through the view layer;
the processing event distribution module is used for acquiring service processing events from the view layer and/or the model layer through the context environment class and distributing the service processing events to the service flow for processing;
a service state class switching module, configured to switch, through the service flow, the service state class based on the received service processing event;
And the service logic executing module is used for executing the service logic corresponding to the service processing event through the service state class and updating the user interface and/or the service data.
11. A terminal comprising a processor and a memory, the memory having stored therein a computer program that is loaded and executed by the processor to implement the service processing method of claim 9.
12. A computer readable storage medium having stored therein a computer program that is loaded and executed by a processor to implement the business processing method of claim 9.
13. A computer program product, characterized in that it comprises computer instructions stored in a computer readable storage medium, which are read and executed by a processor from the computer readable storage medium to implement the service processing method according to claim 9.
CN202110163775.0A 2021-02-05 2021-02-05 Service processing system and method Active CN112860454B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110163775.0A CN112860454B (en) 2021-02-05 2021-02-05 Service processing system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110163775.0A CN112860454B (en) 2021-02-05 2021-02-05 Service processing system and method

Publications (2)

Publication Number Publication Date
CN112860454A CN112860454A (en) 2021-05-28
CN112860454B true CN112860454B (en) 2024-04-19

Family

ID=75989402

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110163775.0A Active CN112860454B (en) 2021-02-05 2021-02-05 Service processing system and method

Country Status (1)

Country Link
CN (1) CN112860454B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1556490A (en) * 2004-01-08 2004-12-22 上海复旦光华信息科技股份有限公司 Multi surce audit data business uniformity judging method based on state conversion table
CN101526906A (en) * 2008-03-07 2009-09-09 上海汇和信息技术有限公司 Management system for running maintenance services
CN103745399A (en) * 2014-01-22 2014-04-23 长沙钢为网络科技有限公司 Auction processing system and method
CN104346412A (en) * 2013-08-09 2015-02-11 中国科学院沈阳自动化研究所 Semantic information based RFID (Radio Frequency Identification Device) complex event processing method
CN107239324A (en) * 2017-05-22 2017-10-10 阿里巴巴集团控股有限公司 Work flow processing method, apparatus and system
CN107656821A (en) * 2016-07-25 2018-02-02 武汉票据交易中心有限公司 The processing method and relevant apparatus and server of a kind of operation flow
CN108241487A (en) * 2016-12-26 2018-07-03 北京中普达科技股份有限公司 The system architecture of mobile equipment performance can be improved
CN108460516A (en) * 2018-01-22 2018-08-28 深圳前海数创人工智能有限公司 A kind of weather warning forecasts services intelligent management system and method
CN109101223A (en) * 2018-07-26 2018-12-28 北京大米未来科技有限公司 A kind of Business Process Control method, Business Process Control engine and system
CN109672582A (en) * 2018-09-25 2019-04-23 平安普惠企业管理有限公司 Complete trails monitoring method, equipment, storage medium and device
CN110399429A (en) * 2019-07-30 2019-11-01 阿里巴巴集团控股有限公司 A kind of distributed transaction processing method and system
CN111694555A (en) * 2020-06-18 2020-09-22 国网宁夏电力有限公司营销服务中心(国网宁夏电力有限公司计量中心) Business system construction method and device, electronic equipment and storage medium
CN111897815A (en) * 2020-07-15 2020-11-06 中国建设银行股份有限公司 Service processing method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2002322090A1 (en) * 2001-06-13 2002-12-23 Caminus Corporation System architecture and method for energy industry trading and transaction management
WO2004114061A2 (en) * 2003-06-12 2004-12-29 Reuters America Business process automation through the use of workflow
US7823125B2 (en) * 2006-08-25 2010-10-26 Wipro Limited Electronic enabler and prescriptive modular service oriented architecture
US9355375B2 (en) * 2011-12-14 2016-05-31 Holger Knospe Launch of target user interface features based on specific business process instances
US8972942B2 (en) * 2012-07-19 2015-03-03 International Business Machines Corporation Unit testing an Enterprise Javabeans (EJB) bean class
US20160239770A1 (en) * 2015-02-13 2016-08-18 Wipro Limited Method and system for dynamically changing process flow of a business process

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1556490A (en) * 2004-01-08 2004-12-22 上海复旦光华信息科技股份有限公司 Multi surce audit data business uniformity judging method based on state conversion table
CN101526906A (en) * 2008-03-07 2009-09-09 上海汇和信息技术有限公司 Management system for running maintenance services
CN104346412A (en) * 2013-08-09 2015-02-11 中国科学院沈阳自动化研究所 Semantic information based RFID (Radio Frequency Identification Device) complex event processing method
CN103745399A (en) * 2014-01-22 2014-04-23 长沙钢为网络科技有限公司 Auction processing system and method
CN107656821A (en) * 2016-07-25 2018-02-02 武汉票据交易中心有限公司 The processing method and relevant apparatus and server of a kind of operation flow
CN108241487A (en) * 2016-12-26 2018-07-03 北京中普达科技股份有限公司 The system architecture of mobile equipment performance can be improved
CN107239324A (en) * 2017-05-22 2017-10-10 阿里巴巴集团控股有限公司 Work flow processing method, apparatus and system
CN108460516A (en) * 2018-01-22 2018-08-28 深圳前海数创人工智能有限公司 A kind of weather warning forecasts services intelligent management system and method
CN109101223A (en) * 2018-07-26 2018-12-28 北京大米未来科技有限公司 A kind of Business Process Control method, Business Process Control engine and system
CN109672582A (en) * 2018-09-25 2019-04-23 平安普惠企业管理有限公司 Complete trails monitoring method, equipment, storage medium and device
CN110399429A (en) * 2019-07-30 2019-11-01 阿里巴巴集团控股有限公司 A kind of distributed transaction processing method and system
CN111694555A (en) * 2020-06-18 2020-09-22 国网宁夏电力有限公司营销服务中心(国网宁夏电力有限公司计量中心) Business system construction method and device, electronic equipment and storage medium
CN111897815A (en) * 2020-07-15 2020-11-06 中国建设银行股份有限公司 Service processing method and device

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
Discovery of Web Service Flow based on Service Context;Fangfang Liu et al.;Internation Journal of Web Service Research;全文 *
基于MVC设计模式的SSH框架的研究;胡杰;周鹏飞;郭乔进;;信息化研究(第01期);全文 *
基于UC客户端的MVVM应用与研究;吕磊;杨雪;朱礼鹏;谢俊虎;金元;;计算机与网络(第05期);全文 *
基于开源工作流引擎的电子审批系统开发;郭广丰;邬海燕;;阴山学刊(自然科学版)(第04期);全文 *
基于有限状态机的工作流引擎的设计;邹晶;刘毅敏;;计算机应用与软件(第08期);全文 *

Also Published As

Publication number Publication date
CN112860454A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN109445783B (en) Method and device for constructing dynamic configuration application driven by service
CN113268226B (en) Page data generation method, device, storage medium and equipment
CN114064024B (en) Method, apparatus, device, storage medium and program product for developing micro-application
CN109800135B (en) Information processing method and terminal
CN113253880B (en) Method and device for processing pages of interaction scene and storage medium
EP3944068A2 (en) Method, apparatus and system for voice interaction, vehicles and storage media
CN104504106A (en) Map covering region rendering method and related equipment
CN109614271A (en) Control method, device, equipment and the storage medium of multiple company-data consistency
CN115586935A (en) Data processing method and device, electronic equipment and medium
CN109960709B (en) Database driver processing method, device, equipment and storage medium
CN114564270A (en) List component rendering method, list component rendering method, page front-end display method, device, equipment and medium
CN115543647A (en) Function calling method
CN112860454B (en) Service processing system and method
CN117873597A (en) Method and system for realizing API arrangement through visual configuration mode
CN111970192B (en) Information editing method and device based on session group
CN106874010A (en) A kind of method of the quick paging loadings of ListView in android system
CN113867852A (en) Information display method, device, equipment and storage medium for business requirements
CN111381976B (en) Method and device for updating message prompt data, storage medium and computer equipment
CN116776612A (en) SysML function integration and analysis method based on message middleware
CN112486461B (en) Information processing system based on springboot framework
EP3944069B1 (en) Method, apparatus and system of voice interaction, vehicles and storage media
CN116139485A (en) Virtual resource exchange method and device, electronic equipment and storage medium
CN114356520A (en) Running method, device, equipment, storage medium and program product of micro application
CN112711728A (en) Page layout frame, page loading method, device, equipment and storage medium
CN118672668A (en) Data processing method, device, equipment, medium and product

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
GR01 Patent grant
GR01 Patent grant