CN113590120A - State manager generation method and device, electronic equipment and storage medium - Google Patents

State manager generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113590120A
CN113590120A CN202110872776.2A CN202110872776A CN113590120A CN 113590120 A CN113590120 A CN 113590120A CN 202110872776 A CN202110872776 A CN 202110872776A CN 113590120 A CN113590120 A CN 113590120A
Authority
CN
China
Prior art keywords
interface
target
user
generating
field
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.)
Pending
Application number
CN202110872776.2A
Other languages
Chinese (zh)
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.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju Network 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 Beijing Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Priority to CN202110872776.2A priority Critical patent/CN113590120A/en
Publication of CN113590120A publication Critical patent/CN113590120A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The present disclosure provides a method and an apparatus for generating a state manager, an electronic device, and a storage medium, wherein the method for generating the state manager includes: acquiring an interface description language file, and acquiring interface information from the interface description language file; the interface information comprises an interface name, an interface description and return field information; generating a target interaction page according to the interface information, wherein the target interaction page is used for a user to select a target interface; responding to the selection operation of the user on the target interaction page, and determining a target interface and a target return field selected by the user; and generating a state manager according to the target interface and the target return field. In the embodiment of the disclosure, the state manager code can be automatically generated, and compared with a handwritten code, the development cost is reduced.

Description

