Information processing method, device, server and storage medium

By parsing and compiling JavaScript code, page structure information and access paths are generated, which solves the problem of slow reflection of complex application codes, enables rapid browser display and instant code updating, and improves development efficiency.

CN114115904BActive Publication Date: 2024-09-13CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111435673.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-29
Publication Date
2024-09-13
Estimated Expiration
2041-11-29

AI Technical Summary

Technical Problem

When developing complex front-end applications, JavaScript code is slow to reflect, resulting in reduced development efficiency.

Method used

By obtaining configuration information, including running mode, code path and file path, it parses and compiles the application code, generates page structure information and access paths, and enables the browser to quickly display the page effect and update it instantly when the code is updated.

Benefits of technology

It improves development efficiency. By quickly displaying and updating page effects, it reduces developers' waiting time and compilation volume, and improves the development experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114115904B
    Figure CN114115904B
Patent Text Reader

Abstract

The present application is applicable to the field of artificial intelligence technology, and provides an information processing method, device, server and storage medium, the method comprising: obtaining configuration information; if the operation mode indication information indicates that the target server is in development mode, then when a startup operation is detected, obtaining the application code from the code path, and performing source code analysis on the application code to obtain the file identifier of the underlying code file referenced by the application code and the file identifier of the business logic code file; performing file compilation on the underlying code file; generating page structure information and access paths of each page in the application according to the page basic path, the application code and the file identifier of the underlying code file referenced by the application code and the file identifier of the business logic code file. The present application can enable the browser to quickly display the effects of the pages involved in the application code, which helps to improve development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to an information processing method, device, server and storage medium. Background Art

[0002] At present, front-end applications are becoming more and more complex, and it is common for an application to contain thousands of modules. In practical applications, JavaScript scripts are usually used for front-end application development. As we start to build larger and larger applications, the amount of code that needs to be processed also increases exponentially.

[0003] In the related art, when faced with complex applications, the effects of application codes developed using JavaScript usually take a long time to be reflected in the browser, and the slow feedback will greatly affect the developer's development efficiency and happiness. Summary of the invention

[0004] In view of this, the embodiments of the present application provide an information processing method, device, server and storage medium to solve the problem in the related art that it takes a long time for the effect of the application code to be reflected in the browser, resulting in a reduction in the development efficiency of developers.

[0005] A first aspect of an embodiment of the present application provides an information processing method, including:

[0006] Get configuration information, including: operation mode indication information, code path, underlying file path, business logic file path, and page basic path;

[0007] If the operation mode indication information indicates that the target server is in development mode, then when the startup operation is detected, the application code is obtained from the code path, and the source code of the application code is parsed to obtain the file identifier of the underlying code file referenced by the application code and the file identifier of the business logic code file;

[0008] According to the file identifier of the underlying code file, the underlying code file is obtained from the underlying file path, and the underlying code file is compiled, wherein the file compilation is used to compile the underlying code file into a file in a format executable by the browser;

[0009] Based on the page basic path, application code, and the file identifiers of the underlying code files referenced by the application code and the file identifiers of the business logic code files, the page structure information and access path of each page in the application are generated, where the access path is used for the browser to access the corresponding page structure information to display the page indicated by the page structure information.

[0010] Furthermore, the browser displays the page indicated by the page structure information by executing a page display step, wherein the page display step includes:

[0011] When receiving the target access path input by the user, the target page structure information corresponding to the target access path is loaded, and the target page structure information is parsed to obtain the file identifier of the code file included in the target page structure information, wherein the code file includes the underlying code file and the business logic code file;

[0012] A file acquisition request including a target file identifier is sent to a target server, a compiled code file is received from the target server based on the file acquisition request, and the compiled code file is executed to display the page indicated by the target page structure information, wherein the target file identifier is the file identifier of the code file included in the target page structure information.

[0013] Furthermore, the page display step also includes:

[0014] The received compiled code file is cached, and when the target file identifier is obtained by re-parsing, the cached compiled code file is extracted, and the compiled code file is executed.

[0015] Furthermore, the method further comprises:

