Code Generation Method, Device, Equipment and Storage Medium Based on Graphic Design

By generating page resource data and target prototype pages based on graphic design, creating users associated with resource data, and generating resource access codes, the problem of repeated manual operations in the RBAC system is solved, and automated resource data generation and permission management is realized, improving development efficiency and consistency.

CN114237576BActive Publication Date: 2025-07-22DIGITAL GUANGDONG NETWORK CONSTR CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111598272.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2025-07-22
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

In the prior art, there are a lot of repetitive manual operations and inefficiency problems in the code development process of RBAC system, especially in the implementation of permission management functions. Frequent updates of page prototype design lead to frequent updates of front-end and back-end development work, wasting human resources.

Method used

By generating page resource data and target prototype pages based on graphic design, a second user associated with page resource data is created, and resource access code is generated based on the identity data of the second user, automatic resource data generation and user creation are realized, and access permission management functions are automatically completed.

Benefits of technology

It realizes automated resource data generation, avoids duplicate manual operations, saves manual resources during code development, improves automation level and efficiency, ensures consistency between resource data and front-end page elements, and does not need to manually initialize data and configure role permissions after iteration and update of the prototype design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114237576B_ABST
    Figure CN114237576B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses a code generation method, device, equipment and storage medium based on graphic design. Among them, the method includes: generating page resource data and a target prototype page according to the graphic design operation of a first user; creating a second user associated with all the page resource data to obtain first identity data of the second user; generating a resource access code according to the first identity data; wherein, the resource access code is used to obtain relevant page resource data according to the first identity data and render page elements corresponding to the page resource data in the target prototype page. The embodiment of the present invention can save human resources in the code development process and improve the automation level and efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technologies, and in particular, to a method, apparatus, device, and storage medium for generating resource access codes based on graphic design. Background Art

[0002] Currently, most information systems include a permission management function. Among them, RBAC (Role-Based Access Control) is a commonly used method for designing permission management systems. It can abstract the objects that can be operated in the system as resources, and grant the operation permissions of the resources to roles. Then, the user permissions are managed by assigning different roles to users.

[0003] In the prior art, implementing an RBAC system generally requires the following steps: UI designers design page elements such as menus and buttons in the page according to requirements, and design a system page prototype, including a front-end page and a permission management page; front-end developers write menus, buttons, etc. as front-end page elements according to the page prototype design; back-end developers take all the menus, buttons, etc. in the page as resource objects according to the page prototype design, and enter definition data such as the resource names and URLs (Uniform Resource Locators) of the resource objects into the database; then, front-end developers obtain the definition data of the resource objects from the database and correspond the URLs to the elements such as menus and buttons in the front-end code.

[0004] However, the above steps include a large amount of repetitive work. Especially for the implementation of the permission management function, similar code development work exists in almost all information systems. Moreover, the page prototype design is frequently updated in the early stage, which will cause the work of front-end development and back-end development to be updated frequently and repeatedly. In addition, the initialization of resource data in the system also includes a large amount of cumbersome manual operations. The above situations all lead to waste of human resources and reduced efficiency in the code development process. Summary of the Invention

[0005] The embodiments of the present invention provide a method, apparatus, device, and storage medium for generating resource access codes based on graphic design, so as to save human resources in the code development process and improve the automation level and efficiency.

[0006] In a first aspect, the embodiments of the present invention provide a method for generating resource access codes based on graphic design, including:

[0007] Generating page resource data and a target prototype page according to the graphic design operation of a first user;

[0008] Create a second user associated with all the page resource data to obtain the first identity data of the second user;

[0009] Generate a resource access code based on the first identity data;

[0010] Among them, the resource access code is used to obtain the relevant page resource data according to the first identity data and render the page elements corresponding to the page resource data in the target prototype page.

[0011] In a second aspect, an embodiment of the present invention further provides a resource access code generation device based on graphic design, including:

[0012] A resource generation module, configured to generate page resource data and a target prototype page according to the graphic design operation of a first user;

[0013] A user creation module, configured to create a second user associated with all the page resource data to obtain the first identity data of the second user;

[0014] A code generation module, configured to generate a resource access code based on the first identity data;

[0015] Among them, the resource access code is used to obtain the relevant page resource data according to the first identity data and render the page elements corresponding to the page resource data in the target prototype page.