State manager generation method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a state manager, an electronic device, and a storage medium.
Background
The front end is basically developed by using a modular and responsive framework, such as Vue and a reach framework. Componentization refers to splitting an application into multiple independent and fully functional components, and a complete component usually includes a UI (User Interface) portion and a logic portion; the response type means that the UI part of the front-end application is rendered according to the state of the logic part, and when the state of the logic part changes, the UI part automatically changes correspondingly.
When the application is relatively simple, state management is done independently by the components, i.e. defining states, usage states and change states within the components. When applications are complex, cross-component communication problems arise, requiring the use of a state manager. However, since the state manager contains many repetitive codes, handwriting is required to complete, increasing development costs. In addition, in the handwriting process, the concept of the state manager needs to be understood, and the understanding cost is increased.
Disclosure of Invention
The embodiment of the disclosure at least provides a state manager generation method and device, electronic equipment and a computer-readable storage medium.
In a first aspect, an embodiment of the present disclosure provides a method for generating a state manager, including:
acquiring an interface description language file, and acquiring interface information from the interface description language file; the interface information comprises an interface name, an interface description and return field information;
generating a target interaction page according to the interface information, wherein the target interaction page is used for a user to select a target interface;
responding to the selection operation of the user on the target interaction page, and determining a target interface and a target return field selected by the user;
and generating a state manager according to the target interface and the target return field.
In the embodiment of the disclosure, the state manager can be automatically generated according to the generation method of the state manager, and compared with a handwritten code, the development cost is reduced. In addition, the embodiment of the disclosure can generate a complete state manager, so that the state manager can be used under the condition that a user does not completely understand details of the state manager, the understanding cost is reduced, and the development experience of the user is improved.
In a possible implementation manner, the obtaining an interface description language file and obtaining interface information from the interface description language file according to the first aspect includes:
acquiring the content of an interface description language file according to a pre-configured interface description language file path;
analyzing the interface description language file content to obtain an abstract syntax tree;
and traversing the abstract syntax tree to acquire the interface information.
In the embodiment of the disclosure, the information in the interface description language file can be more conveniently acquired through the abstract syntax tree, and the efficiency of acquiring the interface information is improved.
According to the first aspect, in a possible implementation manner, the type of the interface description language file is a structure type, and the return field information includes a field sequence number, a field name, and a field type.
According to the first aspect, in a possible implementation manner, the generating a target interaction page according to the interface information includes:
starting a hypertext transfer protocol webpage service;
and responding to the operation of accessing a target browser by the user, and rendering and generating the target interaction page based on the interface information, wherein the target browser corresponds to the webpage service.
According to a first aspect, in one possible implementation, the target interaction page includes an interface list portion, a return field portion, and a submit portion; the interface list portion includes a plurality of interface items for selection by the user, the interface items including the interface name; the return field part is used for displaying a return field corresponding to the target interface item selected by the user; the submission part is used for responding to the submission request of the user to generate a submission instruction;
the step of determining the target interface and the target return field selected by the user in response to the selection operation of the user on the target interaction page comprises the following steps:
selecting a target interface from a plurality of interfaces in response to the user selecting operation for the interface list part;
responding to the selection operation of the user for the return field part, and selecting a target return field from a plurality of fields corresponding to the target interface;
responding to the triggering operation of the user on the submission part, and generating a submission instruction;
and closing the webpage service according to the submission instruction, and determining the target interface and the target return field.
In a possible implementation form, according to the first aspect, the return field section is developed in a tree-like manner, and the return field section includes a plurality of field entries, each field entry including a field name and a field description.
In a possible implementation manner, according to the first aspect, the generating a state manager according to the target interface and the target return field includes:
generating the state of the state manager according to the target return field, wherein the name of the state is the name of the target return field;
and generating an instruction and a side effect of the state manager according to the target interface and the target return field, wherein the name of the instruction and the name of the side effect are the names of the target interface.
In a second aspect, an embodiment of the present disclosure provides a state manager generating apparatus, including:
the acquisition module is used for acquiring an interface description language file and acquiring interface information from the interface description language file; the interface information comprises an interface name, an interface description and return field information;
the first generation module is used for generating a target interaction page according to the interface information, and the target interaction page is used for a user to select a target interface;
the determining module is used for responding to the selection operation of the user on the target interaction page and determining a target interface and a target return field selected by the user;
and the second generation module is used for generating a state manager according to the target interface and the target return field.
According to the second aspect, in a possible implementation manner, the obtaining module is specifically configured to:
acquiring the content of an interface description language file according to a pre-configured interface description language file path;
analyzing the interface description language file content to obtain an abstract syntax tree;
and traversing the abstract syntax tree to acquire the interface information.
According to the second aspect, in a possible implementation manner, the type of the interface description language file is a structure type, and the return field information includes a field sequence number, a field name, and a field type.
According to the second aspect, in a possible implementation, the first generation module is specifically configured to:
starting a hypertext transfer protocol webpage service;
and responding to the operation of accessing a target browser by the user, and rendering and generating the target interaction page based on the interface information, wherein the target browser corresponds to the webpage service.
According to a second aspect, in one possible implementation, the target interaction page includes an interface list portion, a return field portion, and a submit portion; the interface list portion includes a plurality of interface items for selection by the user, the interface items including the interface name; the return field part is used for displaying a return field corresponding to the target interface item selected by the user; the submission part is used for responding to the submission request of the user to generate a submission instruction; the determining module is specifically configured to:
the step of determining the target interface and the target return field selected by the user in response to the selection operation of the user on the target interaction page comprises the following steps:
selecting a target interface from a plurality of interfaces in response to the user selecting operation for the interface list part;
responding to the selection operation of the user for the return field part, and selecting a target return field from a plurality of fields corresponding to the target interface;
responding to the triggering operation of the user on the submission part, and generating a submission instruction;
and closing the webpage service according to the submission instruction, and determining the target interface and the target return field.
According to a second aspect, in one possible implementation, the return field section is developed in a tree-like manner, the return field section comprising a plurality of field entries, each field entry comprising a field name and a field description.
According to the second aspect, in a possible implementation manner, the second generating module is specifically configured to:
generating the state of the state manager according to the target return field, wherein the name of the state is the name of the target return field;
and generating an instruction and a side effect of the state manager according to the target interface and the target return field, wherein the name of the instruction and the name of the side effect are the names of the target interface.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is running, the machine-readable instructions when executed by the processor performing the steps of the method of generating a state manager according to the first aspect.
In a fourth aspect, the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, performs the steps of the method for generating a state manager according to the first aspect.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly described below, and the drawings herein incorporated in and forming a part of the specification illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It is appreciated that the following drawings depict only certain embodiments of the disclosure and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.
Fig. 1 illustrates an exemplary architecture diagram of a generation method of a state manager provided by an embodiment of the present disclosure;
FIG. 2 is a flow chart illustrating a method for generating a state manager according to an embodiment of the disclosure;
FIG. 3 is a flowchart illustrating a method for obtaining interface information from an interface description language file according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating a method for generating a target interaction page according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram illustrating a target interaction page provided by an embodiment of the present disclosure;
FIG. 6 is a flowchart illustrating a method for determining a target interface and a target return field selected by a user according to an embodiment of the present disclosure;
FIG. 7 is a flowchart illustrating a method for generating a state manager according to a target interface and a target return field according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of another target interaction page provided by embodiments of the present disclosure;
fig. 9 is a schematic structural diagram of a generating apparatus of a state manager provided in an embodiment of the present disclosure;
fig. 10 shows a schematic diagram of an electronic device provided by an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The term "and/or" herein merely describes an associative relationship, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
The front end is basically developed by using a modular and responsive framework, such as Vue and a reach framework. Componentization refers to the splitting of an application into multiple independent and fully functional components, a complete component usually comprising a UI (User Interface) part and a logic part. The response type means that the UI part of the front-end application is rendered according to the state of the logic part, and when the state of the logic part changes, the UI part automatically changes correspondingly.
When the application is relatively simple, state management is done independently by the components, i.e. defining states, usage states and change states within the components. When applications are complex, cross-component communication problems arise, requiring the use of a state manager. State managers typically use centralized management and unidirectional data flow to solve the state management problem. The centralized management refers to uniformly defining and managing the states of all the components; unidirectional data flow means that the change of state is unidirectional.
The State manager generally includes three parts, State (State), instruction (Action), and side Effect (Effect). The state can only be changed by instructions and side effects include the function of requesting the server interface and calling instructions to change state.
Research shows that although state maintenance becomes clear and standard, the existing state manager contains many repetitive codes and needs to be completed by handwriting, which increases development cost. In addition, in the handwriting process, the concept of the state manager needs to be understood, and the understanding cost is increased.
Based on the research, the present disclosure provides a method for generating a state manager, which obtains an interface description language file, and obtains interface information from the interface description language file; the interface information comprises an interface name, an interface description and return field information; generating a target interaction page according to the interface information, wherein the target interaction page is used for a user to select a target interface; responding to the selection operation of the user on the target interaction page, and determining a target interface and a target return field selected by the user; and generating a state manager according to the target interface and the target return field. Therefore, the state manager can be automatically generated through the interface description language file, the manual development process is avoided, the development cost is saved, and the understanding cost of developers is reduced.
The following describes the present application in detail with reference to a specific system application architecture.
Referring to fig. 1, fig. 1 illustrates an exemplary system architecture that may be applied to the state manager generation method of the present application. As shown in fig. 1, the system architecture 100 may include electronic devices 10, 20, a network 30, and a server 40. The network 30 serves as a medium for providing a communication link between the electronic devices 10, 20 and the server 40. Network 30 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the electronic devices 10, 20 to interact with the server 40 over the network 30 to receive or send messages or the like. Various client applications, such as browsers, etc., may be installed on the electronic devices 10, 20. The electronic devices 10, 20 may be a variety of electronic devices having a display screen and a processor including, but not limited to, laptop portable computers, desktop computers, and the like.
The server 40 may be a server that provides various services, such as a server that provides support for a browser application displayed on the electronic device 10, 20. The server 40 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud storage, big data, an artificial intelligence platform, and the like.
The method for generating the state manager provided in the embodiment of the present application is generally executed by the electronic devices 10 and 20, and may be executed by the server 40, which is not limited herein. In some possible implementations, the state manager generation method may be implemented by a processor calling computer-readable instructions stored in a memory.
Referring to fig. 2, which is a flowchart illustrating a method for generating a state manager according to an embodiment of the present disclosure, the method for generating a state manager illustrated in fig. 2 includes the following steps S101 to S104:
s101, acquiring an interface description language file and acquiring interface information from the interface description language file; the interface information comprises an interface name, an interface description and return field information.
Wherein IDL is an interface description language independent of the programming language. The IDL enables a simple, clear and complete description of the interface. The IDL is independent of programming language, and can be converted into various programming languages through a certain mapping relation.
It will be appreciated that constructing the state manager requires mainly both interface and state information. The Interface information may be obtained from an Interface Description Language (IDL) file. The state information is typically obtained from fields in the interface return type and needs to be selected by the developer as needed.
The types of IDLs can be classified into simple types and structural body types. Simple types include strings, numbers, and the like. The structure type comprises a plurality of fields, and each field comprises a field sequence number, a field name and a field type. In this embodiment, the type of the IDL is a structure type, and the return field information includes a field number, a field name, and a field type.
In some embodiments, referring to fig. 3, for step S101, when acquiring an interface description language file and acquiring interface information from the interface description language file, the following S1011 to S1013 may be included:
and S1011, acquiring the interface description language file content according to a preset interface description language file path.
And S1012, analyzing the interface description language file content to obtain an abstract syntax tree.
And S1013, traversing the abstract syntax tree to acquire the interface information.
Illustratively, the IDL file content may be obtained according to a specified IDL file path, and then the IDL file content may be parsed with an AST parser to obtain an AST, traversing the AST acquisition interface information.
Wherein, the Abstract Syntax Tree (AST) is an Abstract representation of the Syntax structure of the source code. With AST, information in the source code can be acquired more conveniently. For example, type information in the IDL file is obtained.
In other embodiments, a preset parsing function stack may be further used to parse the IDL file to obtain the AST. The preset parsing function stack is composed of one or more parsing functions, each parsing function can parse the grammar rules in the IDL file, and the parsing functions can be written in advance according to the grammar rules of the IDL file. In order to parse the IDL file, parsing functions for parsing various syntax rules in the IDL file can be written in advance, so that at least one parsing function exists in a parsing function stack for one of the syntax rules, and the syntax structure can be parsed.
And S102, generating a target interaction page according to the interface information, wherein the target interaction page is used for a user to select a target interface.
It can be understood that after the interface information is obtained, a target interaction page can be generated according to the interface information, and then a target interface and a target return field selected by a user are determined according to the selection operation of the user on the target interaction page.
In some embodiments, referring to fig. 4, for S102, generating the target interaction page according to the interface information may include the following S1021 to S1022:
s1021, starting the webpage service of the hypertext transfer protocol.
S1022, responding to the operation of accessing a target browser by the user, and rendering and generating the target interaction page based on the interface information, wherein the target browser corresponds to the web service.
Illustratively, a local hypertext Transfer Protocol (HTTP) application service may be started, and then, in response to an operation of a user to access a target browser, a request is sent to a server of the HTTP application service to obtain interface information, and then, the target interaction page is generated based on the obtained interface information through rendering.
Referring to fig. 5, a schematic diagram of a target interaction page provided by an embodiment of the present disclosure is shown in fig. 5, where the target interaction page includes an interface list part a, a return field part B, and a submit part C. The interface list part a includes a plurality of interface items a1 for the user to select, i.e., interface list part a is a list containing a plurality of interface items a1, interface item a1 may be selected. Wherein each interface item A1 includes an interface name A11, an interface specification A12, and an interface check box A13.
The return field part B is used for displaying the return field corresponding to the target interface item selected by the user. For example, after the GetUserInfo interface entry is selected, the return field section B presents a return field corresponding to the GetUserInfo interface, and the return field section may be expanded in a tree form. The return field section includes a plurality of field entries, each field entry including a field name B1 and a field description B2 and a field check box B3. When the type of the expanded field is a structure, the expanded field item further includes an expansion/contraction button B4, and the field item of the structure can be expanded/contracted by clicking the expansion/contraction button B4.
The submission part C is used for responding to the submission request of the user to generate a submission instruction. Specifically, the submit section C includes a submit button, and clicking the submit button can generate a submit command, i.e., confirm the selected target interface (e.g., GetUserInfo) and the target return field (e.g., explicit: string).
S103, responding to the selection operation of the user on the target interaction page, and determining the target interface and the target return field selected by the user.
It can be understood that, after the target interaction page is generated, the user can perform a selection operation on the content displayed by the target interaction page, and finally determine the target interface and the target return field selected by the user. In some embodiments, referring to fig. 6, when determining the target interface and the target return field selected by the user in response to the selection operation of the user on the target interaction page, the following S1031 to S1034 may be included:
and S1031, responding to the user selection operation aiming at the interface list part, and selecting a target interface from a plurality of interfaces.
S1032, responding to the selection operation of the user aiming at the return field part, and selecting a target return field from the plurality of fields corresponding to the target interface.
S1033, responding to the triggering operation of the user to the submitting part, and generating a submitting instruction.
S1034, according to the submission instruction, closing the webpage service and determining the target interface and the target return field.
Illustratively, after the user selects the target interface and the target return field, and clicks the submit button, a request (i.e., a submit instruction) is sent to the server of the HTTP application service, and the server closes the HTTP application service after receiving the request and returns the target interface and the target return field selected by the user.
Wherein, the HTTP application service core code example:
Figure BDA0003189346560000121
Figure BDA0003189346560000131
and S104, generating a state manager according to the target interface and the target return field.
Illustratively, after obtaining the target interface and the target return field, it is determined that the above-mentioned configuration state manager mainly needs two kinds of information, namely, interface and state, and therefore, the state manager may be generated according to the target interface and the target return field.
Specifically, referring to fig. 7, when generating a state manager according to the target interface and the target return field, the following steps S1041 to S1042 may be included:
s1041, generating the state of the state manager according to the target return field, wherein the name of the state is the name of the target return field.
Illustratively, the state of the state manager may be generated according to the selected target return field, the name of the state being the name of the target return field, and the initial value of the state being the default value of the type of the target return field.
And S1042, generating an instruction and a side effect of the state manager according to the target interface and the target return field, wherein the name of the instruction and the name of the side effect are the names of the target interface.
Illustratively, the instructions of the state manager are generated according to the selected target interface and the target return field. The name of the instruction is the name of the target interface; the load of the instruction is a target return field; the corresponding state is updated with the load in the functional body of the instruction. In addition, a side effect of the state manager is generated based on the selected target interface and the target return field. The name of the side effect is the name of the target interface; and requesting an interface in a function body of the side effect, acquiring a specified field of the return data, and using the specified field as a load call instruction.
Wherein, semi-automatically generating a state manager process key node example:
1. provided IDL file
Figure BDA0003189346560000141
Figure BDA0003189346560000151
Figure BDA0003189346560000161
In the embodiment of the disclosure, the state manager can be automatically generated according to the generation method of the state manager, and compared with a handwritten code, the development cost is reduced. In addition, the embodiment of the disclosure can generate a complete state manager, so that the state manager can be used under the condition that a user does not completely understand details of the state manager, the understanding cost is reduced, and the development experience of the user is improved.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Based on the same technical concept, the embodiment of the present disclosure further provides a device for generating a state manager corresponding to the method for generating a state manager, and since the principle of solving the problem of the device in the embodiment of the present disclosure is similar to the method for generating a state manager in the embodiment of the present disclosure, the method may be used for implementing the device, and repeated details are not described again.
Referring to fig. 9, there is a schematic diagram of a state manager generating device 500 provided in an embodiment of the present disclosure, where the state manager generating device includes:
an obtaining module 501, configured to obtain an interface description language file, and obtain interface information from the interface description language file; the interface information comprises an interface name, an interface description and return field information;
a first generating module 502, configured to generate a target interaction page according to the interface information, where the target interaction page is used for a user to select a target interface;
a determining module 503, configured to determine, in response to a selection operation of a user on the target interaction page, a target interface and a target return field selected by the user;
a second generating module 504, configured to generate a state manager according to the target interface and the target return field.
In a possible implementation manner, the obtaining module 501 is specifically configured to:
acquiring the content of an interface description language file according to a pre-configured interface description language file path;
analyzing the interface description language file content to obtain an abstract syntax tree;
and traversing the abstract syntax tree to acquire the interface information.
In a possible implementation manner, the type of the interface description language file is a structure type, and the return field information includes a field sequence number, a field name, and a field type.
In a possible implementation, the first generating module 502 is specifically configured to:
starting a hypertext transfer protocol webpage service;
and responding to the operation of accessing a target browser by the user, and rendering and generating the target interaction page based on the interface information, wherein the target browser corresponds to the webpage service.
In one possible implementation, the target interaction page includes an interface list portion, a return field portion, and a submit portion; the interface list portion includes a plurality of interface items for selection by the user, the interface items including the interface name; the return field part is used for displaying a return field corresponding to the target interface item selected by the user; the submission part is used for responding to the submission request of the user to generate a submission instruction; the determining module 503 is specifically configured to:
the step of determining the target interface and the target return field selected by the user in response to the selection operation of the user on the target interaction page comprises the following steps:
selecting a target interface from a plurality of interfaces in response to the user selecting operation for the interface list part;
responding to the selection operation of the user for the return field part, and selecting a target return field from a plurality of fields corresponding to the target interface;
responding to the triggering operation of the user on the submission part, and generating a submission instruction;
and closing the webpage service according to the submission instruction, and determining the target interface and the target return field.
In one possible implementation, the return field portion is developed in a tree-like manner, and the return field portion includes a plurality of field entries, each field entry including a field name and a field description.
In a possible implementation, the second generating module 504 is specifically configured to:
generating the state of the state manager according to the target return field, wherein the name of the state is the name of the target return field;
and generating an instruction and a side effect of the state manager according to the target interface and the target return field, wherein the name of the instruction and the name of the side effect are the names of the target interface.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
Based on the same technical concept, the embodiment of the disclosure also provides an electronic device. Referring to fig. 10, a schematic structural diagram of an electronic device 700 provided in the embodiment of the present disclosure includes a processor 701, a memory 702, and a bus 703. The memory 702 is used for storing execution instructions and includes a memory 7021 and an external memory 7022; the memory 7021 is also referred to as an internal memory and temporarily stores operation data in the processor 701 and data exchanged with an external memory 7022 such as a hard disk, and the processor 701 exchanges data with the external memory 7022 via the memory 7021.
In this embodiment, the memory 702 is specifically configured to store application program codes for executing the scheme of the present application, and is controlled by the processor 701 to execute. That is, when the electronic device 700 is operated, the processor 701 and the memory 702 communicate with each other through the bus 703, so that the processor 701 executes the application program code stored in the memory 702, thereby executing the method in any of the foregoing embodiments.
The Memory 702 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
The processor 701 may be an integrated circuit chip having signal processing capabilities. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 700. In other embodiments of the present application, the electronic device 700 may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The embodiments of the present disclosure also provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the method for generating a state manager in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
The embodiments of the present disclosure also provide a computer program product, where the computer program product carries a program code, and instructions included in the program code may be used to execute steps of the method for generating a state manager in the foregoing method embodiments, which may be referred to specifically for the foregoing method embodiments, and are not described herein again.
The computer program product may be implemented by hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used for illustrating the technical solutions of the present disclosure and not for limiting the same, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive of the technical solutions described in the foregoing embodiments or equivalent technical features thereof within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (10)