[0016] In response to receiving a file acquisition request including a target file identifier sent by a browser, acquiring a code file corresponding to the target file identifier;

[0017] The acquired code file is compiled to obtain a compiled code file, and the compiled code file is sent to the browser.

[0018] Furthermore, the method further comprises:

[0019] The application code is updated and monitored, and when a code update is detected in the application code, the update file containing the updated code and the files associated with the update file logic are parsed to obtain a new code file referenced by the updated application code.

[0020] Furthermore, the method further comprises:

[0021] If it is detected that the browser has displayed the target page involved in the update, an update notification is sent to the browser so that the browser updates the target page based on the new code file.

[0022] Furthermore, the method further comprises:

[0023] If the operation mode indication information indicates that the target server is in production mode, the application code is obtained from the code path, source code is parsed for the application code, and a file identifier of a code file referenced by the application code is obtained;

[0024] According to the obtained file identifier of the code file, the code file is obtained from the underlying file path and / or the business logic file path, and the obtained code file is compiled;

[0025] All compiled code files are packaged to obtain an application installation package corresponding to the application code.

[0026] A second aspect of an embodiment of the present application provides an information processing device, including:

[0027] An information configuration unit, used to obtain configuration information, the configuration information includes: operation mode indication information, code path, underlying file path, business logic file path, page basic path;

[0028] A code parsing unit, for obtaining application code from a code path when a startup operation is detected if the operation mode indication information indicates that the target server is in development mode, and performing source code parsing on the application code to obtain a file identifier of an underlying code file referenced by the application code and a file identifier of a business logic code file;

[0029] A file compilation unit, used for obtaining the underlying code file from the underlying file path according to the file identifier of the underlying code file, and performing file compilation on the underlying code file, wherein the file compilation is used for compiling the underlying code file into a file in a format executable by the browser;

[0030] The information generation unit is used to generate page structure information and access paths for each page in the application based on the page basic path, application code, and the file identifiers of the underlying code files referenced by the application code and the file identifiers of the business logic code files, wherein the access path is used for the browser to access the corresponding page structure information so as to display the page indicated by the page structure information.

[0031] Furthermore, the browser displays the page indicated by the page structure information by executing a page display step, wherein the page display step includes:

[0032] When receiving the target access path input by the user, the target page structure information corresponding to the target access path is loaded, and the target page structure information is parsed to obtain the file identifier of the code file included in the target page structure information, wherein the code file includes the underlying code file and the business logic code file;

[0033] A file acquisition request including a target file identifier is sent to a target server, a compiled code file is received from the target server based on the file acquisition request, and the compiled code file is executed to display the page indicated by the target page structure information, wherein the target file identifier is the file identifier of the code file included in the target page structure information.

[0034] Furthermore, the page display step also includes:

[0035] The received compiled code file is cached, and when the target file identifier is obtained by re-parsing, the cached compiled code file is extracted, and the compiled code file is executed.

[0036] Furthermore, the device also includes a file sending unit. The file sending unit is used to:

[0037] In response to receiving a file acquisition request including a target file identifier sent by a browser, acquiring a code file corresponding to the target file identifier;

[0038] The acquired code file is compiled to obtain a compiled code file, and the compiled code file is sent to the browser.

[0039] Furthermore, the device also includes a file update unit. The file update unit is used to:

[0040] The application code is updated and monitored, and when a code update is detected in the application code, the update file containing the updated code and the files associated with the update file logic are parsed to obtain a new code file referenced by the updated application code.

[0041] Furthermore, the device also includes a page update unit. The page update unit is used to:

[0042] If it is detected that the browser has displayed the target page involved in the update, an update notification is sent to the browser so that the browser updates the target page based on the new code file.

[0043] Furthermore, the device also includes a file packaging unit. The file packaging unit is used to:

[0044] If the operation mode indication information indicates that the target server is in production mode, the application code is obtained from the code path, source code is parsed for the application code, and a file identifier of a code file referenced by the application code is obtained;

[0045] According to the obtained file identifier of the code file, the code file is obtained from the underlying file path and / or the business logic file path, and the obtained code file is compiled;

[0046] All compiled code files are packaged to obtain an application installation package corresponding to the application code.

