CN116009935A - JS state management method, device, equipment and medium - Google Patents

JS state management method, device, equipment and medium Download PDF

Info

Publication number
CN116009935A
CN116009935A CN202310267836.7A CN202310267836A CN116009935A CN 116009935 A CN116009935 A CN 116009935A CN 202310267836 A CN202310267836 A CN 202310267836A CN 116009935 A CN116009935 A CN 116009935A
Authority
CN
China
Prior art keywords
target
data
file
state
management
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.)
Granted
Application number
CN202310267836.7A
Other languages
Chinese (zh)
Other versions
CN116009935B (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.)
Chengdu Shuzhilian Technology Co Ltd
Original Assignee
Chengdu Shuzhilian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Shuzhilian Technology Co Ltd filed Critical Chengdu Shuzhilian Technology Co Ltd
Priority to CN202310267836.7A priority Critical patent/CN116009935B/en
Publication of CN116009935A publication Critical patent/CN116009935A/en
Application granted granted Critical
Publication of CN116009935B publication Critical patent/CN116009935B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a JS state management method, a JS state management device, JS state management equipment and a JS state management medium, which relate to the field of state management and aim to solve the technical problem that the prior art cannot carry out efficient management when a plurality of interface states exist in JavaScript. The JS state management method is used for a front-end platform and comprises the following steps: constructing a public state machine management file; constructing a plurality of front-end business model files based on front-end business model data acquired from a back-end server; acquiring a target front-end service model file based on a plurality of front-end service model files; adding monitorable attribute data to the target front-end service model file, and then inputting the data to the public state machine management file for state information monitoring to obtain real-time state information; and managing the JS state based on the real-time state information.

Description