[0016] In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:

[0017] One or more processors;

[0018] A storage device, configured to store one or more programs;

[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the resource access code generation method based on graphic design provided by any embodiment of the present invention.

[0020] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the resource access code generation method based on graphic design provided by any embodiment of the present invention.

[0021] In the embodiment of the present invention, page resource data and a target prototype page are generated according to the graphic design operation of the first user, and a second user associated with all the page resource data is created. A resource access code is generated according to the first identity data of the second user, so that the resource access code can obtain relevant page resource data according to the first identity data and render page elements corresponding to the page resource data in the target prototype page, realizing automated resource data generation and user creation, and automatically completing the code development of the access permission management function for resource data based on the user identity, avoiding a large amount of repetitive work based on manual operations in the prior art, saving human resources in the code development process, and improving the automation level and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a flowchart of a method for generating a resource access code based on graphic design provided in Embodiment 1 of the present invention.

[0023] Figure 2 It is a flowchart of a method for generating a resource access code based on graphic design provided in Embodiment 2 of the present invention.

[0024] Figure 3 It is a schematic structural diagram of a device for generating a resource access code based on graphic design provided in Embodiment 3 of the present invention.

[0025] Figure 4 It is a schematic structural diagram of a computer device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0026] The present invention will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention.

[0027] In addition, it should be noted that, for the sake of convenience of description, only parts related to the present invention are shown in the drawings rather than all the content. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operations are completed, but there can also be additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0028] Embodiment 1

[0029] Figure 1The following is a flowchart of a method for generating resource access codes based on graphic design provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of developing codes for the function of managing access permissions to page resources. This method can be executed by a device for generating resource access codes based on graphic design provided in the embodiments of the present invention. This device can be implemented in software and / or hardware, and is generally integrated in a computer device. Correspondingly, as Figure 1 shown, the method includes the following operations:

[0030] S110. Generate page resource data and a target prototype page according to the graphic design operation of a first user.

[0031] Among them, the first user can be a user who conducts page prototype design. The graphic design operation can be an operation for the user to conduct page prototype design. The page resource data can be data representing the page resources that can be accessed determined by the page prototype design of the first user. The target prototype page can be the page prototype determined by the page prototype design of the first user.

[0032] Correspondingly, the first user can conduct graphic design operations in the provided page area according to needs, which can include page layout operations of adding page elements at any position in the page to determine each element and its position in the finally generated page. According to the graphic design operation of the first user, the page resources that can be accessed can be determined, such as menus, buttons on function pages, etc., so as to generate page resource data according to all resources. At the same time, according to the graphic design operation of the first user, the page prototype required by the user can also be determined to generate a target prototype page.

[0033] S120. Create a second user having an association relationship with all the page resource data, and obtain first identity data of the second user.

[0034] Among them, the association relationship can be a relationship indicating that the user has access permission to the page resource data. The second user can be a user who has access permission to all the page resource data. The first identity data can be data that uniquely identifies the second user.

[0035] Correspondingly, based on the rules of permission management, different users have different access permissions to the page resource data. When a user accesses a page, the page resource data can be selectively provided according to the user's permissions. Further, a second user can be created to obtain the page resource access permissions of the user. Then the second user needs to have access permissions to all page resource data. Specifically, the second user can be created and the association relationship between the second user and all page resource data can be established to grant permissions to the second user, so that the second user has access permissions to all page resource data. The access permissions to all page resource data can be managed in the identity of an administrator. The created second user has the first identity data. Then, based on the first identity data, the second user can be determined, and thus the access permissions to all page resource data required by the administrator can be obtained.

[0036] S130. Generate a resource access code according to the first identity data.

[0037] Among them, the resource access code can be used to obtain the relevant page resource data according to the first identity data and render the page elements corresponding to the page resource data in the target prototype page. Correspondingly, a resource access code can be generated according to the first identity data, so that the resource access code can obtain the page resource data according to the permissions of the second user, that is, it can include all page resource data related to the first identity data, so that the automatic acquisition and rendering of all page resource data can be completed. Then the resource access code can be embedded in the code of any information system. When the system code runs, based on the first identity data, the access permissions of the administrator to all page resource data can be automatically obtained in the identity of the second user, so as to obtain all page resource data and render the corresponding page elements in the target prototype page, and complete the function of managing the access permissions of the resource data in the system on the basis of realizing the system function.