[0047] A third aspect of an embodiment of the present application provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the server, wherein the processor implements the steps of the information processing method provided in the first aspect when executing the computer program.

[0048] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the information processing method provided in the first aspect are implemented.

[0049] The implementation of an information processing method, device, server and storage medium provided by the embodiments of the present application has the following beneficial effects: by generating page structure information and access paths of each page in the application using application code written by developers, the browser can quickly display the effects of the pages involved in the application code, which helps to improve development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0051] Figure 1 It is a flowchart of an implementation of an information processing method provided in an embodiment of the present application;

[0052] Figure 2 This is a flowchart of a page display step provided in an embodiment of the present application;

[0053] Figure 3 is a flowchart of another information processing method provided in an embodiment of the present application;

[0054] Figure 4 is a structural block diagram of an information processing device provided in an embodiment of the present application;

[0055] Figure 5 It is a structural block diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0057] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0058] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0059] In the embodiment of the present application, artificial intelligence technology is used to process application code.

[0060] The information processing method involved in the embodiment of the present application can be executed by a server. When the information processing method is executed by a server, the execution subject is the server.

[0061] It should be noted that the above-mentioned servers may include but are not limited to servers, computers, mobile phones, tablets or wearable smart devices, etc. In addition, the above-mentioned servers may be independent servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0062] See also Figure 1 , Figure 1 The following is a flowchart of an information processing method according to an embodiment of the present application, including:

[0063] Step 101, obtaining configuration information.

[0064] The configuration information includes: operation mode indication information, code path, underlying file path, business logic file path, and page basic path.

[0065] The above-mentioned operation mode indication information is usually information used to indicate the operation mode. In practice, the operation mode indicated by the above-mentioned operation mode indication information may include a development mode and a production mode.

[0066] The above code path is usually the path used to store application code. The above underlying file path is usually the path used to store underlying code files. The above business logic file path is usually the path used to store business logic code files. The page base path is usually the root path of the page.

[0067] In practice, the configuration information may also include other configuration items, such as identification information of the plug-in to be loaded.

[0068] Here, the execution subject may obtain the configuration information in a variety of ways, such as receiving the configuration information input by a developer, or obtaining the configuration information from other devices connected by communication.

[0069] Step 102, if the operation mode indication information indicates that the target server is in development mode, then when a startup operation is detected, the application code is obtained from the code path, and the source code of the application code is parsed to obtain the file identifier of the underlying code file referenced by the application code and the file identifier of the business logic code file.

[0070] The target server is usually a server that executes the information processing method. In practice, when the method of this embodiment is applied to a development server, the target server may be a development server. When the method is applied to a continuous integration server, the target server may be a continuous integration server.

[0071] The above-mentioned start operation is usually used to trigger the operation of starting interaction with the browser. In practice, the above-mentioned start operation can be in the form of various operations, such as clicking a preset button or sliding on a touch screen along a preset track. This embodiment does not specifically limit the form of the start operation.

[0072] Among them, the underlying code files are usually some basic dependency files. The code in the underlying code files usually does not change. The business logic code files are usually business codes written by developers. The format of the underlying code files and the format of the business logic code files can be JSX, CSS, or Vue / React, etc. It should be pointed out that the format of the underlying code files and the format of the business logic code files can be the same or different.

[0073] The above file identifier is usually an identifier for indicating a code file, such as the name of a code file. The code file may include an underlying code file and a business logic code file.

[0074] Here, when the operation mode indication information indicates that the target server is in development mode and a startup operation is detected, the target server can obtain the application code from the configured code path. Then, the target server can parse the application code based on the format of the application code to obtain the file identifier of the underlying code file referenced in the application code and the file identifier of the referenced business logic code file.

[0075] Step 103, obtaining the underlying code file from the underlying file path according to the file identifier of the underlying code file, and compiling the underlying code file.

[0076] Among them, file compilation is used to compile the underlying code file into a file in a format that can be executed by the browser.

[0077] Here, the execution subject may use the file identifier of the underlying code file to obtain the underlying code file corresponding to the file identifier from the underlying file path. Then, the execution subject may compile the obtained code file to obtain a file in a browser executable format.

