Project processing method and apparatus, computer device, and storage medium

By encapsulating the startup command of the Vite development server and using scaffolding tools to generate target entry files and configuration objects, the problem of adding new files and configurations in the upgrade of existing projects is solved, realizing project upgrades with zero additions and zero configurations, improving development efficiency and reducing maintenance costs.

CN115098186BActive Publication Date: 2025-12-09CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210699250.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-20
Publication Date
2025-12-09
Estimated Expiration
2042-06-20

AI Technical Summary

Technical Problem

The existing method of upgrading existing projects using the Vite development server requires the introduction of new entry files and a large amount of configuration, resulting in a heavy workload and low efficiency for developers.

Method used

The startup command of the Vite development server is encapsulated using a pre-defined scaffolding tool. The configuration file and main page file of the target project are read to generate the target entry file. The configuration object is then converted into the target configuration object corresponding to the Vite development server, avoiding the creation of new entry files and configuration files in the project root directory.

Benefits of technology

This achieved zero new additions and zero configuration during the upgrade process of integrating Vite development services into the target project, reducing the workload of developers, lowering project maintenance costs, and improving processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098186B_ABST
    Figure CN115098186B_ABST
Patent Text Reader

Abstract

The embodiment of the application belongs to the field of data processing, and relates to a project processing method, comprising the following steps: encapsulating a starting command of a vite development server based on a scaffold tool; reading a configuration file of a target project; obtaining configuration data corresponding to the vite development server and inputting the configuration data into the configuration file; converting all configuration objects in the configuration file into target configuration objects corresponding to the vite development server; reading a main page file under a specified directory of the target project, adding a specified tag reference, and generating a target entry file corresponding to the vite development server; and exporting the target configuration objects into the target entry file, and executing the starting command to start the target project. The application also provides a project processing device, a computer device and a storage medium. In addition, the application also relates to blockchain technology, and the target configuration objects can be stored in a blockchain. The project upgrading method provided by the application can reduce the development workload of developers and improve the processing efficiency of project upgrading.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a project processing method and device, a computer device and a storage medium. BACKGROUND

[0002] The mainstream front-end development tool in the industry is mainly Webpack, and the local running of the front-end project generally adopts the mode of webpack-dev-server, which will compile and package the source code and third-party dependencies together at one time when the project starts. With the increase of the project size, the startup time of this mode will increase significantly, and the time required for hot update during development will also increase, which greatly affects the efficiency of the developers. In view of this problem, the community has gradually explored the unbundle packaging mode of esbuild, swc and other tools. The most popular one at present is the vite development server, which uses the ESM file supported by the browser natively, does not need to be packaged, and only compiles and imports the file when it is used, greatly shortening the development and compilation time. The vite development server can start in seconds. However, the existing processing mode of upgrading the existing project by using the vite development server needs to introduce a new entry file and a large number of configurations, and the modification of the project is large, the development workload of the developer is large, and the processing efficiency is low. SUMMARY

[0003] The purpose of the embodiments of the present application is to provide a project processing method and device, a computer device and a storage medium, so as to solve the problem that the existing processing mode of upgrading the existing project by using the vite development server needs to introduce a new entry file and a large number of configurations, and the modification of the project is large, the development workload of the developer is large, and the processing efficiency is low.

[0004] In order to solve the above technical problems, the embodiments of the present application provide a project processing method, which adopts the following technical scheme:

[0005] The starting command of the vite development server is encapsulated based on a preset scaffolding tool;

[0006] The configuration file of the target project is read;

[0007] The preset configuration data corresponding to the vite development server is obtained, and the configuration data is transmitted into the configuration file;

[0008] All configuration objects contained in the configuration file are converted into target configuration objects corresponding to the vite development server;

[0009] reading a main page file under a specified directory of the target project, and adding a specified tag reference to the main page file to generate a target entry file corresponding to the vite development server;

[0010] exporting the target configuration object into the target entry file, and executing the start command to start the target project.

[0011] Further, after the step of exporting the target configuration object into the target entry file and executing the start command to start the target project, further comprising:

[0012] Obtaining identification information of the target project;

[0013] determining target permission configuration information corresponding to the identification information based on a preset permission data table;

[0014] Obtaining routing information of the target project;

[0015] determining a target route corresponding to the target permission configuration information from the routing information;

[0016] performing permission configuration processing on the target project based on a preset permission configuration component and a preset permission configuration code to obtain a corresponding permission target project.

[0017] Further, the step of performing permission configuration processing on the target project based on a preset permission configuration component and a preset permission configuration code to obtain a corresponding permission target project, specifically comprising:

[0018] obtaining the permission configuration component and the permission configuration code;

[0019] adding the permission configuration component to the target route of the target project to obtain a first target project;

[0020] injecting the permission configuration code into the first target project to obtain a second target project;