[0038] The embodiment of the present invention provides a method for generating a resource access code based on graphic design. By generating page resource data and a target prototype page according to the graphic design operation of the first user, creating a second user having an association relationship with all page resource data, and generating a resource access code according to the first identity data of the second user, the resource access code can realize the function of obtaining relevant page resource data according to the first identity data and rendering the page elements corresponding to the page resource data in the target prototype page, realizing the automatic generation of resource data and user creation, and automatically completing the code development of the function of managing the access permissions for resource data based on the user identity, avoiding a large amount of repetitive work based on manual operations in the prior art, saving human resources in the code development process, and improving the automation level and efficiency.

[0039] Embodiment 2

[0040] Figure 2 The flowchart of a method for generating resource access codes based on graphic design provided in the second embodiment of the present invention. The embodiments of the present invention are specific implementations based on the above embodiments. In the embodiments of the present invention, specific optional implementation manners for generating page resource data and a target prototype page according to the graphic design operations of the first user are given.

[0041] As Figure 2 shown, the method of the embodiments of the present invention specifically includes:

[0042] S210. Generate page resource data and a target prototype page according to the graphic design operations of the first user.

[0043] In an optional embodiment of the present invention, S210 may specifically include:

[0044] S211. Generate target structure data according to the graphic design operations of the first user; the target prototype page is stored in the target structure data.

[0045] Among them, the target structure data may be data of page resources generated by recording the graphic design operations of the user in a specific structure.

[0046] Correspondingly, according to the graphic design operations of the first user, the page resources created by the first user through the graphic design operations may be recorded in the target structure data in a specific structure. At the same time, the target prototype page based on the page prototype design of the user may also be determined according to the graphic design operations of the first user and stored in the corresponding structure position of the target structure data.

[0047] In an optional embodiment of the present invention, the generating of the target structure data according to the graphic design operations of the first user may include: generating main structure data according to the project creation operation of the first user; generating first sub-structure data in the main structure data according to the non-leaf element creation operation of the first user; generating a foreground prototype page in the first sub-structure data according to the leaf element creation operation of the first user; generating second sub-structure data in the main structure data according to the layout submission operation of the first user, generating a management prototype page in the second sub-structure data, and determining the main structure data as the target structure data.

[0048] Among them, the project creation operation can be an operation to create a page prototype design project to start page prototype design. The main structure data can be data that records all resource data in page prototype design. The non-leaf element creation operation can be an operation to add intermediate-level non-leaf elements in page prototype design. The non-leaf elements have associated subordinate elements. For example, it can be a non-leaf menu associated with a subordinate menu. The first sub-structure data can be data that records the foreground prototype page resources corresponding to the leaf elements associated with the non-leaf elements. The leaf element creation operation can be an operation to add the lowest-level leaf elements in page prototype design. The leaf elements do not have associated subordinate elements. For example, it can be a leaf menu without a subordinate menu. The foreground prototype page can be a page prototype corresponding to the leaf element, which is selectively provided to the user according to the user's permissions. The layout submission operation can be an operation for the user to complete the page prototype design and submit the page prototype design result. The second sub-structure data can be data that records the management prototype page resources. The management prototype page can be a page prototype used to provide to the user who performs the access permission management operation of the resource data for permission management.

[0049] Correspondingly, when the user starts page prototype design, a new project can be created through the project creation operation. Then, the main structure data can be generated according to the project creation operation of the first user to record the data in the page prototype design project. The first user can add one or more non-leaf elements in the page prototype design. Then, according to the non-leaf element creation operation of the first user, the first sub-structure data can be generated in the main structure data. Specifically, any main structure data can include one or more first sub-structure data, or can include one or more levels of first sub-structure data. For example, under any non-leaf element, the first user can, according to needs, add multiple levels of non-leaf elements in sequence before adding leaf elements. Then, each non-leaf element creation operation generates the corresponding-level first sub-structure data. The first user can add one or more leaf elements for any non-leaf element. Then, the corresponding foreground prototype page can be generated in the first sub-structure data corresponding to the upper-level non-leaf element associated with the leaf element.