[0078] In practice, the target server usually compiles the code files using swc compilation tools written in rust language. It should be noted that since rust language is a scripting language, the code written in rust language usually has strong hardware operation capabilities and multi-core capabilities. Therefore, using swc for compilation will increase the compilation speed and help further improve development efficiency.

[0079] In addition, since the underlying code files usually do not change, when a startup operation is detected, the underlying code files involved are compiled together, and when used later, they can be used directly, which can improve efficiency.

[0080] Step 104, generating page structure information and access paths of each page in the application according to the page basic path, the application code, the file identifiers of the underlying code files referenced by the application code, and the file identifiers of the business logic code files.

[0081] The access path is used for the browser to access the corresponding page structure information, so as to display the page indicated by the page structure information. The above page structure information is usually information used to indicate the logical structure of the page.

[0082] The above page base path is usually a root path, and the access path is usually a subpath under the page base path.

[0083] Here, the execution subject can extract information from the application code and generate page structure information and access path for each page based on the configured page basic path, using the application code, the file identifier of the underlying code file referenced by the application code, and the file identifier of the business logic code file referenced by the application code. In this way, the developer can input the access path of the page into the browser to display the page on the browser.

[0084] It should be noted that the above-mentioned browser usually refers to a terminal device installed with a browser. The terminal device is usually a hardware device different from the development server.

[0085] The information processing method provided in this embodiment generates page structure information and access paths of each page in the application through the application code written by the developer, so that the browser can quickly display the effects of the pages involved in the application code, which helps to improve development efficiency.

[0086] In some optional implementations of this embodiment, the browser displays the page indicated by the page structure information by executing the page display step, wherein the page display step may include the following steps 201 to 202. Figure 2 A flowchart for implementing page display steps provided in an embodiment of the present application.

[0087] Step 201 , when receiving a target access path input by a user, loading target page structure information corresponding to the target access path, and performing syntax analysis on the target page structure information to obtain a file identifier of a code file included in the target page structure information.

[0088] Among them, the code files include underlying code files and business logic code files.

[0089] The target access path is usually the input access path. The target page structure information is usually the page structure information corresponding to the target access path.

[0090] Here, the browser can receive the target access path input by the user, and then use the target access path to find the page structure information corresponding to the target access path. Since the files loaded by the browser from the outside usually need to conform to a specific syntax format. Therefore, the browser can perform syntax analysis on the loaded page structure information based on the specific syntax format, so as to obtain the file identifier of the code file included therein, such as the file name. In this way, the browser can use the file identifier to obtain the corresponding code file from the underlying file path and / or the business logic file path.

[0091] In practice, the browser usually requests page structure information from the development server through the access path. It should be noted that the page structure information may include multiple code files. In this case, the file identifiers of the multiple code files and the nested relationship between the code files can be obtained from the page structure information.

[0092] Step 202, sending a file acquisition request including a target file identifier to a target server, receiving a compiled code file returned by the target server based on the file acquisition request, and executing the compiled code file to display the page indicated by the target page structure information.

[0093] The target file identifier is the file identifier of the code file included in the target page structure information.

[0094] Here, the browser may send a file acquisition request including a target file identifier to the target server. Then, the browser may receive a compiled code file returned by the target server based on the file acquisition request. Afterwards, the browser may execute the compiled code file to display the page indicated by the target page structure information.

[0095] It should be noted that the target server only compiles the business logic code files needed by the browser, which can improve the startup speed of the target server compared to compiling all the code files when the target server is started. In development mode, the target server is usually a development server, that is, in development mode, only the business logic code files needed by the browser are compiled, which helps to improve the startup speed of the development server, thereby helping to further improve development efficiency.

[0096] In some optional implementations, the page display step may also include the following steps: caching the received compiled code file, and when the target file identifier is obtained by parsing again, extracting the cached compiled code file, and executing the compiled code file.

[0097] Here, if the browser has sent a file acquisition request for a code file and has obtained the compiled code file, the browser can cache the compiled code file. During the cache validity period, the browser does not need to request the same code file, which can improve the efficiency of development effect display, thereby helping to further improve development efficiency.