[0021] the second target project as the permission target project.

[0022] Further, the step of obtaining the routing information of the target project, specifically comprising:

[0023] obtaining the framework type of the target project;

[0024] obtaining the routing file of the target project based on the framework type;

[0025] obtaining the routing information of the target project based on the routing file.

[0026] Further, the step of determining the target permission configuration information corresponding to the identification information based on the preset permission data table specifically comprises:

[0027] calling the permission data table;

[0028] based on a preset parallel comparison instruction, respectively matching the identification information with each identification in the permission data table, filtering a target identification same as the identification information from the permission data table;

[0029] extracting permission configuration information corresponding to the target identification from the permission data table;

[0030] taking the permission configuration information as the target permission configuration information.

[0031] Further, after the step of performing permission configuration processing on the target project based on the preset permission configuration component and the preset permission configuration code to obtain a corresponding permission target project, the method further comprises:

[0032] obtaining importance information of the target project;

[0033] determining a storage mode corresponding to the importance information;

[0034] performing storage processing on the permission target project based on the storage mode.

[0035] Further, the step of encapsulating the start command of the vite development server based on the preset scaffold tool specifically comprises:

[0036] calling the scaffold tool;

[0037] obtaining a preset encapsulation command;

[0038] running the encapsulation command through the scaffold tool to encapsulate the start command of the vite development server.

[0039] To solve the above technical problems, the embodiment of the present application also provides a project processing device, which adopts the following technical scheme:

[0040] an encapsulation module configured to encapsulate a start command of a vite development server based on a preset scaffold tool;

[0041] a reading module configured to read a configuration file of a target project;

[0042] a first obtaining module configured to obtain preset configuration data corresponding to the vite development server and transmit the configuration data into the configuration file;

[0043] a conversion module, configured to convert all configuration objects contained in the configuration file into target configuration objects corresponding to the vite development server;

[0044] a generation module, configured to read a main page file under a specified directory of the target project, and add a specified tag reference to the main page file to generate a target entry file corresponding to the vite development server;

[0045] a starting module, configured to export the target configuration objects into the target entry file, and execute the starting command to start the target project.

[0046] To solve the above technical problems, the embodiment of the application further provides a computer device, which adopts the technical scheme as follows:

[0047] The starting command of the vite development server is encapsulated based on a preset scaffolding tool;

[0048] read a configuration file of a target project;

[0049] obtain preset configuration data corresponding to the vite development server, and transmit the configuration data into the configuration file;

[0050] convert all configuration objects contained in the configuration file into target configuration objects corresponding to the vite development server;

[0051] read a main page file under a specified directory of the target project, and add a specified tag reference to the main page file to generate a target entry file corresponding to the vite development server;

[0052] export the target configuration objects into the target entry file, and execute the starting command to start the target project.

[0053] To solve the above technical problems, the embodiment of the application further provides a computer readable storage medium, which adopts the technical scheme as follows:

[0054] The starting command of the vite development server is encapsulated based on a preset scaffolding tool;

[0055] read a configuration file of a target project;

[0056] obtain preset configuration data corresponding to the vite development server, and transmit the configuration data into the configuration file;

[0057] convert all configuration objects contained in the configuration file into target configuration objects corresponding to the vite development server;

[0058] read a main page file under a specified directory of the target project, and add a specified tag reference to the main page file to generate a target entry file corresponding to the vite development server;

[0059] export the target configuration object into the target entry file, and execute the start command to start the target project.

[0060] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0061] After the embodiments of the present application encapsulate the start command of the vite development server based on the preset scaffold tool, the configuration file of the target project is read first, and the preset configuration data corresponding to the vite development server is obtained and transmitted into the configuration file. Then, all configuration objects contained in the configuration file are converted into target configuration objects corresponding to the vite development server. After that, the main page file under the specified directory of the target project is read, and a specified tag reference is added to the main page file to generate a target entry file corresponding to the vite development server. Finally, the target configuration object is exported into the target entry file, and the start command is executed to start the target project, so as to complete the upgrading process of integrating the vite development service in the target project. By using the project upgrading method of the embodiments of the present application to upgrade the target project, the root directory of the target project can be avoided to newly create an entry file and a configuration file, the purpose of zero addition and zero configuration in the upgrading process of integrating the vite development service in the target project is achieved, the development workload of the developer is effectively reduced, the cost of project maintenance is reduced, and the processing efficiency of project upgrading is improved. BRIEF DESCRIPTION OF DRAWINGS

[0062] In order to more clearly illustrate the schemes in the present application, the drawings needed in the description of the embodiments of the present application will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0063] Figure 1 is an exemplary system architecture diagram to which the present application can be applied;

[0064] Figure 2 a flowchart of one embodiment of the project processing method according to the present application;