JS state management method, device, equipment and medium
Technical Field
The present disclosure relates to the field of state management, and in particular, to a method, an apparatus, a device, and a medium for JS state management.
Background
With the development of internet technology, the front end has evolved from a static web page to a dynamic web page. JavaScript (hereinafter abbreviated as JS) single-page application development is increasingly complex, and JavaScript needs to manage more interface states, so that the present web page shows more and more, such as animation, games, drawing, and the like. So the requirements on the front end are also increasing, especially in recent years the frames, technologies, tools are evolving in bursts.
However, in the prior art, management of the front-end item is limited to showing the item content based on the tree structure, and because the content in the hierarchical structure is in a parallel state, the content is complicated and redundant, which is not beneficial to viewing and managing the front-end item content, and therefore, efficient management of multiple interfaces is not possible.
Disclosure of Invention
The main purpose of the application is to provide a JS state management method, a device, equipment and a medium, which aim to solve the technical problem that the prior art cannot carry out efficient management when a plurality of interface states exist in JavaScript.
In order to solve the above technical problems, the embodiments of the present application provide: a method for JS status management for a front-end platform, comprising the steps of:
constructing a public state machine management file;
constructing a plurality of front-end business model files based on front-end business model data acquired from a back-end server; acquiring a target front-end service model file based on a plurality of front-end service model files;
adding monitorable attribute data to the target front-end service model file, and then inputting the data to the public state machine management file for state information monitoring to obtain real-time state information;
and managing the JS state based on the real-time state information.
As some optional embodiments of the present application, after adding the monitorable attribute data to the target front end service model file, inputting the monitorable attribute data to the common state machine management file to perform state information monitoring, to obtain real-time state information, including:
adding monitorable attribute data to a preset node in the target front-end service model file to obtain a monitorable target front-end service model file; wherein the preset node is more than or equal to 1;
and inputting the monitorable target front-end business model file into the public state machine management file to monitor state information, and obtaining real-time state information.
In a specific application, the preset nodes can be set according to actual requirements, and at least one preset node is set; the preset node is the node to be monitored, and the monitorable attribute data is added to the preset node so as to facilitate the public state machine management file to monitor the state information.
As some optional embodiments of the present application, the managing the JS status based on the real-time status information includes:
based on the real-time state information, the JS state is managed to update rendering of the UI interface.
In a specific application, javaScript language is a language that operates particularly asynchronously, i.e. dynamic scripting language. In the application, the front-end service model and the public state machine management file both have observable attributes, so that when the front-end service is triggered by a certain event, the changed data is transferred to the public state machine management file through the component, and the page is re-rendered based on the changed data.
As some optional embodiments of the present application, the obtaining, based on a plurality of the front-end service model files, a target front-end service model file includes:
mapping a plurality of front-end service model files with a plurality of service components; and selecting a front-end service model file with a mapping relation with the target service component as a target front-end service model file based on the target service component.
In a specific application, a plurality of front-end service model files are included in one component, and in an actual application, a target front-end service model file can be selected based on actual requirements, namely, a plurality of service components are acquired; classifying a plurality of service components according to service types to obtain target service components; and acquiring a target front-end service model file based on the target service component. The method comprises the steps of selecting a target service component based on a service target, and acquiring a corresponding target front-end service model file from a rear-end server based on the requirement of the target service component. The state information of the target business component (i.e., target tab page) includes, but is not limited to, running, dormant, suspended running, and closed and cached. When the state information of the target service component is changed, if an emergency occurs in the normal operation process of the target label page, the state of dormancy, operation suspension, temporary closing and the like is changed.
As some optional embodiments of the present application, the obtaining, based on the target service component, a target front-end service model file includes:
acquiring a plurality of service components;
classifying a plurality of service components according to service types to obtain target service components;
and acquiring a target front-end service model file based on the target service component.
In a specific application, the service component refers to a system or a functional module which can independently run to construct an enterprise. In colloquial terms, a business component is a collection of closely related set of work items that need to be completed to achieve a particular goal. Such as presentation pages, e.g., tab pages, web pages, etc., that are built based on specific business objectives. And therefore, a mapping relation exists between the front-end business model file and the business component. I.e. after determining the presentation page, the required trigger button (i.e. front-end business model file) is selected according to the requirements.
As some optional embodiments of the present application, the constructing a plurality of front-end service model files includes:
acquiring front-end service data; wherein, the front-end business data comprises basic attribute data of the front-end business;
constructing a front-end service model based on the front-end service data;
and constructing a front-end business model file based on the front-end business model.
In a specific application, the front-end service model is constructed and obtained based on basic attribute data of a front-end service, wherein the basic attribute data of the front-end service refers to data such as user data, behavior data or commodity data; and outputting a corresponding front-end service model file through the front-end service model. The basic attribute data of the front-end service comprises: at least one of user data, behavior data, and merchandise data; the back-end server is used for storing and processing basic attribute data of the front-end service.
In order to solve the above technical problems, the embodiment of the present application further provides: a JS status management device, comprising:
the public state machine module is used for constructing a public state machine management file;
the business service module is used for constructing a plurality of front-end business model files based on the front-end business model data acquired from the rear-end server; acquiring a target front-end service model file based on a plurality of front-end service model files;
the monitoring module is used for adding the monitorable attribute data to the target front-end service model file, and inputting the monitorable attribute data to the public state machine management file to monitor state information so as to obtain real-time state information;
and the management module is used for managing the JS state based on the real-time state information.
In order to solve the above technical problems, the embodiment of the present application further provides: an electronic device comprising a memory in which a computer program is stored, and a processor executing the computer program to implement the JS state management method as described above.
In order to solve the above technical problems, the embodiment of the present application further provides: a computer-readable storage medium having a computer program stored thereon, the processor executing the computer program to implement the JS state management method as described above.
The prior art approach to managing JS states is typically through reduce (which refers to the state container of JavaScript applications that provides predictable state management), i.e., there is a central store that holds the entire state of the application, and each component can access the stored state without having to send tips (component properties) from one component to another. However, when the JS state is managed by adopting the technology, actions (which are bridges between user requests and service logics, each Action serves as a service agent of a client), a reducer (i.e. a plurality of values or possible side effects on the values) returns a value after compression processing, middleware and the like need to be configured, and in practical application, the use process is very complicated; and all front-end business data are hung together, so that confusion is easy to occur in actual use, and abuse is easy to occur in actual use because each component can be accessed. Compared with the prior art, the JS state management method is used for a front-end platform and comprises the following steps: constructing a public state machine management file; constructing a plurality of front-end business model files based on front-end business model data acquired from a back-end server; acquiring a target front-end service model file based on a plurality of front-end service model files; adding monitorable attribute data to the target front-end service model file, and then inputting the data to the public state machine management file for state information monitoring to obtain real-time state information; and managing the JS state based on the real-time state information. It can be seen that, according to the method disclosed by the application, by constructing a public state machine management file, unified data management is performed on a plurality of front-end service model files, and because the public state machine management file and the plurality of front-end service model files both have the monitorable attribute, in practical application, real-time monitoring is performed on the plurality of front-end service model files. And because the public state machine management file carries out unified data management on a plurality of front-end service model files, the situation that each front-end service model file respectively processes and manages own data information in the prior art can be avoided, and the method is complicated and easy to make mistakes when the data is called. Furthermore, in the technical scheme, each front-end service model file has only processing authority on own data information and has no management authority on the public state machine management file, so that the phenomenon of abuse is avoided. And finally, after the public state machine management file is constructed, the monitoring attribute data is added to the target front-end service model file, and then the state information is input into the public state machine management file for monitoring state information, so that the management operation on the JavaScript single page state is carried out, the management operation convenience of the JavaScript single page is effectively improved, the monitoring attribute data of the tag page is configured, after the interactive management operation is carried out on the tag page, the monitoring information of the tag page can be monitored and cached in real time, the JavaScript single page operation can be conveniently and rapidly loaded and continuously operated after the interruption, and therefore, the public state machine management file, the front-end service model file and the target service assembly are integrally formed, and can be directly fetched in the subsequent use without reconstruction.
Drawings
FIG. 1 is a schematic diagram of an electronic device architecture of a hardware operating environment according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for JS state management provided by an embodiment of the present application;
fig. 3 is a schematic functional block diagram of a JS status management device provided by an embodiment of the present application;
wherein 1001-processor, 1002-communication bus, 1003-user interface, 1004-network interface, 1005-memory.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The main solutions of the embodiments of the present application are: the method, the device, the equipment and the medium for JS state management are provided, and are used for a front-end platform to manage files by constructing a public state machine; constructing a plurality of front-end business model files based on front-end business model data acquired from a back-end server; acquiring a target front-end service model file based on a plurality of front-end service model files; adding monitorable attribute data to the target front-end service model file, and then inputting the data to the public state machine management file for state information monitoring to obtain real-time state information; and managing the JS state based on the real-time state information.
With the development of internet technology, the front end has evolved from a static web page to a dynamic web page. JavaScript single-page application development is increasingly complex, and JavaScript needs to manage more interface states so that the current webpage display is more and more rich, such as animation, games, drawing and the like. So the requirements on the front end are also increasing, especially in recent years the frames, technologies, tools are evolving in bursts. However, in the prior art, management of the front-end item is limited to showing the item content based on the tree structure, and because the content in the hierarchical structure is in a parallel state, the content is complicated and redundant, which is not beneficial to viewing and managing the front-end item content, and therefore, efficient management of multiple interfaces is not possible.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device in a hardware running environment according to an embodiment of the present application.
As shown in fig. 1, the electronic device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the structure shown in fig. 1 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and an electronic program may be included in the memory 1005 as one type of storage medium.
In the electronic device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the electronic device of the present invention may be provided in the electronic device, where the electronic device invokes the JS status management device stored in the memory 1005 through the processor 1001, and executes the method for JS status management provided in the embodiment of the present application.
Referring to fig. 2, an embodiment of the present application provides a method for JS status management, for a front-end platform, including the following steps:
and S10, constructing a public state machine management file.
In the embodiment of the application, JS is abbreviated as JavaScript, and JavaScript is a language with very much asynchronous operation, namely dynamic scripting. At present, a common method of JavaScript language in practical application is to specify a callback function, but the method can cause the problems of disordered code structure, difficult test, error and the like. The data processing and the data distribution are managed separately, namely the data processing is processed in the front-end service model, and the public state machine management file is responsible for distributing the data, so that the technical defects of structural confusion, difficult extraction and the like caused by the fact that the data processing and the data distribution are completed in the front-end service model in the prior art are avoided. When the front-end business is triggered by a certain event, the changed data are transferred to the public state machine management file through the component, and the page is re-rendered based on the changed data. It should be noted that, the front-end platform refers to a presentation layer such as a web page, an application program, or a client.
Therefore, in practical application, in order to facilitate when front-end service changes, the components and the public module can acquire corresponding data so as to re-render tag pages and the like, and the public state machine management file disclosed by the application comprises an observable state machine file, so that the state of the public state machine management file can be monitored at any time. It should be noted that, the common state machine management file is a common module content, and in the subsequent application, no matter how the front-end service increases or decreases, the common state machine management file does not need to be reconstructed.
Step S20, constructing a plurality of front-end service model files based on front-end service model data acquired from a rear-end server; and acquiring a target front-end business model file based on a plurality of front-end business model files.
The back-end server refers to a medium for storing and processing basic attribute data of the front-end service, such as a running server of a PC end. The basic attribute data of the front-end service comprises: at least one of user data, behavior data, and merchandise data. In practical application, the front-end service model is a model responsible for service logic and data processing, namely, data processing is performed after an event transmitted by a control center (controller) is received, and a public state machine management file is notified to perform synchronous update, and the public state machine management file transmits the event to the control center and view when triggering, so that the view performs update rendering on the content presented by the page after receiving an update notification.
In a specific application, the constructing a plurality of front-end service model files in step S20 includes: acquiring front-end service data; wherein, the front-end business data comprises basic attribute data of the front-end business; constructing a front-end service model based on the front-end service data; and constructing a front-end business model file based on the front-end business model. It should be noted that, the front-end service model is obtained by constructing based on basic attribute data of the front-end service, where the basic attribute data of the front-end service refers to data such as user data, behavior data, commodity data, etc.; and outputting a corresponding front-end service model file through the front-end service model.
In a specific application, step S20 of obtaining the target front-end service model file based on the plurality of front-end service model files includes: mapping a plurality of front-end service model files with a plurality of service components; and selecting a front-end service model file with a mapping relation with the target service component as a target front-end service model file based on the target service component. It should be noted that, a component includes a plurality of front-end service model files, and when in actual application, a target front-end service model file can be selected based on actual requirements, namely, by acquiring a plurality of service components; classifying a plurality of service components according to service types to obtain target service components; and acquiring a target front-end service model file based on the target service component. The method comprises the steps of selecting a target service component based on a service target, and acquiring a corresponding target front-end service model file from a rear-end server based on the requirement of the target service component.
It should be noted that, the status information of the target service component (i.e., the target tag page) includes, but is not limited to, running, dormant, suspended running, and closed and cached. When the state information of the target service component is changed, if an emergency occurs in the normal operation process of the target label page, the state of dormancy, operation suspension, temporary closing and the like is changed.
It should be noted that, the service component refers to a system or a functional module that can independently operate to construct an enterprise. In colloquial terms, a business component is a collection of closely related set of work items that need to be completed to achieve a particular goal. Such as presentation pages, e.g., tab pages, web pages, etc., that are built based on specific business objectives. And therefore, a mapping relation exists between the front-end business model file and the business component. I.e. after determining the presentation page, the required trigger button (i.e. front-end business model file) is selected according to the requirements.
And step S30, adding the monitorable attribute data to the target front-end service model file, and inputting the data to the public state machine management file for state information monitoring to obtain real-time state information.
It should be noted that, the monitorable attribute data is added to the target front-end service model file, so that the target front-end service model file can be monitored and input into the public state machine management file for state information monitoring, so that the public state machine management file can obtain the latest state information, and the page is re-rendered based on the changed data, thereby achieving the purpose of monitoring the JavaScript language state in real time.
In practical applications, the steps may include: adding monitorable attribute data to a preset node in the target front-end service model file to obtain a monitorable target front-end service model file; wherein the preset node is more than or equal to 1; and inputting the monitorable target front-end business model file into the public state machine management file to monitor state information, and obtaining real-time state information. It should be noted that the preset nodes may be set according to actual requirements, and at least one preset node is set. The method for adding the preset node is not an important point of the present application, and may be operated according to a conventional technical means in the art, and will not be described herein.
And step S40, managing the JS state based on the real-time state information.
It should be noted that, in practical application, the public state machine management file manages the JS state based on the real-time state information, that is, updates the rendering of the UI interface by the acquired real-time state information.
In general, the methods described in the embodiments of the present application may be summarized as:
in the first step, a node data model file (element node model) is created defining one or more nodes whose observable attributes (selected element$) have been selected.
Second, a common state machine management file (useObservalbleState) is created
Third, introduce useObservableState, elementNodelModel in the ActionWrapper component and listen for changes in selectedelement$
Fourth, triggering the select Ele method anywhere will cause the data of the third step to be updated and the UI re-rendered.
The prior art approach to managing JS states is typically through reduce (which refers to the state container of JavaScript applications that provides predictable state management), i.e., there is a central store that holds the entire state of the application, and each component can access the stored state without having to send tips (component properties) from one component to another. However, when the JS state is managed by adopting the technology, actions (which are bridges between user requests and service logics, each Action serves as a service agent of a client), a reducer (i.e. a plurality of values or possible side effects on the values) returns a value after compression processing, middleware and the like need to be configured, and in practical application, the use process is very complicated; and all front-end business data are hung together, so that confusion is easy to occur in actual use, and abuse is easy to occur in actual use because each component can be accessed.
Compared with the prior art, the JS state management method is used for a front-end platform and comprises the following steps: constructing a public state machine management file; constructing a plurality of front-end business model files based on front-end business model data acquired from a back-end server; acquiring a target front-end service model file based on a plurality of front-end service model files; adding monitorable attribute data to the target front-end service model file, and then inputting the data to the public state machine management file for state information monitoring to obtain real-time state information; and managing the JS state based on the real-time state information. It can be seen that, according to the method disclosed by the application, by constructing a public state machine management file, unified data management is performed on a plurality of front-end service model files, and because the public state machine management file and the plurality of front-end service model files both have the monitorable attribute, in practical application, real-time monitoring is performed on the plurality of front-end service model files. And because the public state machine management file carries out unified data management on a plurality of front-end service model files, the situation that each front-end service model file respectively processes and manages own data information in the prior art can be avoided, and the method is complicated and easy to make mistakes when the data is called. Furthermore, in the technical scheme, each front-end service model file has only processing authority on own data information and has no management authority on the public state machine management file, so that the phenomenon of abuse is avoided. And finally, after the public state machine management file is constructed, the monitoring attribute data is added to the target front-end service model file, and then the state information is input into the public state machine management file for monitoring state information, so that the management operation on the JavaScript single page state is carried out, the management operation convenience of the JavaScript single page is effectively improved, the monitoring attribute data of the tag page is configured, after the interactive management operation is carried out on the tag page, the monitoring information of the tag page can be monitored and cached in real time, the JavaScript single page operation can be conveniently and rapidly loaded and continuously operated after the interruption, and therefore, the public state machine management file, the front-end service model file and the target service assembly are integrally formed, and can be directly fetched in the subsequent use without reconstruction.
Based on the same inventive concept, as shown in fig. 3, the embodiment of the present application further proposes: a JS status management device, comprising:
the public state machine module is used for constructing a public state machine management file;
the business service module is used for constructing a plurality of front-end business model files based on the front-end business model data acquired from the rear-end server; acquiring a target front-end service model file based on a plurality of front-end service model files;
the monitoring module is used for adding the monitorable attribute data to the target front-end service model file, and inputting the monitorable attribute data to the public state machine management file to monitor state information so as to obtain real-time state information;
and the management module is used for managing the JS state based on the real-time state information.
It should be noted that, each module in the JS status management device in this embodiment corresponds to each step in the method for JS status management in the foregoing embodiment, so the specific implementation of this embodiment may refer to the implementation of the foregoing method for JS status management, and will not be described herein.
Furthermore, in one embodiment, embodiments of the present application also provide a computer program product that, when executed by a processor, implements the aforementioned method.
Furthermore, in an embodiment, the embodiments of the present application further provide a computer storage medium, on which a computer program is stored, which when being executed by a processor, implements the steps of the method in the previous embodiments.
In some embodiments, the computer readable storage medium may be FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; but may be a variety of devices including one or any combination of the above memories. The computer may be a variety of computing devices including smart terminals and servers.
In some embodiments, the executable instructions may be in the form of programs, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and they may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
As an example, the executable instructions may, but need not, correspond to files in a file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a hypertext markup language (HTML, hyper Text Markup Language) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices located at one site or, alternatively, distributed across multiple sites and interconnected by a communication network.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
From the above description of embodiments, it will be clear to a person skilled in the art that the above embodiment method may be implemented by means of software plus a necessary general hardware platform, but may of course also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. read-only memory/random-access memory, magnetic disk, optical disk), comprising several instructions for causing a multimedia terminal device (which may be a mobile phone, a computer, a television receiver, or a network device, etc.) to perform the method described in the embodiments of the present application.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.