[0098] In some optional implementations, the information processing method may further include: first, in response to receiving a file acquisition request including a target file identifier sent by a browser, acquiring a code file corresponding to the target file identifier, then compiling the acquired code file to obtain a compiled code file, and sending the compiled code file to the browser.

[0099] Here, upon receiving the file acquisition request from the browser, the target server may compile the requested code file and return the compiled code file to the browser.

[0100] It should be pointed out that in development mode, the target server is usually a development server. The development server compiles the corresponding code files only when the browser uses them. When the development server starts, all code files are compiled at once, which can reduce the amount of compilation when the development server starts. In addition, the development server compiles the corresponding code files only when the browser uses them. This can effectively avoid compiling some unnecessary code files when the developer makes changes to the referenced code files midway, which helps improve compilation efficiency.

[0101] See also Figure 3 , Figure 3 This is a flowchart of an implementation of an information processing method provided by an embodiment of the present application. The information processing method provided by this embodiment may include the following steps:

[0102] Step 301, obtaining configuration information.

[0103] The configuration information includes: operation mode indication information, code path, underlying file path, business logic file path, and page basic path.

[0104] Step 302, if the operation mode indication information indicates that the target server is in development mode, then when a startup operation is detected, the application code is obtained from the code path, and the source code of the application code is parsed to obtain the file identifier of the underlying code file referenced by the application code and the file identifier of the business logic code file.

[0105] Step 303: According to the file identifier of the underlying code file, the underlying code file is obtained from the underlying file path, and the underlying code file is compiled.

[0106] Among them, file compilation is used to compile the underlying code file into a file in a format that can be executed by the browser.

[0107] Step 304, generating page structure information and access paths of each page in the application according to the page basic path, the application code, the file identifiers of the underlying code files referenced by the application code, and the file identifiers of the business logic code files.

[0108] The access path is used for the browser to access the corresponding page structure information, so as to display the page indicated by the page structure information.

[0109] In this embodiment, the specific operations of steps 301-304 are the same as Figure 1 The operations of steps 101 - 104 in the illustrated embodiment are substantially the same and will not be described in detail herein.

[0110] Step 305 , monitor the application code for updates, and when code updates are detected in the application code, parse the update file containing the updated code and the files associated with the update file logic to obtain new code files referenced by the updated application code.

[0111] Here, the target server can monitor the real-time update of the application code. For example, a monitoring process can be created to monitor the code update of the application code in real time. If a code update is detected, the file where the update code is located can be located. For the sake of description, it is referred to as the update file. Then, the target server can perform syntax analysis on the update file to obtain files that are logically associated with the update file. In this way, the target server can parse the update file and the files that are logically associated with the update file to obtain the new code file referenced by the updated application code.

[0112] This embodiment can realize timely monitoring of code files referenced by application code.

[0113] It should be noted that the new code files referenced by the updated application code usually refer to the code files referenced by the update file and the file codes associated with the update file logic after modification. For example, if the code files originally referenced by the update file and the files associated with the update file logic are: file 1, file 2, and file 3, after modification, the files referenced by the update file and the files associated with the update file logic can be: file 1 and file 2, or: file 1, file 2, file 3, and file 4.

[0114] In some optional implementations, the above information processing method may further include the following steps: if it is detected that the browser has displayed the target page involved in the update, an update notification is sent to the browser so that the browser updates the target page based on the new code file.

[0115] The target page is usually the page involved in the update.

[0116] Here, the target server can determine whether a certain page has been displayed by the browser through a file acquisition request for the code file of the page, thereby monitoring whether the browser has displayed the target page involved in the update. In addition, a socket link is usually established between the browser and the target server. After the corresponding code has been updated in the target server, a notification can be sent to the browser through the link. In this way, the browser can update the content of the displayed target page based on the obtained new code file. Specifically, the browser can use the file identifier of the new code file to send a file acquisition request to the target server to obtain the compiled new code file, and then execute the compiled code file. To achieve the update of the target page.