[0065] Figure 3 is a structural schematic diagram of one embodiment of the project processing device according to the present application;

[0066] Figure 4is a structural schematic diagram of one embodiment of the computer device according to the present application. DETAILED DESCRIPTION

[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description herein is for describing particular embodiments only and is not intended to be limiting of the application; the description herein and the claims of the application and the above description of the drawings herein are not to be construed as limiting upon the scope of the application; the description herein and the claims of the application and the above description of the drawings herein use the term "comprising" and "including" and their derivatives, which are intended to be construed as encompassing not exclusive inclusion; the description herein and the claims of the application and the above description of the drawings herein use the term "first", "second", and the like, which are used for distinguishing between similar objects, not for describing a particular sequential order.

[0068] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase that in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily mutually exclusive of one another. It is expressly understood that the embodiments described herein are merely examples from a much larger number of embodiments that can be claimed.

[0069] In order to make the technical personnel in the art better understand the scheme of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings.

[0070] As shown in Figure 1 The system architecture 100 can include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a communication link medium between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0071] A user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0072] The terminal devices 101, 102, and 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smartphones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, and the like.

[0073] The server 105 can be a server providing various services, such as a background server providing support for a page displayed on the terminal devices 101, 102, and 103.

[0074] It should be noted that the project processing method provided in the embodiments of the present application is generally executed by a server / terminal device, and accordingly, the project processing apparatus is generally arranged in a server / terminal device.

[0075] It should be understood that Figure 1 The number of terminal devices, networks, and servers in

[0076] With reference to Figure 2 , a flowchart of one embodiment of the project processing method according to the present application is shown. The project processing method includes the following steps:

[0077] In step S201, a preset scaffolding tool is used to encapsulate a starting command of a vite development server.

[0078] In the present embodiment, the electronic device (for example, the server / terminal device shown in Figure 1 ) on which the project processing method runs. It should be noted that the wireless connection mode can include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other now known or future developed wireless connection modes.

[0079] In the embodiment, Vite is a web development build tool developed by the author of Vue, Yu Rain, which is a development server based on browser native ES module import. In the development environment, the browser is used to parse import, and the server side is compiled on demand and returned, completely skipping the concept of packaging. The server is started and used at the same time. Not only does it support Vue files, but it also supports hot updates, and the speed of hot updates does not slow down with the increase of modules. In the production environment, Rollup is used for packaging. The above scaffold tool is a vue-cli tool that pre-creates the ability to encapsulate the vite development server startup project. Specifically, the preset encapsulation command of the scaffold tool can be run to encapsulate the startup command of the vite development server. The above encapsulation command is specifically the pafe-cli-service vite command. Vue-cli-service is a service command commonly used by vue-cli tools, and pafe is the project name of the target project.

[0080] Step S202, read the configuration file of the target project.

[0081] In the embodiment, the configuration file of the target project is specifically a pafe.config.js file, which is a unified configuration entry of the target project. The framework type of the target project can include Vue framework or React framework, that is, the target project belongs to Vue project or React project.

[0082] Step S203, obtain preset configuration data corresponding to the vite development server, and pass the configuration data into the configuration file.

[0083] In the embodiment, the above configuration data is the configuration required by the vite development server, which can be preset and created according to actual use requirements. By integrating the configuration data of the vite development server into the configuration file of the target project, the entry, alias, css, proxy server, loader and other commonly used webpack configurations in the configuration file can be automatically analyzed. Specifically, the above configuration data can be a vitePlugin attribute, which can pass the plugin of the vite development server into the configuration file of the target project, thereby expanding the capabilities of the target project.

[0084] Step S204, convert all configuration objects contained in the configuration file into target configuration objects corresponding to the vite development server.

[0085] In the embodiment, all configuration objects contained in the configuration file can be converted into target configuration objects corresponding to the vite development server in the form of plug-ins. Specifically, all configuration objects contained in the configuration file can be named in the manner of vite-plugin-xxx, for example, the target configuration objects generated after conversion can include vite-plugin-env-compatible, vite-plugin-importer, and the like. By integrating the vite development server into the target project in one key through the plug-in manner, the upgrade is very simple, and zero modification of the existing project code can be realized.

[0086] In step S205, a main page file under a specified directory of the target project is read, and a specified tag reference is added to the main page file to generate a target entry file corresponding to the vite development server.

[0087] In the embodiment, the specified directory is the public directory, the main page file is the index.html file, and the specified tag is the script tag. By adding the script tag reference in the index.html, the subsequent vite development server can find the corresponding target entry file by parsing the script tag. The existing Vite official document introduces a usage manner of creating an entry file and a vite.config.js configuration file in the root directory of the project, but this manner needs to introduce new files and a large amount of configuration, and also needs to make a relatively large modification to the project, which is not friendly to the upgrade of the existing project. In the embodiment, the conventional entry file under the public directory is reused, the html file of the entry is read dynamically, and the script tag reference is added to the index.html file to generate the target entry file required by the vite development server, so that the new entry file in the root directory of the target project can be avoided, the purpose of zero addition and zero configuration in the upgrade process of integrating the vite development server into the target project is realized, and the cost of project maintenance is reduced.