Claims (11)

1. A method for JS status management, characterized by comprising the steps of:
constructing a public state machine management file;
constructing a plurality of front-end business model files based on front-end business model data acquired from a back-end server; acquiring a target front-end service model file based on a plurality of front-end service model files;
adding monitorable attribute data to the target front-end service model file, and then inputting the data to the public state machine management file for state information monitoring to obtain real-time state information;
and managing the JS state based on the real-time state information.
2. The method for JS state management as set forth in claim 1, wherein said adding the monitorable attribute data to the target front-end service model file, and then inputting the data to the common state machine management file for state information monitoring, obtains real-time state information, includes:
adding monitorable attribute data to a preset node in the target front-end service model file to obtain a monitorable target front-end service model file; wherein the preset node is more than or equal to 1;
and inputting the monitorable target front-end business model file into the public state machine management file to monitor state information, and obtaining real-time state information.
3. The method for JS status management as defined in claim 1, wherein said managing JS status based on said real-time status information includes:
based on the real-time state information, the JS state is managed to update rendering of the UI interface.
4. The method for JS status management as set forth in claim 1, wherein said obtaining a target front-end business model file based on a plurality of said front-end business model files includes:
mapping a plurality of front-end service model files with a plurality of service components; and selecting a front-end service model file with a mapping relation with the target service component as a target front-end service model file based on the target service component.
5. The JS state management method of claim 4, wherein the obtaining a target front-end business model file based on a target business component includes:
acquiring a plurality of service components;
classifying a plurality of service components according to service types to obtain target service components;
and acquiring a target front-end service model file based on the target service component.
6. The method for JS status management as defined in claim 1, wherein said constructing a number of front-end business model files includes:
acquiring front-end service data; wherein, the front-end business data comprises basic attribute data of the front-end business;
constructing a front-end service model based on the front-end service data;
and constructing a front-end business model file based on the front-end business model.
7. The JS state management method of claim 6, wherein the basic attribute data of the front-end service includes: at least one of user data, behavior data, and merchandise data.
8. The JS state management method of claim 1, wherein the back-end server is configured to store and process basic attribute data of front-end traffic.
9. A JS status management device, characterized by comprising:
the public state machine module is used for constructing a public state machine management file;
the business service module is used for constructing a plurality of front-end business model files based on the front-end business model data acquired from the rear-end server; acquiring a target front-end service model file based on a plurality of front-end service model files;
the monitoring module is used for adding the monitorable attribute data to the target front-end service model file, and inputting the monitorable attribute data to the public state machine management file to monitor state information so as to obtain real-time state information;
and the management module is used for managing the JS state based on the real-time state information.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor executes the computer program to implement the JS state management method of any one of claims 1-8.
11. A computer-readable storage medium having stored thereon a computer program, the processor executing the computer program to implement the JS state management method of any one of claims 1-8.
CN202310267836.7A 2023-03-20 2023-03-20 JS state management method, device, equipment and medium Active CN116009935B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310267836.7A CN116009935B (en) 2023-03-20 2023-03-20 JS state management method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310267836.7A CN116009935B (en) 2023-03-20 2023-03-20 JS state management method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN116009935A true CN116009935A (en) 2023-04-25
CN116009935B CN116009935B (en) 2023-06-27