[0117] This embodiment can realize that when the code is updated, the target server only needs to compile a small amount of code files, which helps to improve the efficiency of hot update and effect display of the code during the development process, and can greatly enhance the development experience of developers.

[0118] In an optional implementation of each embodiment of the present application, the above information processing method may further include the following steps:

[0119] First, if the operation mode indication information indicates that the target server is in production mode, the application code is obtained from the code path, the source code of the application code is parsed, and the file identifier of the code file referenced by the application code is obtained.

[0120] Here, when the operation mode indication information indicates that the target server is in production mode, the target server is generally a continuous integration server. In production mode, the target server can obtain application code from the code path, and parse the application code based on the format of the application code to obtain the file identifier of the underlying code file referenced in the application code and the file identifier of the referenced business logic code file.

[0121] Then, according to the obtained file identifier of the code file, the code file is obtained from the underlying file path and / or the business logic file path, and the obtained code file is compiled.

[0122] Here, the target server can use the file identifier of each code file to obtain the corresponding code file from the underlying file path and / or the business logic file path, and then compile each code file. In practice, the above-mentioned target server usually uses a swc compilation tool written in rust language to compile the code file. It should be pointed out that since rust language is a scripting language, the code written in rust language usually has a strong ability to operate hardware and a strong ability to use multiple cores. Therefore, using swc for compilation will make the compilation faster and help improve program production efficiency.

[0123] Finally, all compiled code files are packaged to obtain an application installation package corresponding to the application code.

[0124] Here, you can use the esbuild packaging tool to package the compiled code files. Among them, esbuild is a packaging tool written in GO language with extremely fast packaging speed. Using the esbuild packaging tool to package the compiled code files can achieve fast packaging and improve program production efficiency.

[0125] It should be noted that the information processing method provided by this application is usually in development mode when used for a development server. When used for a continuous integration server, it is usually in production mode. In different modes, the application code is processed differently. And in production mode, the code file is usually fully compiled.

[0126] See also Figure 4 , Figure 4 400 is a structural block diagram of an information processing device 400 provided in an embodiment of the present application. In this embodiment, the information processing device includes various units for executing Figure 1-Figure 3 For details, please refer to the steps in the corresponding embodiment. Figure 1-Figure 3 as well as Figure 1-Figure 3 For the convenience of explanation, only the parts related to this embodiment are shown. Figure 4 , the information processing device 400 includes:

[0127] The information configuration unit 401 is used to obtain configuration information, which includes: operation mode indication information, code path, underlying file path, business logic file path, and page basic path;

[0128] The code parsing unit 402 is used to obtain the application code from the code path when the startup operation is detected if the operation mode indication information indicates that the target server is in the development mode, and perform source code parsing on the application code to obtain the file identifier of the underlying code file referenced by the application code and the file identifier of the business logic code file;

[0129] The file compiling unit 403 is used to obtain the underlying code file from the underlying file path according to the file identifier of the underlying code file, and to compile the underlying code file, wherein the file compiling is used to compile the underlying code file into a file in a format executable by the browser;

[0130] The information generation unit 404 is used to generate page structure information and access paths for each page in the application based on the page basic path, application code, and the file identifiers of the underlying code files referenced by the application code and the file identifiers of the business logic code files, wherein the access path is used for the browser to access the corresponding page structure information so as to display the page indicated by the page structure information.

[0131] As an embodiment of the present application, the browser realizes display of the page indicated by the page structure information by executing the page display step, wherein the page display step includes: first, when receiving the target access path input by the user, the target page structure information corresponding to the target access path is loaded, and the target page structure information is parsed to obtain the file identifier of the code file included in the target page structure information. The code file includes the underlying code file and the business logic code file, and then, a file acquisition request including the target file identifier is sent to the target server, the compiled code file returned by the target server based on the file acquisition request is received, and the compiled code file is executed to realize display of the page indicated by the target page structure information. The target file identifier is the file identifier of the code file included in the target page structure information.

[0132] As an embodiment of the present application, the page display step also includes: caching the received compiled code file, and when the target file identifier is obtained by parsing again, extracting the cached compiled code file, and executing the compiled code file.