[0050] Furthermore, when the first user completes all page prototype designs, the layout submission operation can be performed. According to the layout submission operation of the first user, the second sub-structure data can be automatically generated in the main structure data, and the management prototype page can be generated in the second sub-structure data. Since the page elements required in the management prototype page are the same, generating the management prototype page automatically after the user completes the design of the foreground prototype page according to the layout submission operation can avoid the user from repeatedly designing the same management prototype page in the page prototype design for different systems. After all the foreground prototype pages and management prototype pages are generated in the main structure file, the main structure data can be determined as the target structure data.

[0051] Optionally, the management prototype page may include a role management prototype page, a resource management prototype page, and a role authorization prototype page. Among them, the role management prototype page may be a prototype of the role management page, and the role management page may be used to add, modify, or delete roles for accessing resources; the resource management prototype page may be a prototype of the resource management page, and the resource management page is used to add, modify, or delete accessible resources; the role authorization prototype page may be a prototype of the role authorization page, and the role authorization page may be used to configure the access permissions of different roles to resources.

[0052] Exemplarily, by providing an interactive page, a prototype designer can design the menu of the prototype and the buttons on the function page by dragging on the interactive page. Specifically, non-leaf menus can have multiple levels, and leaf menus are associated with function pages. When a designer creates a prototype project on the interactive page, a main directory of a front-end project can be automatically created on the disk. When a designer adds a non-leaf menu on the interactive page, a corresponding sub-directory can be automatically created under the main directory on the disk. When a designer adds a leaf menu on the interactive page, a front-end prototype page can be automatically created under its upper-level menu directory on the disk. When the designer finishes the prototype design and clicks to submit, a system management sub-directory can be automatically created under the project root directory, and a role management prototype page, a resource management prototype page, and a role authorization prototype page can be created.

[0053] S212. Generate resource identification data according to the target structure data, and store the resource identification data in a resource database to obtain the page resource data.

[0054] Among them, the resource identification data may be data used to respectively represent each page resource. The resource database may be a database used to store page resource data.

[0055] Correspondingly, according to the page resources recorded in the target structure data, the resource identification data of each page resource can be respectively generated, and the resource identification data is stored in the resource database as the page resource data. Optionally, the resource identification data may be the URI (Uniform Resource Identifier) of the page resource.

[0056] Exemplarily, in the above example of creating a main directory of a front-end project for the prototype project, when the designer finishes the prototype design, clicks to submit, and completes the creation of the system management sub-directory, the directory structure of the front-end project on the disk can be scanned, and the corresponding URI of each leaf menu resource can be automatically generated and saved in a preset database as the page resource data.

[0057] S220. Create a second user associated with all the page resource data, and obtain the first identity data of the second user.

[0058] In an optional embodiment of the present invention, the step of creating a second user associated with all the page resource data and obtaining the first identity data of the second user may include: creating a role permission data table, and storing all the page resource data into the role permission data table; generating target user data and target role data in the role permission data table to create a target user and a target role; generating identity association data between the target user and the target role, and permission association data between the target role and all the page resource data in the role permission data table, so as to determine the target user as the second user and the target user data as the first identity data.

[0059] Among them, the role permission data table may be a data table for recording objects to be managed in permission management. The target user data may be data for describing the target user. The target role data may be data for describing the target role. The target user may be a specific user created. The target role may be a specific role created. The identity association data may be data describing the association relationship between the target user and the target role, and can endow the target user with the identity of the target role. The permission association data may be data describing the association relationship between the target role and the page resource data, and can grant the target role the permission to access the page resource data.

[0060] Correspondingly, a role permission data table can be created for the users to be managed according to the rules of permission management. Then it can be determined that all the page resource data are the resources to be managed in permission management, and all the page resource data can be stored into the role permission data table. Similarly, target user data and target role data can also be generated in the role permission data table, so as to create a target user and a target role. Then both the target user and the target role can be used as objects of permission management, so as to manage the role of the target user and the permissions of the target role. Further, by generating identity association data between the target user and the target role in the role permission data table to endow the target user with the target role, and generating permission association data between the target role and all the page resource data to grant the target role the permission to access all the page resource data, the target user can obtain the permission to access all the page resource data in the identity of the target role, and can be determined as the second user, and its target user data can be correspondingly determined as the first identity data uniquely identifying the second user.