Family

ID=86033864

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310267836.7A Active CN116009935B (en) 2023-03-20 2023-03-20 JS state management method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN116009935B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8645489B1 (en) * 2008-10-30 2014-02-04 Adobe Systems Incorporated Systems and methods for the developing content and applications in hosted and non-hosted development environments
CN109933477A (en) * 2019-03-25 2019-06-25 北京六行君通信息科技股份有限公司 Verifying automatic answering telephone set device people should answer art logic matching accuracy device
CN112379653A (en) * 2020-12-01 2021-02-19 国能信控互联技术有限公司 Smart power plant management and control system based on micro-service architecture
CN113704058A (en) * 2021-08-05 2021-11-26 北京百度网讯科技有限公司 Business model monitoring method and device and electronic equipment
CN113835737A (en) * 2021-08-24 2021-12-24 交控科技股份有限公司 Method and system for adding authority to front-end project
CN115375134A (en) * 2022-08-19 2022-11-22 平安国际融资租赁有限公司 Service processing method and system based on state machine

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8645489B1 (en) * 2008-10-30 2014-02-04 Adobe Systems Incorporated Systems and methods for the developing content and applications in hosted and non-hosted development environments
CN109933477A (en) * 2019-03-25 2019-06-25 北京六行君通信息科技股份有限公司 Verifying automatic answering telephone set device people should answer art logic matching accuracy device
CN112379653A (en) * 2020-12-01 2021-02-19 国能信控互联技术有限公司 Smart power plant management and control system based on micro-service architecture
CN113704058A (en) * 2021-08-05 2021-11-26 北京百度网讯科技有限公司 Business model monitoring method and device and electronic equipment
CN113835737A (en) * 2021-08-24 2021-12-24 交控科技股份有限公司 Method and system for adding authority to front-end project
CN115375134A (en) * 2022-08-19 2022-11-22 平安国际融资租赁有限公司 Service processing method and system based on state machine

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
HAOZHE ZHANG等: "A State Machine System for Insider Threat Detection", 《INTERNATIONAL WORKSHOP ON GRAPHICAL MODELS FOR SECURITY》, pages 111 - 129 *
WENYU7980: "状态机实战-监听", Retrieved from the Internet <URL:《https://www.jianshu.com/p/75ca23800020》> *
王佳 等: "矿用卡车无人驾驶车载决策系统", 《控制与信息技术》, pages 9 - 16 *
秦子实: "企业内网环境中基于Mock.js的前端应用独立调试方法", 《电脑知识与技术》, pages 54 - 56 *