[0088] In step S206, the target configuration object is exported into the target entry file, and the start command is executed to start the target project.

[0089] In the embodiment, the target configuration object obtained after conversion is exported into the target entry file, so that the upgrade process of integrating the vite development server into the target project can be completed. In addition, the upgraded target project can be started by executing the start command, and the service function of the vite development server can be enabled in the running process of the upgraded target project, that is, the target project can enjoy the improvement of the development experience brought by the vite development server.

[0090] After encapsulating the starting command of the vite development server based on the preset scaffold tool, the configuration file of the target project is read, and the preset configuration data corresponding to the vite development server is obtained, and the configuration data is transmitted into the configuration file, then all configuration objects contained in the configuration file are converted into target configuration objects corresponding to the vite development server, then the main page file under the specified directory of the target project is read, and the specified tag reference is added to the main page file, the target entry file corresponding to the vite development server is generated, finally the target configuration object is exported into the target entry file, and the starting command is executed to start the target project, so as to complete the upgrading process of integrating the vite development service in the target project. By using the project upgrading method of the application, the root directory of the target project can be avoided to create an entry file and a configuration file, the purpose of zero new and zero configuration in the upgrading process of integrating the vite development service in the target project is achieved, the development workload of the developer is effectively reduced, the cost of project maintenance is reduced, and the processing efficiency of project upgrading is improved.

[0091] In some optional implementations, after step S206, the electronic device can further perform the following steps:

[0092] Obtain identification information of the target project.

[0093] In this embodiment, the identification information can include the project name of the target project.

[0094] Determine target permission configuration information corresponding to the identification information based on a preset permission data table.

[0095] In this embodiment, the permission data table is a data table for counting permission information of a project, which is created in advance according to actual needs. The permission data table stores project name information of multiple projects and permission configuration information corresponding to each project name information. The permission configuration information is information for managing specific permissions in each project, which is determined by a user in advance.

[0096] Obtain routing information of the target project.

[0097] In this embodiment, the process of obtaining the routing information of the target project can include: first obtaining the framework type of the target project; then obtaining the routing file of the target project based on the framework type; and subsequently obtaining the routing information of the target project based on the routing file.

[0098] Determine a target route corresponding to the target permission configuration information from the routing information.

[0099] In the embodiment, the target route corresponds to a related route in the route information which needs to be subjected to permission management.

[0100] The target project is subjected to permission configuration processing based on the preset permission configuration component and the preset permission configuration code, to obtain a corresponding permission target project.

[0101] In the embodiment, the permission configuration component can be a component for specifically performing permission management on a project, and the permission configuration component can be stored in a pre-generated permission configuration file. By adding a high-order component to a route in which permission needs to be added, the permission of the entire project route can be managed. The permission configuration code can be a custom permission code added according to actual needs, and the custom control permission can be obtained by adding the permission configuration code to the target project. For a basic front-end project, the target project with a permission management function can be obtained by automatically adding permission to the target project. The user can add custom injection permission configuration code to obtain a corresponding permission target project.

[0102] After the target project is upgraded, the target project can be subjected to permission management processing intelligently and conveniently. The permission management is added to the target project by using route information, and the related permission is automatically generated, so that the user can customize the permission configuration code to implement a more complex permission management function. The project development human cost can be effectively saved, the processing efficiency of the target project permission management is improved, and the intelligence of the target project permission management is improved.

[0103] In some optional implementation manners of the embodiment, the above-mentioned permission configuration processing of the target project based on the preset permission configuration component and the preset permission configuration code to obtain a corresponding permission target project comprises the following steps:

[0104] The permission configuration component and the permission configuration code are obtained.

[0105] In the embodiment, after the route information of the target project is obtained, a permission configuration file is pre-constructed, and a permission configuration component for performing permission management on the project is automatically constructed in the permission management file. The permission configuration component is stored after being created and generated, so that the permission configuration component can be obtained based on a corresponding acquisition instruction in the future. Similarly, the permission configuration code is stored after being written and generated, so that the permission configuration code can be obtained based on a corresponding acquisition instruction in the future.

[0106] The permission configuration component is added to the target route of the target project to obtain a first target project.