[0133] As an embodiment of the present application, the device further includes a file sending unit (not shown in the figure). The file sending unit is used to: first, in response to receiving a file acquisition request including a target file identifier sent by a browser, acquire a code file corresponding to the target file identifier. Then, compile the acquired code file to obtain a compiled code file, and send the compiled code file to the browser.

[0134] As an embodiment of the present application, the device further includes a file update unit (not shown in the figure). The file update unit is used to: monitor the update of the application code, and when a code update is detected in the application code, parse the update file where the updated code is located and the file associated with the update file logic to obtain a new code file referenced by the updated application code.

[0135] As an embodiment of the present application, the device further includes a page update unit (not shown in the figure). The page update unit is used to: if it is detected that the browser has displayed the target page involved in the update, send an update notification to the browser so that the browser updates the target page based on the new code file.

[0136] As an embodiment of the present application, the device also includes a file packaging unit (not shown in the figure). The file packaging unit is used to: first, if the operation mode indication information indicates that the target server is in production mode, obtain the application code from the code path, perform source code analysis on the application code, and obtain the file identifier of the code file referenced by the application code. Then, according to the file identifier of the obtained code file, obtain the code file from the underlying file path and / or the business logic file path, and compile the obtained code file. Finally, all the compiled code files are packaged to obtain an application installation package corresponding to the application code.

[0137] The device provided in this embodiment generates page structure information and access paths of each page in the application by using the application code written by the developer, so that the browser can quickly display the effects of the pages involved in the application code, which helps to improve development efficiency.

[0138] It should be understood that Figure 4 In the structural block diagram of the information processing device shown in FIG. Figure 1-Figure 3 The steps in the corresponding embodiments, and for Figure 1-Figure 3 Each step in the corresponding embodiment has been explained in detail in the above embodiment. Figure 1-Figure 3 as well as Figure 1-Figure 3 The relevant descriptions in the corresponding embodiments are not repeated here.

[0139] Figure 5 FIG. 1 is a structural block diagram of a server provided by another embodiment of the present application. Figure 5 As shown, the server 500 of this embodiment includes: a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501, such as a program of the information processing method. When the processor 501 executes the computer program 503, the steps in each embodiment of the above-mentioned information processing method are implemented, such as Figure 1 Alternatively, the processor 501 executes the computer program 503 to implement the above Figure 4 The functions of each unit in the corresponding embodiment are, for example, Figure 4 For details on the functions of the units 401 to 404 shown, please refer to Figure 4 The relevant descriptions in the corresponding embodiments are not repeated here.

[0140] Exemplarily, the computer program 503 may be divided into one or more units, one or more units are stored in the memory 502, and are executed by the processor 501 to complete the present application. One or more units may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 503 in the server 500. For example, the computer program 503 may be divided into an information configuration unit, a code parsing unit, a file compilation unit, and an information generation unit, and the specific functions of each unit are as described above.

[0141] The server may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will appreciate that Figure 5 It is only an example of the server 500 and does not constitute a limitation of the server 500. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the turntable device may also include input and output devices, network access devices, buses, etc.

[0142] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0143] The memory 502 may be an internal storage unit of the server 500, such as a hard disk or memory of the server 500. The memory 502 may also be an external storage device of the server 500, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the server 500. Further, the memory 502 may also include both an internal storage unit of the server 500 and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the turntable device. The memory 502 may also be used to temporarily store data that has been output or is to be output.

[0144] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0145] If the integrated module is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Among them, the computer-readable storage medium can be non-volatile or volatile. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in computer-readable storage media can be appropriately increased or decreased according to the requirements of legislation and patent practices in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practices, computer-readable storage media do not include electrical carrier signals and telecommunications signals.