1. A method for generating a state manager, comprising:
acquiring an interface description language file, and acquiring interface information from the interface description language file; the interface information comprises an interface name, an interface description and return field information;
generating a target interaction page according to the interface information, wherein the target interaction page is used for a user to select a target interface;
responding to the selection operation of the user on the target interaction page, and determining a target interface and a target return field selected by the user;
and generating a state manager according to the target interface and the target return field.
2. The method of claim 1, wherein the obtaining the interface description language file and obtaining the interface information from the interface description language file comprises:
acquiring the content of an interface description language file according to a pre-configured interface description language file path;
analyzing the interface description language file content to obtain an abstract syntax tree;
and traversing the abstract syntax tree to acquire the interface information.
3. The method according to claim 1 or 2, wherein the type of the interface description language file is a structure type, and the return field information includes a field sequence number, a field name, and a field type.
4. The method of claim 1, wherein generating a target interaction page according to the interface information comprises:
starting a hypertext transfer protocol webpage service;
and responding to the operation of accessing a target browser by the user, and rendering and generating the target interaction page based on the interface information, wherein the target browser corresponds to the webpage service.
5. The method of claim 4, wherein the target interaction page comprises an interface list portion, a return field portion, and a submit portion; the interface list portion includes a plurality of interface items for selection by the user, the interface items including the interface name; the return field part is used for displaying a return field corresponding to the target interface item selected by the user; the submission part is used for responding to the submission request of the user to generate a submission instruction;
the step of determining the target interface and the target return field selected by the user in response to the selection operation of the user on the target interaction page comprises the following steps:
selecting a target interface from a plurality of interfaces in response to the user selecting operation for the interface list part;
responding to the selection operation of the user for the return field part, and selecting a target return field from a plurality of fields corresponding to the target interface;
responding to the triggering operation of the user on the submission part, and generating a submission instruction;
and closing the webpage service according to the submission instruction, and determining the target interface and the target return field.
6. The method of claim 5, wherein the return field portion is developed in a tree-like manner, wherein the return field portion comprises a plurality of field entries, and wherein each field entry comprises a field name and a field description.
7. The method of claim 1, wherein generating a state manager from the target interface and the target return field comprises:
generating the state of the state manager according to the target return field, wherein the name of the state is the name of the target return field;
and generating an instruction and a side effect of the state manager according to the target interface and the target return field, wherein the name of the instruction and the name of the side effect are the names of the target interface.
8. An apparatus for generating a state manager, comprising:
the acquisition module is used for acquiring an interface description language file and acquiring interface information from the interface description language file; the interface information comprises an interface name, an interface description and return field information;
the first generation module is used for generating a target interaction page according to the interface information, and the target interaction page is used for a user to select a target interface;
the determining module is used for responding to the selection operation of the user on the target interaction page and determining a target interface and a target return field selected by the user;
and the second generation module is used for generating a state manager according to the target interface and the target return field.
9. An electronic device, comprising: processor, memory and bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is running, the machine-readable instructions when executed by the processor performing the steps of the method of generating a state manager according to any of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method for generating a state manager according to any one of claims 1 to 7.
CN202110872776.2A 2021-07-30 2021-07-30 State manager generation method and device, electronic equipment and storage medium Pending CN113590120A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110872776.2A CN113590120A (en) 2021-07-30 2021-07-30 State manager generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110872776.2A CN113590120A (en) 2021-07-30 2021-07-30 State manager generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113590120A true CN113590120A (en) 2021-11-02

