Program processing method and device, equipment and storage medium
By redundantly processing the front-end program, the problem of reduced operation efficiency caused by redundant information is solved, and the effect of improving the operation efficiency of the target object is achieved.
Patent Information
- Application Number
- CN202411066512.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-15
AI Technical Summary
In the prior art, there is redundant information in front-end programs, resulting in a problem of reducing the operating efficiency of target objects.
By receiving redundant processing requests, obtaining the target object directory, determining multiple initial program identifiers and their historical paths, generating cleaning programs based on file types, performing redundant processing, obtaining the target program and storing it to the target storage path, reducing redundant information pairs The impact of the target object.
It improves the operation efficiency of the target object, reduces the operation burden of redundant information, and improves system performance.
Smart Images

Figure CN118963713A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a program processing method, device, equipment and storage medium. Background Art
[0002] Front-end engineering can build target objects such as web applications or websites based on engineering methods and technologies throughout the entire life cycle from demand analysis, design, coding, testing, deployment and maintenance.
[0003] In the prior art, for any target object, multiple front-end programs can be determined, and executing multiple front-end programs can realize the target object. However, there is usually redundant information in the front-end program, and the redundant information does not affect the actual operation effect of the code front-end program. However, more redundant information will increase the burden of the target object operation, making the target object's operation efficiency lower. Summary of the invention
[0004] The present application provides a program processing method, device, equipment and storage medium to solve the problem in the prior art that a large amount of redundant information in the front-end program will increase the burden on the operation of the target object and reduce the operation efficiency of the target object.
[0005] In a first aspect, the present application provides a method for processing a program, comprising:
[0006] receiving a redundant processing request, and acquiring a target object directory of a target object according to the redundant processing request, wherein the target object directory is used to record a plurality of initial program identifiers corresponding to executing the target object;
[0007] Determine, according to the target object directory, the multiple initial program identifiers and the historical path of the front-end program corresponding to each initial program identifier;
[0008] Determine the file type corresponding to each of the initial program identifiers;
[0009] Determine at least one first program identifier according to the file type corresponding to each initial program identifier, where the file type corresponding to the first program identifier is a preset file type;
[0010] For any first program identifier, based on the file type corresponding to the first program identifier and the historical path corresponding to each initial program identifier, the first front-end program corresponding to the first program identifier is redundantly processed to obtain a target program, and the target program is stored in a target storage path.
[0011] In a possible design, according to the file type corresponding to the first program identifier and the historical path corresponding to each of the initial program identifiers, redundancy processing is performed on the first front-end program corresponding to the first program identifier to obtain a target program, including:
[0012] generating a cleaning program corresponding to the first program identifier according to the file type corresponding to the first program identifier;
[0013] According to the historical path corresponding to each initial program identifier, obtaining the first front-end program corresponding to the first program identifier;
[0014] The first front-end program is subjected to redundancy cleaning processing by the cleaning program to obtain the target program.
[0015] In a possible design, generating a cleanup program corresponding to the first program identifier according to the file type corresponding to the first program identifier includes:
[0016] Determining at least one cleanup object according to the file type corresponding to the first program identifier;
[0017] According to the at least one cleaning object, obtaining at least one cleaning field corresponding to each cleaning object;
[0018] The cleaning program is generated according to at least one cleaning field corresponding to each cleaning object.
[0019] In a possible design, obtaining the first front-end program corresponding to each initial program identifier according to the historical path corresponding to the first program identifier includes:
[0020] Determine a target historical path in the historical paths corresponding to each of the initial program identifiers according to the first program identifier;
[0021] According to the target historical path, the first front-end program is obtained.
[0022] In a possible design, obtaining a target object directory of a target object according to the redundant processing request includes:
[0023] According to the redundant processing request, determining whether at least one object directory exists in the target workspace;
[0024] If so, determining the target object directory in the at least one object directory;
[0025] If not, a first prompt message is generated, where the first prompt message is used to prompt the user to open the target object directory in the target workspace to obtain the target object directory.
[0026] In a possible design, determining the target object directory in the at least one object directory includes:
[0027] generating second prompt information according to the at least one object directory, wherein the second prompt information is used to prompt a user to determine the target object directory in the at least one object directory;
[0028] According to the second prompt information, the target object directory is obtained.
[0029] In a possible design, determining at least one first program identifier according to the file type corresponding to each initial program identifier includes:
[0030] Receive the preset file type, where the preset file type includes at least one of the following: a hypertext markup language HTML type, a cascading style sheet CSS type, a script type, a single file component type, and a lightweight data exchange format JSON type;
[0031] The initial program identifier whose file type is the preset file type is determined as a first program identifier, so as to determine at least one first program identifier.
[0032] In one possible design, it also includes:
[0033] determining initial program identifiers other than the first program identifier among the plurality of initial program identifiers as second program identifiers to determine at least one second program identifier;
[0034] The program corresponding to the at least one second program identifier is stored in the target storage path.
[0035] In a second aspect, the present application provides a program processing device, including a receiving module, an acquisition module, a first determination module, a second determination module, a third determination module and a redundancy processing module:
[0036] The receiving module is used to receive a redundancy processing request;
[0037] The acquisition module is used to acquire a target object directory of a target object according to the redundant processing request, wherein the target object directory is used to record a plurality of initial program identifiers corresponding to executing the target object;
[0038] The first determination module is used to determine the multiple initial program identifiers and the historical path of the front-end program corresponding to each initial program identifier according to the target object directory;
[0039] The second determination module is used to determine the file type corresponding to each initial program identifier;
[0040] The third determination module is used to determine at least one first program identifier according to the file type corresponding to each initial program identifier, and the file type corresponding to the first program identifier is a preset file type;
[0041] The redundant processing module is used to, for any first program identifier, perform redundant processing on the first front-end program corresponding to the first program identifier according to the file type corresponding to the first program identifier and the historical path corresponding to each initial program identifier, obtain the target program, and store the target program to the target storage path.
[0042] In a possible design, the redundancy processing module is specifically used to:
[0043] generating a cleaning program corresponding to the first program identifier according to the file type corresponding to the first program identifier;
[0044] According to the historical path corresponding to each initial program identifier, obtaining the first front-end program corresponding to the first program identifier;
[0045] The first front-end program is subjected to redundancy cleaning processing by the cleaning program to obtain the target program.
[0046] In a possible design, the redundancy processing module is specifically used to:
[0047] Determining at least one cleanup object according to the file type corresponding to the first program identifier;
[0048] According to the at least one cleaning object, obtaining at least one cleaning field corresponding to each cleaning object;
[0049] The cleaning program is generated according to at least one cleaning field corresponding to each cleaning object.
[0050] In a possible design, the redundancy processing module is specifically used to:
[0051] Determine a target historical path in the historical paths corresponding to each of the initial program identifiers according to the first program identifier;
[0052] According to the target historical path, the first front-end program is obtained.
[0053] In a possible design, the acquisition module is specifically used for:
[0054] According to the redundant processing request, determining whether at least one object directory exists in the target workspace;
[0055] If so, determining the target object directory in the at least one object directory;
[0056] If not, a first prompt message is generated, where the first prompt message is used to prompt the user to open the target object directory in the target workspace to obtain the target object directory.
[0057] In a possible design, the acquisition module is specifically used for:
[0058] generating second prompt information according to the at least one object directory, wherein the second prompt information is used to prompt a user to determine the target object directory in the at least one object directory;
[0059] According to the second prompt information, the target object directory is obtained.
[0060] In a possible design, the third determining module is specifically configured to:
[0061] Receive the preset file type, where the preset file type includes at least one of the following: a hypertext markup language HTML type, a cascading style sheet CSS type, a script type, a single file component type, and a lightweight data exchange format JSON type;
[0062] The initial program identifier whose file type is the preset file type is determined as a first program identifier, so as to determine at least one first program identifier.
[0063] In a possible design, the third determining module is specifically configured to:
[0064] determining initial program identifiers other than the first program identifier among the plurality of initial program identifiers as second program identifiers to determine at least one second program identifier;
[0065] The program corresponding to the at least one second program identifier is stored in the target storage path.
[0066] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, so that the processor executes the processing method of the program described in the first aspect and various possible designs of the first aspect.
[0067] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, a processing method of the program described in the first aspect and various possible designs of the first aspect is implemented.
[0068] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the processing method of the program described in the first aspect and various possible designs of the first aspect.
[0069] The program processing method, device, equipment and storage medium provided in the present application can perform redundant processing on multiple front-end programs corresponding to the target object directory according to redundant processing requests to obtain multiple target programs, which can reduce the impact of redundant information on the operation of the target object and improve the operation efficiency of the target object. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0071] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;
[0072] Figure 2 A flowchart of a method for processing a program provided in an embodiment of the present application;
[0073] Figure 3 A schematic diagram of a process for determining a target program provided in an embodiment of the present application;
[0074] Figure 4 A schematic diagram of a process for obtaining a target object directory provided in an embodiment of the present application;
[0075] Figure 5 A schematic diagram of a process for determining a first program identifier provided in an embodiment of the present application;
[0076] Figure 6 A schematic diagram of the architecture of a program processing method provided in an embodiment of the present application;
[0077] Figure 7 A schematic diagram of the structure of a program processing device provided in an embodiment of the present application;
[0078] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0079] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0080] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0081] It should be noted that the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved in the technical solution of this application are in compliance with the relevant laws and regulations and do not violate public order and good morals.
[0082] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0083] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0084] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 , the application scenario may include a user terminal 101 and a server 102 .
[0085] A source code editor may be installed in the user terminal 101, and the user may edit multiple initial programs of the target object through the user terminal 101. The target object directory of each target object may be displayed in the work area of the source code editor. The user may input a request instruction through the user terminal 101, and the user terminal 101 may generate a redundant processing request according to the request instruction.
[0086] The server 102 may receive a redundancy processing request, obtain a target object directory of a target object according to the redundancy processing request, determine multiple initial program identifiers, and a historical path corresponding to each initial program identifier. The server 102 may determine at least one first program identifier according to the file type corresponding to each initial program identifier, and for any first program identifier, perform redundancy processing on the first front-end program corresponding to the first program identifier according to the file type corresponding to the first program identifier and the historical path corresponding to each initial program identifier, to obtain a target program. The server 102 may store the target program in the target storage path.
[0087] In the prior art, for any target object, multiple front-end programs can be determined, and executing multiple front-end programs can realize the target object. However, there is usually redundant information in the front-end program, and the redundant information does not affect the actual operation effect of the code front-end program. However, more redundant information will increase the burden of the target object operation, making the target object's operation efficiency lower.
[0088] In response to the above technical problems, the program processing method proposed in this application can perform redundant processing on multiple front-end programs corresponding to the target object directory according to redundant processing requests to obtain multiple target programs, which can reduce the impact of redundant information on the operation of the target object and improve the operation efficiency of the target object.
[0089] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0090] Figure 2 A flowchart of a method for processing a program provided in an embodiment of the present application. Figure 2 , the method may include:
[0091] S201: Receive a redundancy processing request.
[0092] The execution subject of the embodiment of the present application may be a server, or a program processing device set in the server. The program processing device may be implemented by software, or by a combination of software and hardware.
[0093] A redundant processing plug-in may be installed on a user terminal. The user may open a command panel corresponding to the redundant processing plug-in through a shortcut key. The user may enter a redundant processing command in the command panel, and the user terminal may generate a redundant processing request.
[0094] For example, the redundant processing command may be cleanCode.
[0095] On the user terminal, you can initialize the name, description and other information of the redundant processing plug-in, install the plug-in's dependencies, define the plug-in's contributions point, implement the plug-in logic, and package and publish the plug-in. Among them, the contribution point refers to the extension or custom function that the plug-in can provide to the editor through the specific configuration part of its package.json file.
[0096] S202: Acquire a target object directory of a target object according to the redundant processing request.
[0097] The target object can be a web application or a website project. Before the target object is applied, front-end engineering can be used to build multiple front-end programs for the target object throughout its life cycle, from demand analysis, design, coding, testing, deployment and maintenance.
[0098] A plurality of initial program identifiers corresponding to the target object can be recorded in the target object directory, and each initial program identifier has a corresponding front-end program.
[0099] S203: Determine multiple initial program identifiers and a historical path of a front-end program corresponding to each initial program identifier according to the target object directory.
[0100] A plurality of initial program identifiers may be determined in the target object directory, and when the user selects the target object directory of the target object in the workspace, the historical path corresponding to the target object directory is recorded.
[0101] The historical path of the front-end program corresponding to each initial program identifier can be determined through the historical path corresponding to the target object directory.
[0102] The historical path of the front-end program corresponding to each initial program identifier may be stored in selectedUrl.
[0103] For example, assuming that the target object directory has a total of 4 initial program identifiers, namely program identifier 1, program identifier 2, program identifier 3 and program identifier 4, then it can be determined that the historical path corresponding to program identifier 1 is path 1, the historical path corresponding to program identifier 2 is path 2, the historical path corresponding to program identifier 3 is path 3, and the historical path corresponding to program identifier 4 is path 4.
[0104] S204: Determine the file type corresponding to each initial program identifier.
[0105] File types may include Hyper Text Markup Language (HTML) type, Cascading Style Sheets (CSS) type, script type, single file component type, JavaScript Object Notation (JSON) type, configuration file type, and image and media resource type.
[0106] The initial program identifier may include a file extension, and the file type corresponding to each initial program identifier may be determined according to the file extension corresponding to each initial program identifier.
[0107] Among them, the file extension of HTML type can be .html and .htm, the file extension of CSS type can be .css, the file extension of script type can be .js, .jsx, .mjs, .ts and .tsx, etc., the file extension of single-file component type can be .vue, .svelte, etc., the file extension of configuration file can be .webpack.config.js, .babelrc, .babel.config.js, .eslintrc.js, .prettierrc, .prettierrc.json, .prettierrc.js, etc., the file extension of image and media resources can be .jpg, .jpeg, .png, .gif, .svg, .mp4, .webm, .ogg, .mp3, .wav, .aac, etc., and the file extension of JSON type can be .json.
[0108] S205: Determine at least one first program identifier according to the file type corresponding to each initial program identifier.
[0109] The file type corresponding to the first program identifier is a preset file type.
[0110] The preset file types may include an HTML type, a CSS type, a script type, a single file component type, and a JSON type.
[0111] For example, assuming that there are 4 initial program identifiers, namely program identifier 1, program identifier 2, program identifier 3 and program identifier 4, assuming that the file type corresponding to program identifier 1 is type 1, the file type corresponding to program identifier 2 is type 2, the file type corresponding to program identifier 3 is type 1, and the file type corresponding to program identifier 4 is type 4, and assuming that the preset file types are type 1, type 2 and type 3, then the first program identifier can be determined as program identifier 1, program identifier 2 and program identifier 3.
[0112] S206. For any first program identifier, perform redundancy processing on the first front-end program corresponding to the first program identifier according to the file type corresponding to the first program identifier and the historical path corresponding to each initial program identifier, obtain a target program, and store the target program in a target storage path.
[0113] For example, assuming that the first program identifier is program identifier 1, and assuming that the historical path corresponding to program identifier 1 is path 1, the front-end program 1 corresponding to program identifier 1 can be obtained, and the front-end program 1 can be redundantly processed to obtain the target program 1. Assuming that the target storage path is path 2, the target program 1 is stored in path 2.
[0114] A storage path selection dialog box can be opened, where the user can select a folder and determine the storage location of the folder as the target storage path.
[0115] The program processing method provided in the embodiment of the present application can perform redundant processing on multiple initial programs corresponding to the target object directory according to redundant processing requests to obtain multiple target programs, which can reduce the impact of redundant information on the operation of the target object and improve the operation efficiency of the target object.
[0116] Based on the above embodiments, Figure 3 , for any first program identifier, the execution process of determining the target program in step S206 provided in the embodiment of the present application is further explained.
[0117] Figure 3 A flowchart of determining a target program provided in an embodiment of the present application. Figure 3 , the method may include:
[0118] S301. Determine at least one cleanup object according to a file type corresponding to a first program identifier.
[0119] Each preset file type has its corresponding cleaning object, which may include blank lines, comments, and logs.
[0120] Among them, the cleaning objects of the front-end program corresponding to the HTML type, CSS type, script type and single-file component type can be blank lines, comments and logs; the cleaning objects of the front-end program corresponding to the JSON type can be blank lines.
[0121] For example, assuming that the first program identifier is program identifier 1, assuming that the file type corresponding to program identifier 1 is HTML type, assuming that program identifier 1 corresponds to front-end program 1, it can be determined that the cleanup objects of front-end program 1 are blank lines, comments, and logs.
[0122] S302: According to at least one cleaning object, obtain at least one cleaning field corresponding to each cleaning object.
[0123] If the cleaning object is a blank line or a log, the cleaning field corresponding to the cleaning object is obtained; if the cleaning object is a comment, the file type identified by the first program is determined, and if the file type is an HTML type, multiple cleaning fields corresponding to multiple comment formats are determined.
[0124] If the file type is a CSS type, a script type, a single file component type, or a JSON type, a cleanup field in a comment format corresponding to the cleanup object is determined.
[0125] Among them, the cleaning field can include fixed instructions and regular expressions.
[0126] Since the comment formats in the HTML type front-end program may include HTML format, CSS format, and logic format, it is necessary to determine the cleanup field corresponding to each comment format.
[0127] For example, assuming that the cleanup object is a blank line, the cleanup field corresponding to the blank line may be fileContent.replace( / ^\s*[\r\n] / gm), where " / ^\s*[\r\n] / gm" is a regular expression corresponding to the blank line.
[0128] For example, assuming that the cleaning object is a comment, and assuming that the file type corresponding to the first program identifier is an HTML type, three comment formats can be determined, namely HTML format, CSS format and logical format. The cleaning field corresponding to the HTML format is fileContent.replace( / <!--[\s\S]*?--> / g,”), the cleaning field corresponding to the CSS format is fileContent.replace(, / \ / \*[\s\S]*?\*\ / / g”), and the cleaning field corresponding to the logical format is fileContent.replace( / \ / \*[\s\S]*?\*\ / |\ / \ / .* / g,”).
[0129] For example, assuming there are three cleaning objects, namely cleaning object 1, cleaning object 2 and cleaning object 3, and assuming that the cleaning field of cleaning object 1 is field 1, the cleaning fields of cleaning object 2 are field 2, field 3 and field 4, and the cleaning field of cleaning object 3 is field 5, then you can get field 1, field 2, field 3, field 4 and field 5.
[0130] S303: Generate a cleaning program according to at least one cleaning field corresponding to each cleaning object.
[0131] For example, assuming there are 4 cleaning fields, namely field 1, field 2, field 3 and field 4, a cleaning program is generated based on field 1, field 2, field 3 and field 4.
[0132] S304: Determine a target historical path in the historical path corresponding to each initial program identifier according to the first program identifier.
[0133] For example, assuming that there are 4 initial program identifiers, namely program identifiers 1-4, assuming that program identifier 1 corresponds to path 1, program identifier 2 corresponds to path 2, program identifier 3 corresponds to path 3, and program identifier 4 corresponds to path 4, assuming that the first program identifier is program identifier 1, then it can be determined that the target historical path is path 1.
[0134] S305: Obtain a first front-end program according to the target historical path.
[0135] For example, assuming that the target historical path is path 1, then according to path 1, the first front-end program obtained is program 1.
[0136] S306: Perform redundancy cleaning on the first front-end program through a cleaning program to obtain a target program.
[0137] A cleaning program can be executed to perform redundancy cleaning on the first front-end program to obtain a target program.
[0138] The program processing method provided in the embodiment of the present application can determine at least one cleaning object according to the file type corresponding to the first program identifier, obtain at least one cleaning field corresponding to each cleaning object according to the at least one cleaning object, generate a cleaning program according to the at least one cleaning field corresponding to each cleaning object, and perform redundant cleaning processing on the first front-end program corresponding to the first program identifier according to the cleaning program to obtain the target program, which can reduce the impact of redundant information on the operation of the target object and improve the operation efficiency of the target object.
[0139] Based on the above embodiments, Figure 4 , further illustrating the execution process of obtaining the target object directory provided in the embodiment of the present application.
[0140] Figure 4 A flowchart of obtaining a target object directory provided in an embodiment of the present application. Figure 4 , the method may include:
[0141] S401. Determine whether there is at least one object directory in the target workspace according to a redundant processing request.
[0142] You can call a command to get a workspace array. The workspace array can include multiple elements, each element corresponding to an object directory. For example, the workspace array can be recorded as workspaceFolders. If workspaceFolders is 0, the target workspace does not have an object directory. If workspaceFolders is 1 or greater than 1, the target workspace does have an object directory.
[0143] If yes, execute step S402;
[0144] If not, execute step S404.
[0145] S402: Generate second prompt information according to at least one object directory.
[0146] The second prompt information may be used to prompt the user to determine a target object directory in at least one object directory.
[0147] A dialog box may pop up on the interface of the user terminal, and the dialog box may display the second prompt information and at least one object directory.
[0148] Furthermore, if the number of object directories is 1, the object directory may be directly determined as the target object directory.
[0149] S403: Obtain a target object directory according to the second prompt information.
[0150] The user can select a target object in at least one object directory through a dialog box, and the path selected by the user can be recorded.
[0151] For example, assuming that there are three object directories in the target workspace, namely object directory 1, object directory 2, and object directory 3, the user can select object directory 1 as the target object directory.
[0152] S404: Generate first prompt information, where the first prompt information is used to prompt the user to open the target object directory in the target workspace to obtain the target object directory.
[0153] If the object directory does not exist in the target workspace, a first prompt message may be displayed through a dialog box, and the user may be prompted to select a target object as the target object directory.
[0154] The program processing method provided in the embodiment of the present application can instruct the user to select a target object directory through prompt information, thereby improving the flexibility of selecting the target object directory for processing.
[0155] Based on the above embodiments, Figure 5 , further illustrating the execution process of determining the first program identifier provided in an embodiment of the present application.
[0156] Figure 5 A flowchart of determining a first program identifier provided in an embodiment of the present application. Figure 5 , the method may include:
[0157] S501: Receive a preset file type.
[0158] The user can select a preset file type, and the preset file type includes at least one of the following: HTML type, CSS type, script type, single file component type and JSON type.
[0159] S502: Determine an initial program identifier whose file type is a preset file type as a first program identifier to determine at least one first program identifier.
[0160] Initial program identifiers other than the first program identifier among the plurality of initial program identifiers may be determined as second program identifiers to determine at least one second program identifier.
[0161] For example, assuming that there are 4 initial program identifiers, namely program identifiers 1-4, assuming that the file type of program identifier 1 is type 1, the file type of program identifier 2 is type 2, the file type of program identifier 3 is type 1, and the file type of program identifier 4 is type 4, and assuming that the preset file types are type 1, type 2 and type 3, then program identifier 1, program identifier 2 and program identifier 3 can be determined as the first program identifier, and program identifier 3 can be determined as the second program identifier.
[0162] The program corresponding to at least one second program identifier can be stored in the target storage path, so that multiple front-end programs of the target object that have passed redundant processing and those that have not passed redundant processing can be stored in the target storage path, thereby improving the reliability of the operation of the target object.
[0163] The program processing method provided in the embodiment of the present application can determine at least one first program identifier from multiple initial program identifiers by presetting the file type, and can perform redundant processing on the first front-end program corresponding to each first program identifier, thereby improving the operating efficiency of the target object.
[0164] Figure 6 This is a schematic diagram of the architecture of a program processing method provided in an embodiment of the present application. Figure 6 After receiving the redundant processing request, a target object directory of the target object can be obtained according to the redundant processing request, and multiple initial program identifiers and a historical path of a front-end program corresponding to each initial program identifier can be determined in the target object directory. The file type corresponding to each initial program identifier can be determined, and at least one first program identifier and at least one second program identifier can be determined from the multiple initial program identifiers according to the preset file type.
[0165] The first front-end program corresponding to each first program identifier may be processed redundantly to obtain at least one target program, and the at least one target program may be stored in a target storage path. At least one second front-end program corresponding to at least one second program identifier may be stored in a target storage path.
[0166] Figure 7 This is a schematic diagram of the structure of a program processing device provided in an embodiment of the present application. Figure 7 , the processing device of the program may include a receiving module 11, an acquiring module 12, a first determining module 13, a second determining module 14, a third determining module 15 and a redundancy processing module 16:
[0167] The receiving module 11 is used to receive a redundancy processing request;
[0168] The acquisition module 12 is used to acquire a target object directory of the target object according to the redundant processing request, where the target object directory is used to record multiple initial program identifiers corresponding to the execution target object;
[0169] The first determination module 13 is used to determine, according to the target object directory, a plurality of initial program identifiers and a historical path of a front-end program corresponding to each initial program identifier;
[0170] The second determination module 14 is used to determine the file type corresponding to each initial program identifier;
[0171] The third determination module 15 is used to determine at least one first program identifier according to the file type corresponding to each initial program identifier, and the file type corresponding to the first program identifier is a preset file type;
[0172] The redundant processing module 16 is used to perform redundant processing on the first front-end program corresponding to any first program identifier according to the file type corresponding to the first program identifier and the historical path corresponding to each initial program identifier, obtain the target program, and store the target program in the target storage path.
[0173] The processing device of the program provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0174] In a possible design, the redundancy processing module 16 is specifically used for:
[0175] Generate a cleanup program corresponding to the first program identifier according to the file type corresponding to the first program identifier;
[0176] According to the historical path corresponding to each initial program identifier, obtaining the first front-end program corresponding to the first program identifier;
[0177] The first front-end program is cleaned of redundancy by a cleaning program to obtain a target program.
[0178] In a possible design, the redundancy processing module 16 is specifically used for:
[0179] Determining at least one cleanup object according to the file type corresponding to the first program identifier;
[0180] According to at least one cleaning object, obtaining at least one cleaning field corresponding to each cleaning object;
[0181] A cleaning program is generated according to at least one cleaning field corresponding to each cleaning object.
[0182] In a possible design, the redundancy processing module 16 is specifically used for:
[0183] Determine a target historical path in the historical path corresponding to each initial program identifier according to the first program identifier;
[0184] According to the target historical path, obtain the first front-end program.
[0185] In a possible design, the acquisition module 12 is specifically used for:
[0186] Determining, based on the redundancy processing request, whether at least one object directory exists in the target workspace;
[0187] If so, determining a target object directory in at least one object directory;
[0188] If not, a first prompt message is generated, and the first prompt message is used to prompt the user to open the target object directory in the target workspace to obtain the target object directory.
[0189] In a possible design, the acquisition module 12 is specifically used for:
[0190] generating second prompt information according to the at least one object directory, the second prompt information being used to prompt a user to determine a target object directory in the at least one object directory;
[0191] According to the second prompt information, obtain the target object directory.
[0192] In a possible design, the third determining module 15 is specifically configured to:
[0193] Receiving a preset file type, the preset file type comprising at least one of the following: a hypertext markup language HTML type, a cascading style sheet CSS type, a script type, a single file component type, and a lightweight data exchange format JSON type;
[0194] An initial program identifier whose file type is a preset file type is determined as a first program identifier, so as to determine at least one first program identifier.
[0195] In a possible design, the third determining module 15 is specifically configured to:
[0196] determining initial program identifiers other than the first program identifier among the plurality of initial program identifiers as second program identifiers to determine at least one second program identifier;
[0197] The program corresponding to the at least one second program identifier is stored in the target storage path.
[0198] The processing device of the program provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0199] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 The electronic device 20 may include a processor 21 and a memory 22. Exemplarily, the processor 21 and the memory 22 are interconnected via a bus 23.
[0200] The memory 22 stores computer executable instructions;
[0201] The processor 21 executes the computer execution instructions stored in the memory 22, so that the processor 21 executes the processing method of the program shown in the above method embodiment.
[0202] Accordingly, an embodiment of the present application provides a computer-readable storage medium, in which computer-readable storage medium is stored computer execution instructions, which are used to implement a processing method of the program of the above method embodiment when the computer execution instructions are executed by a processor.
[0203] Accordingly, an embodiment of the present application may also provide a computer program product, including a computer program, which, when executed by a processor, can implement the program processing method shown in the above method embodiment.
[0204] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0205] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0206] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0207] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0208] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0209] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0210] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0211] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0212] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for processing a program, characterized in that: include: receiving a redundant processing request, and acquiring a target object directory of a target object according to the redundant processing request, wherein the target object directory is used to record a plurality of initial program identifiers corresponding to executing the target object; Determine, according to the target object directory, the multiple initial program identifiers and the historical path of the front-end program corresponding to each initial program identifier; Determine the file type corresponding to each of the initial program identifiers; Determine at least one first program identifier according to the file type corresponding to each initial program identifier, where the file type corresponding to the first program identifier is a preset file type; For any first program identifier, based on the file type corresponding to the first program identifier and the historical path corresponding to each initial program identifier, the first front-end program corresponding to the first program identifier is redundantly processed to obtain a target program, and the target program is stored in a target storage path.
2. The method according to claim 1, characterized in that According to the file type corresponding to the first program identifier and the historical path corresponding to each of the initial program identifiers, redundancy processing is performed on the first front-end program corresponding to the first program identifier to obtain a target program, including: generating a cleaning program corresponding to the first program identifier according to the file type corresponding to the first program identifier; According to the historical path corresponding to each initial program identifier, obtaining the first front-end program corresponding to the first program identifier; The first front-end program is subjected to redundancy cleaning processing by the cleaning program to obtain the target program.
3. The method according to claim 2, characterized in that Generating a cleanup program corresponding to the first program identifier according to the file type corresponding to the first program identifier includes: Determining at least one cleanup object according to the file type corresponding to the first program identifier; According to the at least one cleaning object, obtaining at least one cleaning field corresponding to each cleaning object; The cleaning program is generated according to at least one cleaning field corresponding to each cleaning object.
4. The method according to claim 2, characterized in that: Acquiring a first front-end program corresponding to each initial program identifier according to a historical path corresponding to each initial program identifier includes: Determine a target historical path in the historical paths corresponding to each of the initial program identifiers according to the first program identifier; According to the target historical path, the first front-end program is obtained.
5. The method according to any one of claims 1 to 4, characterized in that: Acquiring a target object directory of a target object according to the redundant processing request includes: According to the redundant processing request, determining whether at least one object directory exists in the target workspace; If so, determining the target object directory in the at least one object directory; If not, a first prompt message is generated, where the first prompt message is used to prompt the user to open the target object directory in the target workspace to obtain the target object directory.
6. The method according to claim 5, characterized in that Determining the target object directory in the at least one object directory includes: generating second prompt information according to the at least one object directory, wherein the second prompt information is used to prompt a user to determine the target object directory in the at least one object directory; According to the second prompt information, the target object directory is obtained.
7. The method according to any one of claims 1 to 6, characterized in that: Determining at least one first program identifier according to the file type corresponding to each initial program identifier includes: Receive the preset file type, where the preset file type includes at least one of the following: a hypertext markup language HTML type, a cascading style sheet CSS type, a script type, a single file component type, and a lightweight data exchange format JSON type; The initial program identifier whose file type is the preset file type is determined as a first program identifier, so as to determine at least one first program identifier.
8. The method according to claim 7, characterized in that Also includes: determining initial program identifiers other than the first program identifier among the plurality of initial program identifiers as second program identifiers to determine at least one second program identifier; The program corresponding to the at least one second program identifier is stored in the target storage path.
9. A program processing device, characterized in that: It includes a receiving module, an acquiring module, a first determining module, a second determining module, a third determining module and a redundancy processing module: The receiving module is used to receive a redundancy processing request; The acquisition module is used to acquire a target object directory of a target object according to the redundant processing request, wherein the target object directory is used to record a plurality of initial program identifiers corresponding to executing the target object; The first determination module is used to determine the multiple initial program identifiers and the historical path of the front-end program corresponding to each initial program identifier according to the target object directory; The second determination module is used to determine the file type corresponding to each initial program identifier; The third determination module is used to determine at least one first program identifier according to the file type corresponding to each initial program identifier, and the file type corresponding to the first program identifier is a preset file type; The redundant processing module is used to, for any first program identifier, perform redundant processing on the first front-end program corresponding to the first program identifier according to the file type corresponding to the first program identifier and the historical path corresponding to each initial program identifier, obtain the target program, and store the target program to the target storage path.
10. An electronic device, characterized in that: include: Memory and processor, The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the program processing method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the processing method of the program described in any one of claims 1 to 8 when the computer-executable instructions are executed by a processor.
12. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the program processing method according to any one of claims 1 to 8.