[0146] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. An information processing method, characterized in that: The method comprises: Obtain configuration information, the configuration information including: operation mode indication information, code path, underlying file path, business logic file path, and page basic path; If the operation mode indication information indicates that the target server is in development mode, then when a startup operation is detected, the application code is obtained from the code path, and the source code of the application code is parsed to obtain the file identifier of the underlying code file referenced by the application code and the file identifier of the business logic code file; According to the file identifier of the underlying code file, the underlying code file is obtained from the underlying file path, and the underlying code file is compiled, wherein the file compilation is used to compile the underlying code file into a file in a format executable by a browser; Generate page structure information and access paths of each page in the application according to the page basic path, the application code, the file identifier of the underlying code file referenced by the application code, and the file identifier of the business logic code file, wherein the access path is used for the browser to access the corresponding page structure information to display the page indicated by the page structure information; The browser displays the page indicated by the page structure information by executing a page display step, wherein the page display step includes: When receiving a target access path input by a user, loading target page structure information corresponding to the target access path, and performing syntax analysis on the target page structure information to obtain a file identifier of a code file included in the target page structure information, wherein the code file includes an underlying code file and a business logic code file; A file acquisition request including a target file identifier is sent to the target server, a compiled code file is received from the target server based on the file acquisition request, and the compiled code file is executed to display the page indicated by the target page structure information, wherein the target file identifier is a file identifier of the code file included in the target page structure information.

2. The information processing method according to claim 1, characterized in that: The page display step also includes: The received compiled code file is cached, and when the target file identifier is obtained by re-parsing, the cached compiled code file is extracted, and the compiled code file is executed.

3. The information processing method according to claim 1, characterized in that: The method further comprises: In response to receiving the file acquisition request including the target file identifier sent by the browser, acquiring a code file corresponding to the target file identifier; The acquired code file is compiled to obtain a compiled code file, and the compiled code file is sent to the browser.

4. The information processing method according to claim 1, characterized in that: The method further comprises: The application code is updated and monitored, and when a code update is detected in the application code, an update file containing the updated code and a file logically associated with the update file are parsed to obtain a new code file referenced by the updated application code.

5. The information processing method according to claim 4, characterized in that: The method further comprises: If it is detected that the browser has displayed the target page involved in the update, an update notification is sent to the browser so that the browser updates the target page based on the new code file.

6. The information processing method according to any one of claims 1 to 5, characterized in that: The method further comprises: If the operation mode indication information indicates that the target server is in production mode, obtaining the application code from the code path, performing source code analysis on the application code, and obtaining a file identifier of a code file referenced by the application code; According to the obtained file identifier of the code file, the code file is obtained from the underlying file path and / or the business logic file path, and the obtained code file is compiled; All compiled code files are packaged to obtain an application installation package corresponding to the application code.

7. An information processing device, characterized in that: The device comprises: An information configuration unit, used to obtain configuration information, wherein the configuration information includes: operation mode indication information, code path, underlying file path, business logic file path, and page basic path; a code parsing unit, configured to obtain application code from the code path when a startup operation is detected if the operation mode indication information indicates that the target server is in development mode, and perform source code parsing on the application code to obtain a file identifier of an underlying code file and a file identifier of a business logic code file referenced by the application code; A file compiling unit, used for obtaining the underlying code file from the underlying file path according to the file identifier of the underlying code file, and performing file compiling on the underlying code file, wherein the file compiling is used for compiling the underlying code file into a file in a format executable by a browser; An information generating unit, configured to generate page structure information and an access path of each page in the application according to the page basic path, the application code, the file identifier of the underlying code file referenced by the application code, and the file identifier of the business logic code file, wherein the access path is used for the browser to access the corresponding page structure information so as to display the page indicated by the page structure information; The browser displays the page indicated by the page structure information by executing a page display step, wherein the page display step includes: when receiving a target access path input by a user, loading the target page structure information corresponding to the target access path, and performing syntax analysis on the target page structure information to obtain the file identifier of the code file included in the target page structure information, wherein the code file includes an underlying code file and a business logic code file; sending a file acquisition request including a target file identifier to a target server, receiving a compiled code file returned by the target server based on the file acquisition request, and executing the compiled code file to display the page indicated by the target page structure information, wherein the target file identifier is the file identifier of the code file included in the target page structure information.

8. A server comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Security gateway and method for forwarding webpage by using security gateway

    CN102469113A

  • Page content acquisition method and apparatus

    CN105956173A

  • Application configuration file generation method and device, application page display method and device and storage medium

    CN110308908A