Family

ID=78252761

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110872776.2A Pending CN113590120A (en) 2021-07-30 2021-07-30 State manager generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113590120A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070064911A1 (en) * 2001-08-14 2007-03-22 Bedingfield James C Sr Method for using ain to deliver caller ID to text/alpha-numeric pagers as well as other wireless devices, for calls delivered to landline networks
US20150350429A1 (en) * 2014-05-29 2015-12-03 Angel.Com Incorporated Custom grammars builder platform
US10482150B1 (en) * 2014-09-03 2019-11-19 State Farm Mutual Automobile Insurance Company Electronic forms interaction framework for a consistent user experience
CN111026396A (en) * 2019-12-13 2020-04-17 北京小米移动软件有限公司 Page rendering method and device, electronic equipment and storage medium
CN111638908A (en) * 2020-05-29 2020-09-08 深圳壹账通智能科技有限公司 Interface document generation method and device, electronic equipment and medium
CN112650533A (en) * 2020-12-22 2021-04-13 深圳前海微众银行股份有限公司 Interface document generation method and device and terminal equipment
CN112667224A (en) * 2021-01-12 2021-04-16 北京字节跳动网络技术有限公司 File processing method and device, computer equipment and storage medium
CN112799659A (en) * 2021-01-12 2021-05-14 杨飞 Method, device and terminal for automatically generating data interface without programming

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070064911A1 (en) * 2001-08-14 2007-03-22 Bedingfield James C Sr Method for using ain to deliver caller ID to text/alpha-numeric pagers as well as other wireless devices, for calls delivered to landline networks
US20150350429A1 (en) * 2014-05-29 2015-12-03 Angel.Com Incorporated Custom grammars builder platform
US10482150B1 (en) * 2014-09-03 2019-11-19 State Farm Mutual Automobile Insurance Company Electronic forms interaction framework for a consistent user experience
CN111026396A (en) * 2019-12-13 2020-04-17 北京小米移动软件有限公司 Page rendering method and device, electronic equipment and storage medium
CN111638908A (en) * 2020-05-29 2020-09-08 深圳壹账通智能科技有限公司 Interface document generation method and device, electronic equipment and medium
CN112650533A (en) * 2020-12-22 2021-04-13 深圳前海微众银行股份有限公司 Interface document generation method and device and terminal equipment
CN112667224A (en) * 2021-01-12 2021-04-16 北京字节跳动网络技术有限公司 File processing method and device, computer equipment and storage medium
CN112799659A (en) * 2021-01-12 2021-05-14 杨飞 Method, device and terminal for automatically generating data interface without programming

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吴湛 等: "针对FPGA 的IDL⁃Verilog 编译器的设计与实现", 《现代电子技术》, vol. 40, no. 14, pages 1 - 5 *