[0061] Optionally, a role permission data table can be created based on RBAC rules, which can specifically include a user table, a role table, a resource table, a user-role association table, and a role-resource association table. Among them, the user table is used to manage the users accessing the system, the role table can be used to manage the roles in the system, the resource table is used to manage the page resources in the system, the user-role association table is used to manage the association relationship between users and roles and assign roles to users, and the role-resource association table is used to manage the association relationship between roles and resources and configure the permissions for roles to access page resources.

[0062] Exemplarily, database tables can be automatically created according to the design specifications of RBAC, including a user table, a role table, a resource table, a user-role association table, and a role-resource association table. A default user user1 is automatically created in the user table, a default role admin is created in the role table, and the association relationship between user1 and admin is automatically created and recorded in the user-role association table. At the same time, all URIs can be read from the database storing all page resource data, saved in the resource table, and all URIs in the resource table are automatically associated with the role admin and recorded in the role-resource association table.

[0063] S230. Generate a resource access code according to the first identity data.

[0064] Among them, the resource access code is used to obtain the relevant page resource data according to the first identity data and render the page elements corresponding to the page resource data in the target prototype page.

[0065] In an optional embodiment of the present invention, the generating a resource access code according to the first identity data may include: creating a first access interface and a second access interface of the target prototype page for the role permission data table.

[0066] Among them, the first access interface can be used to obtain the page resource data having an association relationship with the user identity data in the role permission data table according to the user identity data passed in by the target prototype page; the second access interface can be used to obtain all the page resource data in the role permission data table according to the interface call data passed in by the target prototype page.

[0067] Specifically, the first access interface and the second access interface can be interfaces called through the front-end page. The user identity data can be the data describing the user identity passed in from the target prototype page. The interface call data can be the data for calling the interface passed in from the target prototype page. Optionally, the first access interface and the second access interface can be defined in the target prototype page to provide an entry for passing in data to call the interface, and the specific function codes of the first access interface and the second access interface can be written in the code to implement the creation of the first access interface and the second access interface of the target prototype page.

[0068] Correspondingly, the target prototype page can pass in the user identity data to the first access interface, so that the first access interface can implement the function of querying and returning the page resource data associated with the passed-in user identity data in the role permission data table. The target prototype page can also pass in the interface call data to the second access interface, and the second access interface can implement the function of returning all the page resource data in the role permission data table.

[0069] Exemplarily, in the example of creating the main directory of the front-end project in the above prototype project, after generating the target prototype page, a standard interface A can be defined by default to obtain the set of leaf menu resource URIs associated with the user ID (Identifier), and a standard interface B can be defined by default to obtain the set of all leaf menu resource URIs. Further, interfaces A and B can be implemented in the back-end development.

[0070] In an optional embodiment of the present invention, the generating the resource access code according to the first identity data may further include: generating a first interface call code according to the first identity data; generating a first interface data rendering code.

[0071] Among them, the first interface call code is used to pass the first identity data into the first access interface. The first interface data rendering code is used to obtain the page resource data fed back by the first access interface and render it on the foreground prototype page to generate the target foreground page. The target foreground page can be designed based on the page prototype of the first user and is selectively provided to the second user according to the user permissions to provide resources to the users who access it.

[0072] Correspondingly, a first interface call code can be generated according to the first identity data, so that the first interface call code can implement the function of passing the first identity data into the first access interface. A first interface data rendering code can also be generated, which can implement the function of obtaining the page resource data returned by the first access interface and rendering it to the foreground prototype page. Therefore, the resource access code includes the first interface call code and the first interface data rendering code. Running the resource access code can implement obtaining the page resource data according to the permissions of the second user and rendering all the obtained page resource data to the foreground prototype page, and a target foreground page can be generated.

[0073] In an alternative embodiment of the present invention, generating the resource access code according to the first identity data may further include: generating a second interface call code and a second interface data rendering code.

[0074] Among them, the second interface call code is used to pass the interface call data into the second access interface. The second interface data rendering code is used to obtain the page resource data fed back by the second access interface and render it in the management prototype page to generate a target management page. The target management page can be a page provided to a user who performs the access permission management operation of the resource data for permission management.

[0075] Correspondingly, a second interface call code and a second interface data rendering code can be generated. If the resource access code includes the second interface call code and the second interface data rendering code, running the resource access code can implement obtaining all the page resource data and rendering all the obtained page resource data to the management prototype page, and a target management page for managing all the page resource data can be generated.