[0107] In the embodiment, the permission configuration component can be a high-order component. The high-order component is similar to a high-order function, receives a React component as an input, and outputs a new React component. The high-order component makes the code more reusable, logical, and abstract. The high-order component can hijack the render method, control the props and the state, and implement the high-order function. The principle of the high-order function includes that if a function operates other functions, the other functions are used as parameters or the functions are used as a return value. Specifically, a file can be newly created to encapsulate the high-order component, a route component and a preset field are set, the route component is verified through the preset field, permission management is implemented, and the first target project is obtained.

[0108] The permission configuration code is injected into the first target project to obtain a second target project.

[0109] In the embodiment, the permission configuration code can be code data generated according to actual permission management requirements. The permission configuration code can be injected into the first target project in a self-defined injection manner, and the permission target project is finally obtained.

[0110] The second target project is used as the permission target project.

[0111] The application adds permission management in the target project by using the permission configuration component and the permission configuration code, automatically generates related permissions, implements a relatively complex permission management function, effectively saves the human cost of project development, and improves the intelligence of permission management of the target project.

[0112] In some optional implementation manners, the route information of the target project is obtained by the following steps.

[0113] The framework type of the target project is obtained.

[0114] In the embodiment, the framework type can include a React framework or a Vue framework.

[0115] The route file of the target project is obtained based on the framework type.

[0116] In the embodiment, it is determined whether the vue framework or the React framework is currently used, and whether the route file exists in the target project is determined according to different framework characteristics. If the framework type of the target project is the React framework, the route information is obtained according to the route file, and the route information is saved.

[0117] The route information of the target project is obtained based on the route file.

[0118] The application obtains the routing file of the target project based on the framework type of the target project, and then the corresponding routing information can be quickly obtained according to the routing file, which is beneficial to quickly and accurately determining the target routing according to the obtained routing information.

[0119] In some optional implementations, the determining of the target permission configuration information corresponding to the identification information based on the preset permission data table includes the following steps.

[0120] The permission data table is called.

[0121] In this embodiment, the permission data table is stored after being created, so that the permission data table can be called based on the corresponding calling instruction in the subsequent process.

[0122] Based on the preset parallel comparison instruction, the identification information is matched with each identification in the permission data table respectively, and the target identification same as the identification information is filtered out from the permission data table.

[0123] In this embodiment, the parallel comparison instruction can be a single instruction multiple data (SIMD) instruction.

[0124] The permission configuration information corresponding to the target identification is extracted from the permission data table.

[0125] In this embodiment, after the target identification same as the identification information is matched, the corresponding permission configuration information can be further extracted from the permission data table according to the target identification as the target permission configuration information corresponding to the target project.

[0126] The permission configuration information is taken as the target permission configuration information.

[0127] The application uses the parallel computing capability of the parallel comparison instruction to simultaneously perform one-to-one data comparison processing of the identification information and each identification in the permission data table to obtain a plurality of data comparison information, and then the target identification same as the identification information can be found according to the data comparison information, which effectively improves the comparison processing rate between the identification information, and then the permission configuration information corresponding to the target identification can be quickly found, and the generation rate of the target permission configuration information is effectively improved.

[0128] In some optional implementations of this embodiment, after the step of performing permission configuration processing on the target project based on the preset permission configuration component and the preset permission configuration code to obtain the corresponding permission target project, the electronic device can further perform the following steps:

[0129] obtain importance information of the target item.

[0130] In the embodiment, the importance information of the target item can be obtained by querying a preset importance data table. The importance data table can be generated in advance, and the importance information of each item is stored in the importance data table. The importance information can include high importance, medium importance, and low importance. In addition, the importance data table can be preset with different data storage modes corresponding to various importance information. Specifically, the storage mode corresponding to high importance can be blockchain storage, the storage mode corresponding to medium importance can be local storage, and the storage mode corresponding to low importance can be no storage.

[0131] determine a storage mode corresponding to the importance information.

[0132] In the embodiment, after obtaining the importance information of the target item, the corresponding storage mode can be queried from the importance data table based on the importance information of the target item.

[0133] store the target item based on the storage mode.

[0134] The application obtains the importance information of the target item, and then stores the items with different importance information correspondingly, effectively improves the intelligence of data storage, and ensures the data security of the generated items with high importance.

[0135] In some optional implementation manners of the embodiment, step S201 includes the following steps:

[0136] invoke the scaffolding tool.

[0137] In the embodiment, the scaffolding tool is a vue-cli tool that is created in advance to encapsulate the capabilities of the vite development server startup project.

[0138] obtain a preset encapsulation command.

[0139] In the embodiment, the encapsulation command is specifically a pafe-cli-service vite command. Vue-cli-service is a commonly used service command of the vue-cli tool, and pafe is the project name of the target item.

[0140] run the encapsulation command through the scaffolding tool to encapsulate the startup command of the vite development server.

[0141] In the embodiment, the encapsulation command is run by using the scaffolding tool, that is, the starting command of the official vite development server is encapsulated by the scaffolding tool, the capability of the vite development server can be introduced without introducing new dependencies, and subsequent target project updating and upgrading can be conveniently executed.

