Proxy configuration method, storage medium, compiling equipment and proxy server
By receiving startup information of the compiled device and using the survival probe interface, automatically configuring and adjusting the proxy configuration file, the problem of time-consuming and errors in the micro front-end architecture is solved, and development efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411265057.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-13
AI Technical Summary
When implementing a micro front-end architecture, developers need to manually adjust the proxy server configuration file, which makes it time-consuming and error-prone, reducing development efficiency.
By receiving sub-application startup information sent by the compilation device, automatically configure the proxy configuration file, and use the survival probe interface to monitor the operating status of the sub-application, dynamically adjust the proxy configuration information, and reduce the time for manually modifying and restarting the proxy server.
Improve the efficiency and accuracy of proxy configuration, ensure the continuity and efficiency of the development process, and reduce human errors and configuration file modification time.
Smart Images

Figure CN119127340A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the general technical field of front-end, and in particular to a proxy configuration method and storage medium, a compilation device, and a proxy server. Background Art
[0002] With the rapid development of Internet technology, front-end projects have become more and more complex and large-scale. Traditional monolithic application architectures often have problems such as large code bases, difficulty in team collaboration, and low deployment efficiency. In order to solve these problems, the micro-front-end architecture strategy came into being.
[0003] Currently, micro-frontend architecture has been widely used in building large front-end projects. Micro-frontend architecture splits large front-end applications into a series of small, independent and separately deployable sub-applications, each of which has its own development, testing and maintenance processes. When implementing micro-frontend architecture, reverse proxy technology is usually used to solve cross-domain problems, such as using Nginx for global system configuration.
[0004] However, in the actual development process, whenever a sub-application is started or finished, developers often need to manually adjust the proxy server configuration file and restart the proxy service to read the new configuration information. This process is time-consuming and error-prone, which distracts developers and reduces development efficiency.
[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are conventional technologies. Summary of the invention
[0006] The main purpose of this application is to provide a proxy configuration method and storage medium, compilation equipment, and proxy server, aiming to improve development efficiency.
[0007] To achieve the above purpose, an embodiment of the present application proposes a proxy configuration method, which uses a proxy server and includes:
[0008] When startup information of a sub-application sent by a compilation device is received, configuration information of the sub-application associated with the compilation device in the local end is configured according to the startup information, wherein the startup information is information sent by the compilation device when compilation of the sub-application associated with the compilation device is completed.
[0009] In one embodiment, after the step of configuring the configuration information of the sub-application to which the compiling device belongs in the local end, the method further includes:
[0010] Access the survival probe interface of the sub-application;
[0011] In the event of access failure, it is determined that the running state of the sub-application is in a disabled state, and the configuration information of the sub-application in the local end is removed.
[0012] In one embodiment, the proxy configuration method further includes:
[0013] Upon receiving an access request for a target sub-application sent by the compiling device, reading a current proxy configuration file;
[0014] According to the proxy configuration file, the access address of the target sub-application is sent to the compiling device.
[0015] In one embodiment, the step of sending the access address of the target sub-application to the compiling device according to the proxy configuration file includes:
[0016] In the case where the proxy configuration file does not record the configuration information of the target sub-application, sending the access address of the server storing the target sub-application to the compiling device; or,
[0017] In a case where the proxy configuration file records the configuration information of the target sub-application, the local access address of the target sub-application is sent to the compiling device.
[0018] In addition, to achieve the above purpose, the embodiment of the present application also proposes a proxy configuration method, which is applied to a compilation device, and the method includes:
[0019] When the compilation of the sub-application on the local end is completed, the startup information of the sub-application is sent to the proxy server, so that the proxy server configures the configuration information of the sub-application on the local end of the proxy server according to the startup information.
[0020] In one embodiment, before the step of sending the startup information of the sub-application to the proxy server, the method further includes:
[0021] When a startup instruction for the sub-application is received, the survival probe interface matching the sub-application is enabled, so that the proxy server can determine the running status of the sub-application by accessing the survival probe interface, and when the sub-application is disabled, remove the configuration information of the sub-application in the proxy server itself.
[0022] In one embodiment, after the step of enabling the survival probe interface associated with the sub-application, the method further includes:
[0023] When a stop instruction of the sub-application is received, the survival probe interface of the sub-application is disabled.
[0024] In addition, to achieve the above purpose, the embodiment of the present application further proposes a proxy configuration device, which is applied to a proxy server, and the proxy configuration device includes:
[0025] The proxy module is used to configure the configuration information of the sub-application to which the compiling device belongs in the local end according to the sub-application startup information when receiving the sub-application startup information sent by the compiling device.
[0026] In addition, to achieve the above purpose, the embodiment of the present application further proposes a proxy configuration device, which is applied to a compilation device, and the proxy configuration device includes:
[0027] The compiling module is used to send the startup information of the sub-application to the proxy server when the compilation of the sub-application on the local end is completed, so that the proxy server configures the configuration information of the sub-application.
[0028] In addition, to achieve the above objectives, the present application also proposes a proxy server, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the proxy configuration method described above.
[0029] In addition, to achieve the above objectives, the present application also proposes a compilation device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the proxy configuration method described above.
[0030] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the proxy configuration method described above are implemented.
[0031] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the proxy configuration method described above are implemented.
[0032] The present application provides a proxy configuration method, which is applied to a proxy server. In an embodiment of the present application, upon receiving the startup information of a sub-application sent by a compilation device, the configuration information of the sub-application to which the compilation device belongs in the local end is configured according to the startup information, wherein the startup information is information sent by the compilation device when the compilation of the sub-application on the local end is completed. By receiving the startup information automatically sent by the compilation device and modifying the configuration file, the embodiment of the present application reduces the time for manually adjusting the proxy configuration file and manual configuration errors, thereby improving the efficiency and accuracy of the proxy configuration and ensuring the continuity and efficiency of the development process. By optimizing the proxy configuration process, the embodiment of the present application reduces human errors and the time for modifying the proxy configuration file and restarting the proxy server, thereby improving development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] 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.
[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0035] Figure 1 A flowchart of the first embodiment of the proxy configuration method of this application is provided;
[0036] Figure 2 A schematic diagram of a branch flow provided for the first embodiment of the proxy configuration method of this application;
[0037] Figure 3 This is a schematic diagram of the two-end interaction of the proxy configuration method of this application;
[0038] Figure 4 This is a schematic diagram of the overall structure of the proxy configuration method for this application;
[0039] Figure 5 This is a schematic diagram of the overall interaction scenario of the agent configuration method of this application;
[0040] Figure 6 This is a schematic diagram of the module structure of the proxy configuration device according to the first embodiment of the present application;
[0041] Figure 7 This is a schematic diagram of the module structure of another proxy configuration device according to an embodiment of the present application;
[0042] Figure 8 A schematic diagram of the structure of a proxy server involved in the proxy configuration method in an embodiment of the present application;
[0043] Fig. 9 It is a structural diagram of the compilation device involved in the proxy configuration method in the embodiment of the present application. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0045] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0046] The embodiment of the present application is applied to a proxy server, and the main solution is: when receiving sub-application startup information sent by a compilation device, configure the configuration information of the sub-application belonging to the compilation device in the local end according to the sub-application startup information.
[0047] In this embodiment, for ease of description, the following description is made with the proxy server as the execution entity.
[0048] Since reverse proxy is used in conventional technology to solve the cross-domain problem of sub-applications, when using reverse proxy, developers need to manually modify the configuration file, add or remove the proxy configuration information of the sub-application, and restart the proxy server to ensure that the new settings take effect immediately to achieve local access. This operation is highly repetitive, which not only takes up the developer's time, but also may cause unnecessary configuration errors due to negligence or misoperation, thereby distracting the developer's attention and reducing development efficiency.
[0049] An embodiment of the present application provides a solution, which receives the startup information of the sub-application automatically sent by the compilation device when the compilation of the terminal application is completed, and modifies the proxy configuration file according to the sub-application startup information, and adds the configuration information of the sub-application to which the compilation device belongs, so that the server can access the local sub-application by reading the current proxy configuration file in real time, thereby realizing dynamic adjustment of the proxy configuration information; at the same time, for the sub-application whose configuration information is recorded in the proxy configuration file, the survival probe interface of all recorded sub-applications is dynamically accessed. If the interface is disabled, it means that the current sub-application has stopped running, so the configuration information of the current sub-application is removed, thereby saving the developer's time in manually modifying the proxy configuration information and improving development efficiency.
[0050] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device that can realize the above functions.
[0051] The present embodiment is described below by taking a proxy server as an example.
[0052] Based on this, the present application embodiment provides a proxy configuration method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the agent configuration method of this application.
[0053] In this embodiment, the proxy configuration method includes step S10:
[0054] Step S10, upon receiving the startup information of the sub-application sent by the compiling device, configure the configuration information of the sub-application associated with the compiling device in the local end according to the startup information, wherein the startup information is the information sent by the compiling device when the compilation of the sub-application associated with the compiling device is completed.
[0055] It should be noted that the compilation device refers to a computer system or server that includes a code compilation task, which is responsible for converting source code into an executable program and can add other functions. A sub-application refers to an independent application or component with specific functions in a larger software system. The startup information refers to the relevant parameters of the sub-application, including the port number and the sub-application name, which is not specifically limited in this embodiment.
[0056] In addition, it should be noted that configuration information refers to various parameters and settings prepared to allow the sub-application to run on the local end (client, server, etc.), including but not limited to resource paths, network configuration, etc. Configuring the configuration information means performing a series of operations to set or adjust the local environment according to the received sub-application startup information to meet the needs of accessing the local sub-application.
[0057] Exemplarily, sub-application startup information including the sub-application port number and application name sent by the compiling device is received, the startup information is parsed, and the corresponding environment and resources are configured to ensure that development and debugging of the application can be performed locally.
[0058] This embodiment provides a proxy configuration method, which automatically modifies the proxy configuration information according to the application startup information and allocates a local access path for the application, thereby reducing the steps for developers to manually modify the configuration file, thereby improving development efficiency.
[0059] In a feasible implementation manner, after the step of configuring the configuration information of the sub-application associated with the compiling device in the local end in step S10, steps S11 to S12 may be included:
[0060] Step S11, accessing the survival probe interface of the sub-application;
[0061] It should be noted that the survival probe interface refers to a special interface used to monitor and detect the running status of the sub-application. By sending a request to the interface and receiving a response, it can be determined whether the sub-application is running normally. Access refers to sending a request to a specified address (the URL or endpoint of the survival probe interface) through a network request and receiving response data from the address. Matching refers to clearly corresponding the sub-application to the survival probe interface through the application name, port or authentication information. The running status of the sub-application can be obtained by accessing the corresponding survival probe interface regularly or as needed.
[0062] Exemplarily, the survival probe interface of the activated sub-application is accessed periodically, for example, the proxy configuration information is read every 2 to 3 seconds, and the survival probe interface of the video sub-application is found to return a non-successful status code, and the subsequent steps are executed according to the settings. The survival probe interface of the activated sub-application can also be accessed in real time, and network requests are continuously sent to the activated sub-application to realize real-time monitoring of the survival probe interface. This embodiment does not specifically limit the time for accessing the survival probe interface.
[0063] Step S12: in the case of access failure, determine that the running state of the sub-application is in a disabled state, and remove the configuration information of the sub-application in the local terminal.
[0064] It should be noted that access failure refers to a state where a response or processing cannot be successfully obtained due to network problems, service failure, or insufficient permissions. The running state refers to the current operating mode or stage of the application or application component, including but not limited to active, disabled, and error states. The disabled state means that the sub-application cannot normally respond to requests or provide services.
[0065] For example, after sending an access request to the video application, an exception message is received, and the preset logical judgment mechanism determines that the sub-application is in an inactive running state. Then a removal operation is performed to delete the sub-application configuration information from the proxy configuration file to avoid subsequent unnecessary resource consumption and erroneous attempts.
[0066] In this implementation, by accessing the survival probe interface to detect the survival status of the sub-application, the proxy configuration file is adjusted in time, which reduces the operation of manually deleting configuration information and improves development efficiency.
[0067] In one possible implementation, please refer to Figure 2 , Figure 2 A branch flow diagram of the proxy configuration method of the present application is provided, and the proxy configuration method includes steps A10 to A40:
[0068] Step A10: upon receiving an access request for a target sub-application sent by a compiling device, reading a current proxy configuration file.
[0069] It should be noted that the target sub-application refers to a specific application or component that the user or system wants to start or deploy; the access request refers to the request sent by the compilation device to obtain the access address of the target sub-application. The proxy configuration file refers to a file used to set and manage the parameters of the network request proxy. The proxy parameters include proxy rules, server address, port number, and authentication information, which can be used to implement specific network policies.
[0070] Step A20, sending the access address of the target sub-application to the compiling device according to the proxy configuration file;
[0071] When the compilation device needs to access a target sub-application, it sends an access request containing the sub-application identifier (such as the application name) to the proxy server. After receiving this request, the proxy server retrieves the currently valid proxy configuration file, parses the access address of the target sub-application according to the rules specified in the proxy configuration file, and sends it back to the compilation device that requested the target sub-application. The compilation device can then establish a connection with the target sub-application based on the received access address and perform the required operation.
[0072] It can be understood that by automatically reading the proxy configuration file and sending the access address after receiving the access request, the efficiency and accuracy of application request distribution are improved, thereby improving the automation level of software development and process deployment and improving development efficiency.
[0073] Step A30, when the proxy configuration file does not record the configuration information of the target sub-application, sending the access address of the server storing the target sub-application to the compiling device;
[0074] It should be noted that the access address of the server refers to the unique network address used to identify and access the server where the non-local application service is located, including the IP address (Internet Protocol Address), port number and domain name.
[0075] For example, an e-commerce platform based on a micro-frontend architecture is developed, in which a sub-application is responsible for processing user orders. The sub-application is deployed on a remote server and is a non-local application. Therefore, when a request from an order sub-application (target sub-application) is received, its access address on the remote server is distributed.
[0076] Step A40: When the proxy configuration file records the configuration information of the target sub-application, the local access address of the target sub-application is sent to the compiling device.
[0077] It should be noted that the local access address refers to the access address of the target sub-application deployed on the local device, including the IP address and port number, etc., which is suitable for the local development and testing environment.
[0078] For example, the payment sub-application of the e-commerce platform is deployed on this end. When receiving the access request of the payment sub-application, it is determined that the application is a local application, and the current proxy configuration file is read to determine whether the application has been started locally. If the proxy configuration file does not record the configuration information of the application, it means that the application is not currently started on this end, and the server access address is distributed to the application to request the remote environment and resources. If the proxy configuration file records the configuration information of the application, it means that the application is currently on this end, and the URL and port number of the sub-application in the proxy configuration file are read, and local resources are directly allocated to facilitate developers to develop and debug the sub-application.
[0079] In this implementation, the access address is distributed through an automated inspection process, thereby achieving seamless connection between the local and server ends, flexibly adapting to changes in the development environment, and thus improving development efficiency.
[0080] In a feasible implementation, the proxy configuration method includes:
[0081] Step A60, dynamically detecting whether the proxy configuration file has changed;
[0082] Step A70: reload the proxy configuration file when it is detected that the proxy configuration file has changed.
[0083] It should be noted that dynamic detection refers to checking the contents of the proxy configuration file in real time, periodically or in a triggered manner, and determining whether the file has changed by comparing the file's timestamp, checksum or content difference. Reloading refers to reading and applying the new configuration file content to replace the old configuration information after detecting that the configuration file has changed. This process may include parsing the configuration file, configuring the data structure or restarting related service components.
[0084] For example, when a developer mistakenly closes the payment sub-application currently in use, the compilation device receives the stop instruction of the payment sub-application and deactivates the survival probe interface of the sub-application. The proxy server fails to access the survival probe interface of the sub-application, removes the configuration information of the sub-application in the proxy configuration file, detects changes in the proxy configuration file, re-reads and applies the new configuration content, and promptly changes the access address of the sub-application from the local to the server, effectively avoiding development errors caused by changes in proxy settings.
[0085] For example, when a developer starts a new sub-application, a change in the proxy configuration file is detected, and the latest configuration file is automatically loaded, without the developer having to restart the server to reload the proxy configuration file.
[0086] In this implementation, by detecting changes in the proxy configuration file and automatically reloading the configuration, the time for developers to manually restart the proxy server is reduced. At the same time, dynamic switching of the proxy between the server and local access is achieved, which reduces the time for developers to manually modify the proxy configuration file, thereby improving development efficiency.
[0087] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later.
[0088] On this basis, the proxy configuration method further includes step E10:
[0089] Step E10, when the associated sub-application is compiled, the startup information of the sub-application is sent to the proxy server, so that the proxy server configures the configuration information of the sub-application in the proxy server itself according to the startup information.
[0090] It should be noted that compilation completion refers to the completion of the process of converting the source code into machine code or intermediate code that can be directly executed by the computer after being processed by the compiler, indicating that the sub-application is ready to be deployed and run.
[0091] Exemplarily, when the compilation of the product recommendation sub-application is completed, startup information including the sub-application name and the currently assigned port number is generated and sent to the proxy server so that the proxy server modifies the configuration information for the sub-application, thereby achieving local access to the sub-application.
[0092] In this embodiment, by automatically sending the startup information after the compilation is completed, human intervention and errors are reduced, thereby improving development efficiency.
[0093] In a feasible implementation manner, before the step of sending the sub-application startup information to the proxy server in step E10, the following step is further included:
[0094] Step E01, when receiving a startup instruction for a sub-application, enable the survival probe interface matching the sub-application, so that the proxy server can determine the running status of the sub-application by accessing the survival probe interface, and remove the configuration information of the sub-application in the proxy server when the sub-application is disabled.
[0095] It should be noted that the startup instruction refers to a command or signal used to start a sub-application; enabling refers to activating or starting a certain function or interface.
[0096] For example, after receiving the startup instruction of the payment processing sub-application, the survival probe interface supporting the application is enabled. The proxy server can periodically access the interface to confirm that the payment processing sub-application is running normally. If the payment processing sub-application stops serving due to a fault, the survival probe interface will stop responding. After the proxy server detects this change, it will immediately remove the configuration information of the payment processing sub-application, and subsequent access to the application will be distributed to the access address of the server.
[0097] In this implementation, by enabling the survival probe interface to reflect the current running status of the sub-application associated with it and promptly removing the configuration information of the inactive sub-application, the time and error rate of manual deployment of sub-applications can be reduced, allowing developers to focus on coding and innovation, thereby improving development efficiency.
[0098] In a feasible implementation manner, after the step of enabling the survival probe interface matching the sub-application in step E01, the following further steps are included:
[0099] Step E02 : when receiving a stop instruction from a sub-application, deactivate the survival probe interface of the sub-application.
[0100] It should be noted that the stop instruction is a control signal used to instruct a running program or process to immediately stop its current operation and execution.
[0101] For example, the developer plans to perform maintenance on the user authentication sub-application and issues a stop command to instruct the terminal to stop the operation of the user authentication sub-application. After receiving the stop command, the user authentication sub-application is identified and its survival probe interface is disabled so that the proxy server senses that the user authentication sub-application has stopped running and removes the proxy configuration information of the user authentication sub-application.
[0102] In this implementation, by automatically managing the survival probe interface of the sub-application, it is ensured that the proxy server can obtain the actual running status of the sub-application, so as to adjust the proxy configuration information.
[0103] In order to help understand the above technical solution, an embodiment of a proxy configuration method is provided for illustration. Figure 3 , Figure 3 This is a schematic diagram of the two-end interaction of the proxy configuration method of this application, specifically:
[0104] Step S101: When a sub-application starts to be compiled, a compiling device enables a survival probe interface matching the sub-application.
[0105] Step S102: When the sub-application is compiled, the compiling device sends the startup information of the sub-application to the proxy server.
[0106] Step S103: upon receiving the sub-application startup information sent by the compiling device, the proxy server configures the configuration information of the sub-application to which the compiling device belongs in the local terminal according to the sub-application startup information.
[0107] Step S104: The proxy server accesses the survival probe interface of the sub-application recorded in the proxy configuration file.
[0108] Step S105 : upon receiving a stop instruction from the sub-application, the compiling device deactivates the survival probe interface of the sub-application.
[0109] Step S106: The proxy server accesses the survival probe interface of the sub-application recorded in the proxy configuration file.
[0110] Step S107: In the case of access failure, the proxy server determines that the sub-application is in an inactive running state and removes the configuration information of the sub-application.
[0111] In order to help understand the above technical solution, a more complete embodiment of a proxy configuration method is provided for illustration. Figure 4 , Figure 4 This is a schematic diagram of the overall structure of the proxy configuration method of this application. The overall structure can be roughly divided into three parts: proxy server, local application and server application. Specifically:
[0112] The proxy server can perform configuration storage, proxy matching, local application detection and application request distribution. Configuration storage is to store the changes to the configuration information in the proxy configuration file for real-time reading by the server; proxy matching can modify the proxy configuration file after receiving the startup information of the local sub-application, and receive application access requests, read the configuration information in the proxy configuration file, and distribute subsequent application requests; local application detection means dynamically accessing the survival probe interface of the corresponding sub-application after the sub-application is started, so as to determine the running status of the corresponding sub-application; application request distribution is to determine whether the requested application has been started locally based on the configuration information in the proxy configuration file. If it has been started locally, the local access address is distributed to the application, otherwise the access address of the server where the application is stored is distributed to it.
[0113] Each local application corresponds to a compilation device, which includes the sub-application development tools and survival probe interface. The development tool is used to develop and compile the sub-application and send startup information to the proxy server after the application is successfully started. The survival probe interface is associated with the running status of the sub-application. After the sub-application is started, the survival probe interface is enabled. If the sub-application is in an inactive state, the survival probe interface is also closed and cannot respond to the interface access request of the proxy server.
[0114] The server application includes sub-applications deployed in a remote environment. When the compilation device requests application C, the proxy server sends the access address of the server storing application C to the compilation device. The compilation device can establish a connection with application C and perform the required operations based on the received access address.
[0115] For example, to help understand the implementation process of the proxy configuration method obtained by combining this embodiment with the above embodiments, please refer to Figure 5 , Figure 5 This is a schematic diagram of the overall interaction scenario of the proxy configuration method of this application, specifically:
[0116] The application A compilation device is responsible for the source code compilation and execution of application A. When the developer starts application A, the compilation device receives the startup instruction, starts the development tool of the application on an idle port, and enables the middleware associated with the application - the survival probe interface. Since the proxy server cannot directly access the local application to determine its running status, the survival probe interface middleware is set to establish a connection between the local application and the proxy server. The proxy server determines the running status of the local application by accessing the survival probe interface.
[0117] When application A is started and the development tool completes compilation, or when the developer writes and compiles the code, the compilation device sends the startup information of application A to the proxy server, including but not limited to the application name and port number.
[0118] The proxy server receives the startup information, and according to the startup information, adds the configuration information of application A to the proxy configuration file, and automatically reloads the proxy configuration file after the modification of the proxy configuration file is completed. For application A with configuration information recorded in the proxy configuration file, the proxy server will access the survival probe interface of application A regularly or irregularly, and when the survival probe interface of application A responds to the access request of the proxy server, it means that the access is successful, and it can be determined that application A is in an active state.
[0119] When the developer stops application A, the compilation device receives the stop instruction of application A, stops the service provided by the corresponding port, and disables the survival probe interface. At this time, the proxy server accesses the survival probe interface of application A, but does not receive a response from the survival probe interface, and the access fails. It is determined that application A is in a disabled state, and the configuration information of application A in the proxy configuration file is removed, and the proxy configuration file is reloaded according to the predetermined rules.
[0120] The application B compilation device represents a type of compilation device for local applications, and has the same structure and principle as the application A compilation device, which will not be described in detail here.
[0121] When developers request other applications during the development and debugging of application B, the proxy server receives the access request of the application, reads the current proxy configuration file, and sends the local access address of application A to the compilation device of application B according to the configuration information if the request is for application A and application A has been started locally. Therefore, application B can directly access the locally deployed application A and perform corresponding operations. If the request is for sub-application C deployed on other servers, the access address of the server storing application C is sent to the compilation device of application B. Based on this access address, application B can establish a connection with application C on the server and perform corresponding operations.
[0122] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the proxy configuration method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0123] The present application also provides a proxy configuration device, please refer to Figure 6 , the proxy configuration device is applied to the proxy server, and the device includes:
[0124] The proxy module 10 is used to configure the configuration information of the sub-application associated with the compilation device in the local end according to the startup information when the startup information of the sub-application sent by the compilation device is received, wherein the startup information is the information sent by the compilation device when the compilation of the sub-application associated with it is completed.
[0125] Optionally, the proxy module 10 is further used for:
[0126] Access the survival probe interface of the sub-application;
[0127] In the case of access failure, the running state of the sub-application is determined to be a disabled state, and the configuration information of the sub-application in the local terminal is removed.
[0128] Optionally, the proxy module 10 is further used for:
[0129] Upon receiving an access request for a target sub-application sent by a compiling device, reading a current proxy configuration file;
[0130] According to the proxy configuration file, send the access address of the target sub-application to the compilation device.
[0131] Optionally, the proxy module 10 is further used for:
[0132] In the case where the proxy configuration file does not record the configuration information of the target sub-application, sending the access address of the server storing the target sub-application to the compiling device; or,
[0133] When the proxy configuration file records the configuration information of the target sub-application, the local access address of the target sub-application is sent to the compiling device.
[0134] Optionally, the proxy module 10 is further used for:
[0135] Check if the proxy configuration file has changed;
[0136] Reloads the proxy configuration file upon detecting changes to the proxy configuration file.
[0137] The proxy configuration device provided in the embodiment of the present application adopts the proxy configuration method in the above embodiment to improve development efficiency. Compared with the prior art, the beneficial effects of the proxy configuration device provided in the present application are the same as the beneficial effects of the proxy configuration method provided in the above embodiment, and other technical features in the proxy configuration device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0138] This application embodiment also provides another proxy configuration device, please refer to Figure 7 , the proxy configuration device is applied to the compilation device, and the device includes:
[0139] The compiling module 20 is used to send the startup information of the sub-application to the proxy server when the compilation of the associated sub-application is completed, so that the proxy server configures the configuration information of the sub-application in the proxy server itself according to the startup information.
[0140] Optionally, the compiling module 20 is further used for:
[0141] When receiving a startup instruction for a sub-application, enable the survival probe interface matching the sub-application so that the proxy server can determine the running status of the sub-application by accessing the survival probe interface, and remove the configuration information of the sub-application in the proxy server when the sub-application is disabled.
[0142] Optionally, the compiling module 20 is further used for:
[0143] When a stop instruction of the sub-application is received, the survival probe interface of the sub-application is disabled.
[0144] The proxy configuration device provided in the embodiment of the present application adopts the proxy configuration method in the above embodiment to improve development efficiency. Compared with the prior art, the beneficial effects of the proxy configuration device provided in the present application are the same as the beneficial effects of the proxy configuration method provided in the above embodiment, and other technical features in the proxy configuration device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0145] An embodiment of the present application provides a proxy server, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the proxy configuration method in the above-mentioned embodiment 1.
[0146] Reference below Figure 8 , which shows a schematic diagram of the structure of a proxy server suitable for implementing the embodiment of the present application. The proxy server in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The proxy server shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0147] like Figure 8 As shown, the proxy server may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the proxy server are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the proxy server to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a powerful server with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0148] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0149] The proxy server provided in the embodiment of the present application adopts the proxy configuration method in the above embodiment to improve development efficiency. Compared with the prior art, the beneficial effects of the proxy server provided in the embodiment of the present application are the same as the beneficial effects of the proxy configuration method provided in the above embodiment, and other technical features in the proxy server are the same as those disclosed in the method of the previous embodiment, which will not be repeated here.
[0150] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0151] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0152] An embodiment of the present application provides a compilation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the proxy configuration method in the above-mentioned embodiment 1.
[0153] Reference below Fig. 9, which shows a schematic diagram of the structure of a compiling device suitable for implementing the embodiments of the present application. The compiling device in the embodiments of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The compilation device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0154] like Fig. 9 As shown, the compiling device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the compiling device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the compilation device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a powerful server with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0155] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0156] The compilation device provided in the embodiment of the present application adopts the proxy configuration method in the above embodiment to improve development efficiency. Compared with the prior art, the beneficial effects of the compilation device provided in the embodiment of the present application are the same as the beneficial effects of the proxy configuration method provided in the above embodiment, and other technical features in the compilation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0157] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0158] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0159] An embodiment of the present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the proxy configuration method in the above embodiment.
[0160] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0161] The computer-readable storage medium may be included in the proxy server and / or the compiling device; or may exist independently without being assembled into the proxy server and / or the compiling device.
[0162] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the proxy server, the proxy server: upon receiving the startup information of the sub-application sent by the compilation device, configures the configuration information of the sub-application belonging to the compilation device in the local end according to the startup information, wherein the startup information is the information sent by the compilation device when the compilation of the sub-application on the local end is completed.
[0163] When the above one or more programs are executed by the compiling device, the compiling device sends the startup information of the sub-application to the proxy server when the compilation of the sub-application on the local end is completed, so that the proxy server configures the configuration information of the sub-application on the local end of the proxy server according to the startup information.
[0164] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0165] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0166] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0167] The readable storage medium provided in the embodiment of the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned proxy configuration, which can improve development efficiency. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the embodiment of the present application are the same as the beneficial effects of the proxy configuration method provided in the above-mentioned embodiment, and will not be repeated here.
[0168] An embodiment of the present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned proxy configuration method when executed by a processor.
[0169] The computer program product provided in the embodiment of the present application can improve development efficiency. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiment of the present application are the same as the beneficial effects of the proxy configuration method provided in the above embodiment, which will not be repeated here.
[0170] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A proxy configuration method, It is characterized in that The proxy configuration method is applied to a proxy server, and the method comprises: When startup information of a sub-application sent by a compilation device is received, configuration information of the sub-application associated with the compilation device in the local end is configured according to the startup information, wherein the startup information is information sent by the compilation device when compilation of the sub-application associated with the compilation device is completed.
2. The proxy configuration method according to claim 1, It is characterized in that After the step of configuring the configuration information of the sub-application associated with the compiling device in the local end, the method further includes: Access the survival probe interface of the sub-application; In the event of access failure, it is determined that the running state of the sub-application is in a disabled state, and the configuration information of the sub-application in the local end is removed.
3. The proxy configuration method according to claim 1, It is characterized in that The proxy configuration method further includes: Upon receiving an access request for a target sub-application sent by the compiling device, reading a current proxy configuration file; According to the proxy configuration file, the access address of the target sub-application is sent to the compiling device.
4. The proxy configuration method according to claim 3, It is characterized in that The step of sending the access address of the target sub-application to the compiling device according to the proxy configuration file includes: In the case where the proxy configuration file does not record the configuration information of the target sub-application, sending the access address of the server storing the target sub-application to the compiling device; or, In a case where the proxy configuration file records the configuration information of the target sub-application, the local access address of the target sub-application is sent to the compiling device.
5. A proxy configuration method, It is characterized in that The proxy configuration method is applied to a compiling device, and the method includes: When the compilation of the associated sub-application is completed, the startup information of the sub-application is sent to the proxy server, so that the proxy server configures the configuration information of the sub-application in the proxy server itself according to the startup information.
6. The proxy configuration method according to claim 5, It is characterized in that Before the step of sending the startup information of the sub-application to the proxy server, the method further includes: When a startup instruction for the sub-application is received, the survival probe interface matching the sub-application is enabled, so that the proxy server can determine the running status of the sub-application by accessing the survival probe interface, and when the sub-application is disabled, remove the configuration information of the sub-application in the proxy server itself.
7. The proxy configuration method according to claim 6, It is characterized in that After the step of enabling the survival probe interface matching the sub-application, the method further includes: When a stop instruction of the sub-application is received, the survival probe interface of the sub-application is disabled.
8. A proxy server, It is characterized in that The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the proxy configuration method according to any one of claims 1 to 4.
9. A compiling device, It is characterized in that The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the proxy configuration method according to any one of claims 5 to 7.
10. A storage medium, It is characterized in that The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the proxy configuration method according to any one of claims 1 to 7 are implemented.
