Unlock instant, AI-driven research and patent intelligence for your innovation.

A modeling method and terminal of state machine based on laravel framework

A state machine and state technology, applied in multi-programming devices, program control design, instruments, etc., can solve problems such as difficult maintenance, redundant business code, and inability to effectively ensure the readability of business code, and achieve the effect of improving usability

Active Publication Date: 2022-05-17
宝宝巴士股份有限公司
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] Laravel's data model does not support native state machine programming. If it is used to develop relatively complex, multi-state and multi-process business models such as orders and task classes, it usually needs to judge and process business logic in multiple places. , there are often problems such as redundant business code, difficult maintenance and poor readability
In addition, Laravel's model default events only have a few simple data such as post-query events, creating events, post-creating events, updating events, post-updating events, pre-save events, post-save events, pre-delete events, and post-delete events. Operational events cannot effectively and simply register custom events in complex business models, so that the functions of the model cannot be quickly expanded, and the readability of business codes cannot be effectively guaranteed

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A modeling method and terminal of state machine based on laravel framework
  • A modeling method and terminal of state machine based on laravel framework

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0090] Please refer to figure 1 As shown, a state machine modeling method based on the Laravel framework includes:

[0091] S1, create a state machine feature, the state machine feature includes a variety of functions, use the state machine feature in the model of the Laravel framework;

[0092] S2. Define a model state set and a migration event set in the model, the model state set is configured with different state types of the model, and the migration event set is configured with the state of the model at different stages of the migration event;

[0093] S3. Instantiate the model, register the migration event set as a model custom event, and the state machine characteristic will execute a function adapted to it when the model is instantiated and after the model is instantiated;

[0094] S4. After calling the migration event in the migration event set, the functions in the state machine characteristics will execute the functions adapted to it according to the different stag...

Embodiment 2

[0119] Please refer to figure 2 , a modeling terminal 1 of a state machine based on a Laravel framework, comprising a memory 2, a processor 3 and a computer program stored on the memory 2 and operable on the processor 3, and the processor 3 executes the computer program When implementing the steps in the first embodiment.

[0120] In summary, the present invention provides a Laravel framework-based state machine modeling method and terminal, by using the state machine characteristics in the model, and defining the model state machine and event migration set in the model, to achieve fast Create a model with state machine characteristics, so that the functions of the model can be quickly expanded. The developer can quickly understand the business nodes of the model by viewing the model state set, and the developer can quickly understand the business of the model by viewing the configuration of the event migration set Process; the present invention realizes more detailed manage...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present invention relates to a modeling method and terminal of a state machine based on a Laravel framework, comprising: S1, creating a state machine characteristic, the state machine characteristic includes multiple functions, and using the state machine characteristic in the model of the Laravel framework; S2, in The model state set and migration event set are defined in the model. The model state set configures different state types of the model, and the migration event set configures the state of the model at different stages of the migration event; S3, instantiate the model, and register the migration event set as a model For custom events, the state machine feature will execute the function adapted to it when the model is instantiated and after the model is instantiated; S4. After calling the migration event in the migration event set, the functions in the state machine feature will be executed along with the migration event Different stages execute the functions that adapt to it. With the execution of migration events, different stages will set the state of the model according to the configuration in the migration event set. The invention can quickly create a model with the characteristics of a state machine, and quickly expand the function of the model.

Description

technical field [0001] The invention relates to the field of computer software, in particular to a modeling method and a terminal of a state machine based on a Laravel framework. Background technique [0002] Laravel is an open source PHP web framework created by Taylor Otwell, which aims to implement the MVC architecture of web software. Laravel's features include: support for user authentication and authorization, a modular package system and a dedicated package library, providing It connects many types of relational databases, provides tools to assist in the deployment and maintenance of applications, and develops many syntactic sugars. It is a more popular development framework in the field of PHP application development. [0003] Elocquent in Laravel, an object-relational mapper (ORM) that makes interacting with databases very convenient. When using Elacutent, each database table has a corresponding "model" that is used to interact with that table. In addition to retr...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/448G06F9/48
CPCG06F9/4498G06F9/4862
Inventor 李智唐光宇闫乃永卢学明张友春林凡
Owner 宝宝巴士股份有限公司