[0076] Exemplarily, in the above example of creating the main directory of the front-end project for the prototype project, after defining and implementing interfaces A and B, based on the target prototype page of the front-end development, the generated code content may include calling interface A, passing the user ID of the default user user1 into interface A to obtain the entire menu resource set associated with its associated default role admin, and rendering the menu on the foreground page according to the returned data to replace the static content of the original prototype page. The generated code content may also include calling interface B to obtain the set of all menu resources, and rendering the role management prototype page, resource management prototype page, and role authorization prototype page in the system management subdirectory of the front-end project according to the returned data object to replace the original static content therein, obtaining the role management page, resource management page, and role authorization page that can be provided to user1 for permission management.

[0077] An embodiment of the present invention provides a method for generating a resource access code based on graphic design. By generating page resource data and a target prototype page according to the graphic design operations of a first user, and creating a second user associated with all the page resource data, and generating a resource access code according to the first identity data of the second user, so that the resource access code can obtain relevant page resource data according to the first identity data and render page elements corresponding to the page resource data in the target prototype page, realizing automated resource data generation and user creation, and automatically completing the code development of the access permission management function for resource data based on the user identity, avoiding a large amount of repetitive work based on manual operations in the prior art, saving human resources in the code development process, and improving the automation level and efficiency; further, realizing automated resource data generation based on data of the target structure, avoiding manual entry or update later, ensuring the consistency between the resource data and the front-end page elements, and enabling the generated front-end and back-end code to log in with the default user during operation, so that even after the prototype design is iteratively updated, there is no need to manually initialize the data and configure the role permissions.

[0078] Embodiment III

[0079] Figure 3 FIG. is a schematic structural diagram of a resource access code generation device provided in Embodiment III of the present invention, as Figure 3 shown, the device includes: a resource generation module 310, a user creation module 320, and a code generation module 330.

[0080] Among them, the resource generation module 310 is configured to generate page resource data and a target prototype page according to the graphic design operations of a first user.

[0081] The user creation module 320 is configured to create a second user associated with all the page resource data to obtain the first identity data of the second user.

[0082] The code generation module 330 is configured to generate a resource access code according to the first identity data.

[0083] Among them, the resource access code is used to obtain relevant page resource data according to the first identity data and render page elements corresponding to the page resource data in the target prototype page.

[0084] In an alternative implementation manner of the embodiment of the present invention, the resource generation module 310 may include: a structure data generation sub-module, configured to generate target structure data according to the graphic design operation of the first user; the target prototype page is stored in the target structure data; an identification data generation sub-module, configured to generate resource identification data according to the target structure data, and store the resource identification data in a resource database to obtain the page resource data.

[0085] In an alternative implementation manner of the embodiment of the present invention, the structure data generation sub-module may specifically be configured to: generate main structure data according to the project creation operation of the first user; generate first sub-structure data in the main structure data according to the non-leaf element creation operation of the first user; generate a foreground prototype page in the first sub-structure data according to the leaf element creation operation of the first user; generate second sub-structure data in the main structure data according to the layout submission operation of the first user, generate a management prototype page in the second sub-structure data, and determine the main structure data as the target structure data.

[0086] In an alternative implementation manner of the embodiment of the present invention, the user creation module 320 may specifically be configured to: create a role permission data table, and store all the page resource data in the role permission data table; generate target user data and target role data in the role permission data table to create a target user and a target role; generate identity association data between the target user and the target role, and permission association data between the target role and all the page resource data in the role permission data table, so as to determine the target user as the second user and the target user data as the first identity data.

[0087] In an alternative implementation manner of the embodiment of the present invention, the code generation module 330 may specifically be configured to: create a first access interface and a second access interface of the target prototype page to the role permission data table; wherein, the first access interface is used to obtain the page resource data associated with the user identity data in the role permission data table according to the user identity data passed in by the target prototype page; the second access interface is used to obtain all the page resource data in the role permission data table according to the interface call data passed in by the target prototype page.

[0088] In an alternative embodiment of the embodiment of the present invention, the code generation module 330 may specifically be configured to: generate a first interface call code according to the first identity data; the first interface call code is used to pass the first identity data into the first access interface; generate a first interface data rendering code; the first interface data rendering code is used to obtain the page resource data fed back by the first access interface and render it on the foreground prototype page to generate a target foreground page.