[0142] The preset encapsulation command is run by using the scaffolding tool to encapsulate the starting command of the vite development server, so that the capability of the vite development server can be introduced without introducing new dependencies, and subsequent target project updating and upgrading can be quickly executed.

[0143] It should be emphasized that, in order to further ensure the privacy and security of the target project, the target project can also be stored in a node of a blockchain.

[0144] The blockchain referred to in the present application is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm and other computer technologies. Blockchain, in essence, is a decentralized database, a series of data blocks associated using cryptographic methods, each data block containing information about a batch of network transactions, used to verify the validity of the information (anti-fake) and generate the next block. The blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.

[0145] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. Artificial intelligence (AI) is the use of digital computers or computer-controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0146] Artificial intelligence basic technologies generally include technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. Artificial intelligence software technology mainly includes computer vision technology, robot technology, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.

[0147] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing relevant hardware through computer readable instructions, and the computer readable instructions can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiment methods. Among them, the storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0148] It should be understood that although each step in the flowchart of the accompanying drawings is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in sequence according to the direction of the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other orders. Moreover, at least part of the steps in the flowchart of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be alternately executed with at least part of other steps or sub-steps or stages of other steps.

[0149] Further referring to Figure 3 , as an implementation of the method shown in the above Figure 2 , the present application provides an embodiment of a project processing device, which corresponds to the method embodiment shown in Figure 2 , and the device can be applied to various electronic devices.

[0150] As shown in Figure 3 , the project processing device 300 described in the embodiment includes a packaging module 301, a reading module 302, a first acquisition module 303, a conversion module 304, a generation module 305, and a starting module 306. Among them:

[0151] The packaging module 301 is configured to package the starting command of the vite development server based on a preset scaffold tool;

[0152] The reading module 302 is configured to read the configuration file of the target project;

[0153] The first acquisition module 303 is configured to acquire preset configuration data corresponding to the vite development server, and transmit the configuration data into the configuration file;

[0154] The conversion module 304 is configured to convert all configuration objects contained in the configuration file into target configuration objects corresponding to the vite development server;

[0155] The generating module 305 is configured to read a main page file under a specified directory of the target project, and add a specified tag reference to the main page file to generate a target entry file corresponding to the vite development server.

[0156] The starting module 306 is configured to export the target configuration object into the target entry file, and execute the starting command to start the target project.

[0157] In the embodiment, the above modules or units are respectively used for performing operations corresponding to the steps of the project processing method of the foregoing embodiments, and thus will not be described here.

[0158] In some optional implementations of the embodiment, the project processing apparatus further includes:

[0159] The second obtaining module is configured to obtain identification information of the target project.

[0160] The first determining module is configured to determine target permission configuration information corresponding to the identification information based on a preset permission data table.

[0161] The third obtaining module is configured to obtain routing information of the target project.

[0162] The second determining module is configured to determine, from the routing information, a target route corresponding to the target permission configuration information.

[0163] The configuring module is configured to perform permission configuration processing on the target project based on a preset permission configuration component and a preset permission configuration code to obtain a corresponding permission target project.

[0164] In the embodiment, the above modules or units are respectively used for performing operations corresponding to the steps of the project processing method of the foregoing embodiments, and thus will not be described here.

[0165] In some optional implementations of the embodiment, the configuring module includes:

[0166] The first obtaining submodule is configured to obtain the permission configuration component and the permission configuration code.

[0167] The adding submodule is configured to add the permission configuration component into the target route of the target project to obtain a first target project.

[0168] The injecting submodule is configured to inject the permission configuration code into the first target project to obtain a second target project.

[0169] The first determining submodule is configured to take the second target project as the permission target project.

[0170] In the embodiment, the operations performed by the above modules or units correspond to the steps of the project processing method of the foregoing embodiments one by one, and will not be described here again.

[0171] In some optional implementations of the embodiment, the second determining module includes:

[0172] The second obtaining sub-module is configured to obtain a framework type of the target project.

[0173] The third obtaining sub-module is configured to obtain a routing file of the target project based on the framework type.

[0174] The fourth obtaining sub-module is configured to obtain routing information of the target project based on the routing file.

[0175] In the embodiment, the operations performed by the above modules or units correspond to the steps of the project processing method of the foregoing embodiments one by one, and will not be described here again.

[0176] In some optional implementations of the embodiment, the first determining module includes:

[0177] The first calling sub-module is configured to call the permission data table.

[0178] The matching sub-module is configured to perform matching processing on the identification information and each identification in the permission data table based on a preset parallel comparison instruction, and filter a target identification same as the identification information from the permission data table.