Also Published As

Publication number Publication date
CN116009935B (en) 2023-06-27

Similar Documents

Publication Publication Date Title
US20220067268A1 (en) Systems and methods for remote dashboard image generation
CN110717121B (en) Method and device for determining first screen time of page
US20110022943A1 (en) Document object model (dom) application framework
US20140344670A1 (en) Method and system for on-demand delivery of predefined in-context web content
CN110990736A (en) Page loading method and device, terminal equipment and storage medium
US9626197B1 (en) User interface rendering performance
CN112035186A (en) Preloading and jumping method, device, equipment and medium of H5 page
US20110302285A1 (en) Update server to update rendered content
CN105100203B (en) Show the method and terminal of monitoring data
CN110750244B (en) Code synchronization method and device, electronic equipment and storage medium
US20130124971A1 (en) Real time web script refresh using asynchronous polling without full web page reload
CN115309470A (en) Method, device and equipment for loading widgets and storage medium
CN116009935B (en) JS state management method, device, equipment and medium
US20170262550A1 (en) Caching of a site model in a hierarchical modeling system for network sites
CN112631564A (en) Content management system-based interface generation method, device, equipment and storage medium
CN116821533A (en) Page rendering method, computer device and computer-readable storage medium
CN116776030A (en) Gray release method, device, computer equipment and storage medium
CN111880789A (en) Page rendering method, device, server and computer-readable storage medium
CN109309874B (en) Focus updating method and device
CN111158685A (en) Static page updating method and device, electronic equipment and storage medium
CN108572900B (en) Blank pit position monitoring method, system, electronic equipment and storage medium
CN114547523A (en) Method, device, equipment and storage medium for performing activity navigation in live broadcast room
CN115421693A (en) Method and device for realizing micro front-end architecture, computer equipment and storage medium
CN110244948B (en) Method for switching button states based on programming language and electronic equipment
WO2004006132A1 (en) Web page graphical user interface

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