[0089] In an alternative embodiment of the embodiment of the present invention, the code generation module 330 may specifically be configured to: generate a second interface call code and a second interface data rendering code; wherein, the second interface call code is used to pass the interface call data into the second access interface; the second interface data rendering code is used to obtain the page resource data fed back by the second access interface and render it in the management prototype page to generate a target management page.

[0090] The above device can execute the code generation method provided in any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.

[0091] The embodiment of the present invention provides a resource access code generation device based on graphic design. By generating page resource data and a target prototype page according to the graphic design operation of the first user, creating a second user having an associated relationship with all the page resource data, and generating a resource access code according to the first identity data of the second user, the resource access code can be enabled to obtain relevant page resource data according to the first identity data and render the page elements corresponding to the page resource data in the target prototype page, realizing automated resource data generation and user creation, and automatically completing the code development for the access permission management function of the resource data based on the user identity, avoiding a large amount of repetitive work based on manual operations in the prior art, saving human resources in the code development process, and improving the automation level and efficiency.

[0092] Embodiment 4

[0093] Figure 4 It is a schematic structural diagram of a computer device provided for Embodiment 4 of the present invention. Figure 4 It shows a block diagram of an exemplary computer device 12 suitable for implementing the embodiment of the present invention. Figure 4 The shown computer device 12 is only an example and should not bring any limitation to the functions and usage scope of the embodiment of the present invention.

[0094] As Figure 4As shown, the computer device 12 is presented in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors 16, a memory 28, and a bus 18 that connects different system components (including the memory 28 and the processor 16).

[0095] The bus 18 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus structures. By way of example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0096] The computer device 12 typically includes a variety of computer system-readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0097] The memory 28 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 34 can be used for reading and writing on non-removable, non-volatile magnetic media ( Figure 4 not shown, typically referred to as a "hard disk drive"). Although Figure 4 not shown in the figure, a disk drive for reading and writing on removable non-volatile disks (such as a "floppy disk"), and an optical disk drive for reading and writing on removable non-volatile optical disks (such as CD-ROM, DVD-ROM, or other optical media) can be provided. In these cases, each drive can be connected to the bus 18 through one or more data media interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0098] A program / utility 40 having a set (at least one) of program modules 42 can be stored, for example, in the memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods described in the embodiments of the present invention.

[0099] The computer device 12 can also communicate with one or more external devices 14 (such as keyboards, pointing devices, monitors 24, etc.), and can also communicate with one or more devices that enable users to interact with the computer device 12, and / or communicate with any device that enables the computer device 12 to communicate with one or more other computing devices (such as network cards, modems, etc.). Such communication can be carried out through the input / output (I / O) interface 22. Moreover, the computer device 12 can also communicate with one or more networks (such as local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through the network adapter 20. As shown in the figure, the network adapter 20 communicates with other modules of the computer device 12 through the bus 18. It should be understood that although Figure 4 not shown in the figure, other hardware and / or software modules can be used in combination with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0100] The processor 16 executes various functional applications and data processing by running the program stored in the memory 28, so as to implement the method for generating resource access codes based on graphic design provided by the embodiments of the present invention: generating page resource data and a target prototype page according to the graphic design operation of a first user; creating a second user associated with all the page resource data to obtain first identity data of the second user; generating a resource access code according to the first identity data; wherein, the resource access code is used to obtain the relevant page resource data according to the first identity data and render page elements corresponding to the page resource data in the target prototype page.

[0101] Embodiment Five

[0102] Embodiment Five of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the method for generating resource access codes based on graphic design provided by the embodiments of the present invention: generating page resource data and a target prototype page according to the graphic design operation of a first user; creating a second user associated with all the page resource data to obtain first identity data of the second user; generating a resource access code according to the first identity data; wherein, the resource access code is used to obtain the relevant page resource data according to the first identity data and render page elements corresponding to the page resource data in the target prototype page.

[0103] Any combination of one or more computer-readable media may be employed. The computer-readable media may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present document, a computer-readable storage medium may be any tangible medium that contains or stores a program which can be used by or in connection with an instruction execution system, apparatus, or device.