[0179] The extracting sub-module is configured to extract, from the permission data table, permission configuration information corresponding to the target identification.

[0180] The second determining sub-module is configured to take the permission configuration information as the target permission configuration information.

[0181] In the embodiment, the operations performed by the above modules or units correspond to the steps of the project processing method of the foregoing embodiments one by one, and will not be described here again.

[0182] In some optional implementations of the embodiment, the project processing apparatus further includes:

[0183] The fourth obtaining module is configured to obtain importance information of the target project.

[0184] The third determining module is configured to determine a storage manner corresponding to the importance information.

[0185] The storage module is configured to perform storage processing on the permission target project based on the storage manner.

[0186] In the embodiment, the modules or units described above are respectively used for performing operations corresponding to steps of the project processing method of the foregoing embodiments, and details are not described herein.

[0187] In some optional implementations of the embodiment, the packaging module 301 includes:

[0188] The second calling sub-module is configured to call the scaffold tool.

[0189] The fifth obtaining sub-module is configured to obtain a preset packaging command.

[0190] The packaging sub-module is configured to run the packaging command by using the scaffold tool, so as to perform packaging processing on the starting command of the vite development server.

[0191] In the embodiment, the modules or units described above are respectively used for performing operations corresponding to steps of the project processing method of the foregoing embodiments, and details are not described herein.

[0192] To solve the above technical problems, the embodiment of the present application further provides a computer device. For details, please refer to Figure 4 , Figure 4 The basic structure block diagram of the computer device in the embodiment is shown in the figure.

[0193] The computer device 4 includes a memory 41, a processor 42, and a network interface 43, which are connected to each other through a system bus. It should be pointed out that only the computer device 4 with components 41-43 is shown in the figure, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented. Among them, those skilled in the art can understand that the computer device herein is a device capable of automatically performing numerical calculation and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0194] The computer device can be a desktop computer, a notebook computer, a palm computer, a cloud server, and other computing devices. The computer device can interact with a user through a keyboard, a mouse, a remote controller, a touchpad, a voice control device, or other manners.

[0195] The memory 41 includes at least one type of readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit and the external storage device of the computer device 4. In this embodiment, the memory 41 is generally used to store an operating system and various application software installed on the computer device 4, such as computer readable instructions of the project processing method, etc. In addition, the memory 41 can also be used to temporarily store various data that have been output or will be output.

[0196] The processor 42 can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer readable instructions or process data stored in the memory 41, such as computer readable instructions of the project processing method.

[0197] The network interface 43 can include a wireless network interface or a wired network interface, and is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0198] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0199] In the embodiment of the present application, after the preset scaffolding tool encapsulates the starting command of the vite development server, the configuration file of the target project is first read, and the preset configuration data corresponding to the vite development server is obtained, and the configuration data is transmitted into the configuration file, then all configuration objects contained in the configuration file are converted into target configuration objects corresponding to the vite development server, then the main page file under the specified directory of the target project is read, and the specified tag reference is added to the main page file, the target entry file corresponding to the vite development server is generated, finally the target configuration object is exported into the target entry file, and the starting command is executed to start the target project, so as to complete the upgrading process of integrating the vite development service in the target project. By using the project upgrading method of the embodiment of the present application to upgrade the target project, the root directory of the target project can be avoided to newly create an entry file and a configuration file, the purpose of zero new addition and zero configuration in the upgrading process of integrating the vite development service in the target project is achieved, the development workload of the developer is effectively reduced, the cost of project maintenance is reduced, and the processing efficiency of project upgrading is improved.

[0200] The present application also provides another embodiment, that is, a computer readable storage medium storing computer readable instructions, which can be executed by at least one processor to make the at least one processor execute the steps of the project processing method as described above.

[0201] Compared with the prior art, the embodiment of the present application has the following beneficial effects:

[0202] In the embodiment of the present application, after the preset scaffolding tool encapsulates the starting command of the vite development server, the configuration file of the target project is first read, and the preset configuration data corresponding to the vite development server is obtained, and the configuration data is transmitted into the configuration file, then all configuration objects contained in the configuration file are converted into target configuration objects corresponding to the vite development server, then the main page file under the specified directory of the target project is read, and the specified tag reference is added to the main page file, the target entry file corresponding to the vite development server is generated, finally the target configuration object is exported into the target entry file, and the starting command is executed to start the target project, so as to complete the upgrading process of integrating the vite development service in the target project. By using the project upgrading method of the embodiment of the present application to upgrade the target project, the root directory of the target project can be avoided to newly create an entry file and a configuration file, the purpose of zero new addition and zero configuration in the upgrading process of integrating the vite development service in the target project is achieved, the development workload of the developer is effectively reduced, the cost of project maintenance is reduced, and the processing efficiency of project upgrading is improved.