Similar Documents

Publication Publication Date Title
US10592319B2 (en) API notebook tool
US10839011B2 (en) Application programing interface document generator
US10942708B2 (en) Generating web API specification from online documentation
JP6327725B2 (en) System, method, and graphical user interface for workflow generation, deployment, and / or execution
JP6327723B2 (en) System, method, and graphical user interface for workflow generation, deployment, and / or execution
CN100444158C (en) Web page rendering mechanism using external programmatic themes
CN108304201B (en) Object updating method, device and equipment
CN102597993B (en) Managing application state information by means of uniform resource identifier (URI)
CA2915619C (en) Method and apparatus for customized software development kit (sdk) generation
US11537392B2 (en) Dynamic review of software updates after pull requests
EP3803628A1 (en) Language agnostic data insight handling for user application data
CN111125064A (en) Method and device for generating database mode definition statement
CN105094857B (en) Method and system for application load
CN111814449A (en) Form analysis method, device, equipment and storage medium
CN114117190A (en) Data processing method, data processing device, storage medium and electronic equipment
US11048488B2 (en) Software code optimizer and method
CN115455006A (en) Data processing method, data processing device, electronic device, and storage medium
CN113590120A (en) State manager generation method and device, electronic equipment and storage medium
CN115905274A (en) Data processing method and device, electronic equipment and medium
CN113642295B (en) Page typesetting method, device and computer program product
US20240176732A1 (en) Advanced application of model operations in energy
CN112702421B (en) File synchronization method and device, electronic equipment and storage medium
CN113590085B (en) Processing method of multi-source heterogeneous data, computer equipment and storage medium
CN112732254B (en) Webpage development method, webpage development device, computer equipment and storage medium
Metzler et al. Bachelor Thesis Computer Science

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