[0104] A computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.

[0105] The program code embodied on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0106] The computer program code for carrying out operations of the present invention may be written in one or more programming languages or combinations thereof, including object-oriented programming languages such as Java, Smalltalk, C++, as well as conventional procedural programming languages - such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or computer device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0107] Note that the above is only the preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for generating a resource access code based on graphic design, characterized in that Including: Generating page resource data and a target prototype page according to the graphic design operation of a first user; Automatically creating a second user associated with all the page resource data to obtain first identity data of the second user; Generating a resource access code according to the first identity data; Wherein, the resource access code is used to obtain the relevant page resource data according to the first identity data and render page elements corresponding to the page resource data in the target prototype page; Generating target structure data according to the graphic design operation of the first user; the target prototype page is stored in the target structure data; The generating target structure data according to the graphic design operation of the first user includes: Generating main structure data according to the project creation operation of the first user; Generating first sub-structure data in the main structure data according to the non-leaf element creation operation of the first user; generating a foreground prototype page in the first sub-structure data according to the leaf element creation operation of the first user; generating second sub-structure data in the main structure data according to the layout submission operation of the first user, generating a management prototype page in the second sub-structure data, and determining the main structure data as the target structure data.

2. The method according to claim 1, characterized in that, The generating page resource data and a target prototype page according to the graphic design operation of a first user further includes: Generating resource identification data according to the target structure data and storing the resource identification data in a resource database to obtain the page resource data.

3. The method according to claim 1, characterized in that, The creating a second user associated with all the page resource data to obtain first identity data of the second user includes: Creating a role permission data table and storing all the page resource data in the role permission data table; Generating target user data and target role data in the role permission data table to create a target user and a target role; Generating identity association data between the target user and the target role and permission association data between the target role and all the page resource data in the role permission data table to determine the target user as the second user and the target user data as the first identity data.

4. The method according to claim 3, wherein The generating a resource access code according to the first identity data includes: Creating a first access interface and a second access interface of the target prototype page to the role permission data table; Wherein, the first access interface is used to obtain the page resource data associated with the user identity data in the role permission data table according to the user identity data passed in by the target prototype page; The second access interface is used to obtain all the page resource data in the role permission data table according to the interface call data passed in by the target prototype page.

5. The method according to claim 4, characterized in that, The generating a resource access code according to the first identity data further includes: Generating a first interface call code according to the first identity data; the first interface call code is used to pass the first identity data into the first access interface; Generate the first interface data rendering code; the first interface data rendering code is used to obtain the page resource data fed back by the first access interface and render it on the foreground prototype page to generate a target foreground page.

6. The method according to claim 4, wherein The generating the resource access code according to the first identity data further includes: Generate a second interface call code and a second interface data rendering code; Wherein, the second interface call code is used to pass the interface call data into the second access interface; The second interface data rendering code is used to obtain the page resource data fed back by the second access interface and render it in the management prototype page to generate a target management page.

7. A resource access code generation device based on graphic design, characterized in that, It includes: A resource generation module, configured to generate page resource data and a target prototype page according to the graphic design operations of a first user; A user creation module, configured to automatically create a second user associated with all the page resource data to obtain the first identity data of the second user; A code generation module, configured to generate a resource access code according to the first identity data; Wherein, the resource access code is used to obtain the relevant page resource data according to the first identity data and render the page elements corresponding to the page resource data in the target prototype page; The resource generation module includes: a structure data generation sub-module, configured to generate target structure data according to the graphic design operations of the first user; the target structure data stores the target prototype page; Specifically, the structure data generation sub-module is configured to: generate main structure data according to the project creation operation of the first user; generate first sub-structure data in the main structure data according to the non-leaf element creation operation of the first user; generate a foreground prototype page in the first sub-structure data according to the leaf element creation operation of the first user; generate second sub-structure data in the main structure data according to the layout submission operation of the first user, generate a management prototype page in the second sub-structure data, and determine the main structure data as the target structure data.

8. A computer device, characterized in that, The computer device includes: One or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the graphic design-based resource access code generation method according to any one of claims 1-6.

9. A computer storage medium, on which a computer program is stored, characterized in that, When the program is executed by the processor, it implements the graphic design-based resource access code generation method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Low-code application software development system and method

    CN110825362A