[0203] Those skilled in the art can clearly understand the above-mentioned embodiment method can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for making a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) execute the method described in each embodiment of the present application.

[0204] Obviously, the above-described embodiments are only some of the embodiments of the present application, not all the embodiments, and the drawings show the preferred embodiments of the present application, but do not limit the patent scope of the present application. The present application can be implemented in many different forms, and conversely, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing specific embodiments, or make equivalent replacements to some of the technical features. Any equivalent structure made by using the content of the specification and drawings, directly or indirectly applied to other related technical fields, is also within the scope of the patent protection of the present application.

Claims

1. A project processing method characterized by, The method comprises the following steps: performing encapsulation processing on a starting command of a vite development server based on a preset scaffolding tool; reading a configuration file of a target project; obtaining preset configuration data corresponding to the vite development server and inputting the configuration data into the configuration file; converting all configuration objects contained in the configuration file into target configuration objects corresponding to the vite development server; reading a homepage file under a specified directory of the target project and adding a specified tag reference to the homepage file to generate a target entry file corresponding to the vite development server; exporting the target configuration objects to the target entry file and executing the starting command to start the target project; The step of performing encapsulation processing on the starting command of the vite development server based on the preset scaffolding tool comprises: calling the scaffolding tool; obtaining a preset encapsulation command; running the encapsulation command through the scaffolding tool to perform encapsulation processing on the starting command of the vite development server. The scaffolding tool is a vue-cli tool pre-created for encapsulating the capability of starting a vite development server project, and the encapsulation command is specifically a pafe-cli-service vite command.

2. The item processing method of claim 1, wherein, After the step of exporting the target configuration objects to the target entry file and executing the starting command to start the target project, the method further comprises: obtaining identification information of the target project; determining target permission configuration information corresponding to the identification information based on a preset permission data table; obtaining routing information of the target project; determining a target route corresponding to the target permission configuration information from the routing information; and performing permission configuration processing on the target project based on a preset permission configuration component and a preset permission configuration code to obtain a corresponding permission target project.

3. The item processing method of claim 2, wherein, The step of performing permission configuration processing on the target project based on the preset permission configuration component and the preset permission configuration code to obtain the corresponding permission target project comprises: obtaining the permission configuration component and the permission configuration code; adding the permission configuration component to the target route of the target project to obtain a first target project; injecting the permission configuration code into the first target project to obtain a second target project; and taking the second target project as the permission target project.

4. The item processing method of claim 2, wherein, The step of obtaining the routing information of the target project comprises: obtaining a framework type of the target project; obtaining a routing file of the target project based on the framework type; and obtaining the routing information of the target project based on the routing file.

5. The item processing method of claim 2, wherein, The step of determining the target permission configuration information corresponding to the identification information based on the preset permission data table comprises: calling the permission data table; respectively matching the identification information with each identification in the permission data table based on a preset parallel comparison instruction to filter a target identification same as the identification information from the permission data table. Extract the permission configuration information corresponding to the target identifier from the permission data table; The permission configuration information is used as the target permission configuration information.

6. The item processing method of claim 2, wherein, After the step of performing permission configuration processing on the target project based on the preset permission configuration component and the preset permission configuration code to obtain a corresponding permission target project, the method further includes: Obtaining importance information of the target project; Determine the storage mode corresponding to the importance information; Based on the storage mode, the permission target project is stored.

7. An item processing apparatus, characterized by It includes: The encapsulation module is used for encapsulating the starting command of the vite development server based on the preset scaffold tool; The reading module is used for reading the configuration file of the target project; The first acquisition module is used for acquiring preset configuration data corresponding to the vite development server and transmitting the configuration data into the configuration file; The conversion module is used for converting all configuration objects contained in the configuration file into target configuration objects corresponding to the vite development server; The generation module is used for reading the home page file under the specified directory of the target project, adding a specified tag reference to the home page file, and generating a target entry file corresponding to the vite development server; The starting module is used for exporting the target configuration object into the target entry file, and executing the starting command to start the target project; The encapsulation module includes: The second calling submodule is used for calling the scaffold tool; The fifth acquisition submodule is used for acquiring a preset encapsulation command; The encapsulation submodule is used for the scaffold tool to run the encapsulation command to encapsulate the starting command of the vite development server; The scaffold tool is a pre-created vue-cli tool for encapsulating the capability of the vite development server starting project, and the encapsulation command is specifically a pafe-cli-service vite command.

8. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions, the processor implementing the steps of the project processing method of any one of claims 1 to 6 when executing the computer readable instructions.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium has stored thereon computer readable instructions, which are executed by the processor to implement the steps of the project processing method of any one of claims 1 to 6. The computer readable storage medium has stored thereon computer readable instructions, which are executed by the processor to implement the steps of the project processing method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and system for adding authority to front-end project

    CN113835737A