Method, device and storage medium for generating web application program

By obtaining and configuring information about local applications and generating cross-platform and language web applications, the problem of poor universality in the prior art is solved and the universality of accessing local applications on any platform is achieved.

CN113918213BActive Publication Date: 2024-12-24CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010663334.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-10
Publication Date
2024-12-24
Estimated Expiration
2040-07-10

AI Technical Summary

Technical Problem

In the prior art, the method of accessing local applications through the network is poor in versatility, and browser add-ons need to be developed separately for different browsers. URL Protocol is only effective for Windows systems and cannot achieve cross-platform and language universality.

Method used

By obtaining the host address, application code path, port identification, input and output parameter information of the target application, configuring the listening port, loading the application code, and generating corresponding web applications, achieving cross-platform and language universality.

Benefits of technology

It realizes access to local applications developed through the network on any platform through the network, improving the universality and accessibility of web applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113918213B_ABST
    Figure CN113918213B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and storage medium for generating a web application, which relates to the field of communication technology and is helpful to improve the versatility of web applications. The method comprises: obtaining the host address where the target application is located, the path where the application code of the target application is located, the port identifier corresponding to the target application, the name of the input parameter of the target application, the type of the input parameter, the name of the output parameter of the target application and the type of the output parameter; configuring a listening port for the target application according to the port identifier; loading the application code of the target application according to the path; generating a web application corresponding to the target application according to the host address, port identifier, the name of the input parameter, the type of the input parameter, the name of the output parameter, the type of the output parameter and the application code of the target application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method, device and storage medium for generating a web application. Background Art

[0002] Currently, there are two main ways to access local applications through the network: 1. Browser plug-in method; 2. Method defined by uniform resource locator protocol (URL protocol). Although both methods can achieve access to local applications through the network, they both have the problem of poor universality. The browser plug-in method needs to be developed separately for different browsers. The method defined by URL Protocol is only valid for Windows systems.

[0003] Therefore, how to generate more universal web applications from local applications becomes a problem that needs to be solved. Summary of the invention

[0004] The present application provides a method, device and storage medium for generating a web application, which helps to improve the versatility of the web application.

[0005] In a first aspect, a method for generating a web application is provided, the method comprising: obtaining a host address where a target application is located, a path where an application code of the target application is located, a port identifier corresponding to the target application, names of input parameters of the target application and types of input parameters, and names of output parameters of the target application and types of output parameters; configuring a listening port for the target application according to the port identifier; loading the application code of the target application according to the path where the application code of the target application is located; generating a web application corresponding to the target application according to the host address where the target application is located, the port identifier corresponding to the target application, names of input parameters of the target application and types of input parameters, names of output parameters of the target application and types of output parameters, and the application code of the target application.

[0006] In this way, for a local application developed in any language, a web application of the local application can be generated on any platform using the method provided in this application, so that a computer device can easily access the local application through the network, thereby improving the versatility of the generated web application.

[0007] In one possible implementation, the above-mentioned "obtaining the host address where the target application is located, the path where the application code of the target application is located, the port identifier corresponding to the target application, the name of the input parameter of the target application, the type of the input parameter, the name of the output parameter of the target application, and the type of the output parameter" includes: reading the host address where the target application is located, the path where the application code of the target application is located, the port identifier corresponding to the target application, the name of the input parameter of the target application, the type of the input parameter, the name of the output parameter of the target application, and the type of the output parameter from a pre-stored local application definition file.

[0008] In another possible implementation, the local application definition file is a proto file.

[0009] In another possible implementation, the method further includes: obtaining the name of the sub-function of the target application, the name of the input parameter of the sub-function of the target application, the type of the input parameter of the sub-function, the name of the output parameter of the sub-function, and the type of the output parameter of the sub-function; generating a web application corresponding to the sub-function according to the host address, the port identifier, the name of the sub-function, the name of the input parameter of the sub-function of the target application, the type of the input parameter of the sub-function, the name of the output parameter of the sub-function, and the type of the output parameter of the sub-function.

[0010] In a second aspect, a method for accessing an application via a network is provided, the method comprising: obtaining a web page resource request; the web page resource request is used to access a target function of a target application; the web page resource request is parsed according to a predefined host address of the target application, a port identifier corresponding to the target application, a name of an input parameter of the target function, and a type of the input parameter of the target function, to obtain a value of the input parameter of the target function and an execution entry of the target function; according to the execution entry of the target function, the value of the input parameter of the target function is input into the target function, the target function is run, and the value of the output parameter of the target function is obtained.

[0011] In this way, by parsing the web page resource usage request, the value of the input parameter of the target function and the execution entry of the target function are obtained, and the target function of the local application is executed, it is possible to access the local application developed in any language deployed on any platform through the network, thereby improving the versatility of the web application generated by the local application.

[0012] In a possible implementation, the method further includes: converting the value of the output parameter of the target function according to the predefined type and name of the output parameter of the target function; and responding to the webpage resource request according to the converted value of the output parameter.

[0013] In another possible implementation, the webpage resource request is a GET type request or a POST type request.

[0014] In another possible implementation, at least one of the host address of the target application, the port identifier, the name of the input parameter of the target function, the type of the input parameter of the target function, the name of the output parameter of the target function, or the type of the output parameter of the target function is stored in the Proto file.

[0015] A third aspect provides a device for generating a web application, which can be used to execute any method provided in any possible implementation manner of the first aspect to the first aspect.

[0016] According to the third aspect, in a first possible implementation manner of the third aspect, the device includes a plurality of functional modules, and the plurality of functional modules are respectively used to execute corresponding steps in any one of the methods provided in the first aspect.

[0017] According to the third aspect, in a second possible implementation manner of the third aspect, the network controller may include a processor, the processor being used to execute any of the methods provided in any of the possible implementation manners of the first aspect to the first aspect. The network controller may also include a memory, the memory being used to store a computer program so that the processor can call the computer program to execute any of the methods provided in any of the possible implementation manners of the first aspect to the first aspect.

[0018] In a fourth aspect, a device for accessing an application via a network is provided, which can be used to execute any method provided in any possible implementation of the second aspect above.

[0019] According to the fourth aspect, in a first possible implementation manner of the fourth aspect, the device includes a plurality of functional modules, which are respectively used to execute corresponding steps in any one of the methods provided in the second aspect.

[0020] According to the fourth aspect, in a second possible implementation manner of the fourth aspect, the network controller may include a processor, the processor being used to execute any of the methods provided in any of the possible implementation manners of the second aspect to the second aspect. The network controller may also include a memory, the memory being used to store a computer program so that the processor can call the computer program to execute any of the methods provided in any of the possible implementation manners of the second aspect to the second aspect.

[0021] In a fifth aspect, the present application provides a computer device, comprising a memory and a processor. The memory and the processor are coupled. The memory is used to store a computer program code, and the computer program code includes a computer instruction. When the processor executes the computer instruction, the computer device executes the method as described in any possible implementation of the first aspect, or causes the computer device to execute the method as described in any possible implementation of the second aspect.

[0022] In a sixth aspect, the present application provides a chip system, which is applied to a computer device, and the chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by a line; the interface circuit is used to receive a signal from the memory of the computer device and send the signal to the processor, and the signal includes a computer instruction stored in the memory. When the processor executes the computer instruction, the computer device executes the method described in any possible implementation of the first aspect, or causes the computer device to execute the method described in any possible implementation of the second aspect.

[0023] In a seventh aspect, the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on a computer device, the computer device executes the method as described in any possible implementation of the first aspect, or the computer device executes the method as described in any possible implementation of the second aspect.

[0024] In an eighth aspect, the present application provides a computer program product, which includes computer instructions. When the computer instructions are executed on a computer device, the computer device executes the method as described in any possible implementation of the first aspect, or the computer device executes the method as described in any possible implementation of the second aspect.

[0025] It can be understood that any of the above-mentioned devices for generating web applications, devices for accessing applications via a network, computer-readable storage media, computer program products or chips, etc. can be applied to the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods and will not be repeated here.

[0026] These and other aspects of the present application will become more apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A schematic diagram of the structure of a computer device to which the technical solution provided in the embodiments of the present application is applicable;

[0028] Figure 2 A flowchart of a method for generating a web application provided in an embodiment of the present application;

[0029] Figure 3 A flowchart of a method for accessing an application via a network provided in an embodiment of the present application;

[0030] Figure 4 A schematic diagram of the structure of a device for generating a web application provided in an embodiment of the present application;

[0031] Figure 5 A schematic diagram of the structure of a device for accessing an application via a network provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0033] In the embodiments of the present application, "at least one" means one or more, and "plurality" means two or more.

[0034] In the embodiments of the present application, "and / or" is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0035] like Figure 1 , which is a schematic diagram of the structure of a computer device applicable to the technical solution provided in an embodiment of the present application. Figure 1 The computer device 10 may include at least one processor 101 , a communication line 102 , a memory 103 and at least one communication interface 104 .

[0036] The processor 101 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.

[0037] The communication line 102 may include at least one path, such as a data bus, and / or a control bus, for transmitting information between the above components (such as at least one processor 101, the communication line 102, the memory 103 and at least one communication interface 104).

[0038] The communication interface 104 uses any transceiver or other device for communicating with other devices or communication networks, such as wide area networks (WAN), local area networks (LAN), etc.

[0039] The memory 103 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 103 may be independent and connected to the processor 101 via the communication line 102. The memory 103 may also be integrated with the processor 101. The memory 103 provided in the embodiment of the present application generally includes a non-volatile memory. The memory 103 is used to store computer instructions for executing the solution of the present application, and the execution is controlled by the processor 101. The processor 101 is used to execute the computer instructions stored in the memory 103, thereby implementing the method provided in the following embodiments of the present application.

[0040] The storage 103 includes a memory and a hard disk.

[0041] Optionally, the computer instructions in the embodiments of the present application may also be referred to as application code or system, which is not specifically limited in the embodiments of the present application.

[0042] In a specific implementation, as an embodiment, the computer device 10 may include multiple processors, each of which may be a single-CPU processor or a multi-CPU processor. The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0043] In a specific implementation, as an embodiment, the computer device 10 may further include an output device 105 and / or an input device 106. The output device 105 communicates with the processor 101 and may display information in a variety of ways. For example, the output device 105 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 106 communicates with the processor 101 and may receive user input in a variety of ways. For example, the input device 106 may be a mouse, a keyboard, a touch screen device, or a sensor device.

[0044] It should be noted that Figure 1 The computer device shown is only an example and does not limit the computer devices applicable to the embodiments of the present application. In actual implementation, the computer device may include Figure 1 More or fewer devices or components than those shown.

[0045] The embodiments of the present application can be applied to the following scenarios: expanding the service scope of local applications so that computer devices can access local non-web applications through the network.

[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0047] Figure 2 A schematic diagram of a method for generating a web application provided by an embodiment of the present application is shown. Figure 2 As shown, the method may include the following steps:

[0048] Optionally, S100: the computer device generates a local application definition file, wherein the local application definition file includes the host address where the target application is located, the path where the application code of the target application is located, the port identifier corresponding to the target application, the name of the input parameter of the target application, the type of the input parameter, the name of the output parameter of the target application, and the type of the output parameter.

[0049] It should be noted that the embodiment of the present application does not limit the format of the local application definition file. In a possible implementation, the local application definition file is a proto file. The proto file is a file that complies with protobuf. Protobuf is a platform-independent, language-independent, and extensible protocol for serializing data structures for network communication and data storage. The structure of the data can be defined, and then the generated source code can be used to write and read the defined data structure in various languages ​​in various data streams.

[0050] Exemplarily, the local application definition file includes the content shown in Table 1:

[0051] Table 1

[0052]

[0053] The version number in Table 1 is the Protocol Buffers version number, the application name is application 1, the corresponding port identifier of application 1 is 8080, the path where the application code of application 1 is located is: / path / to / code / bqUfmifuwpKGwPIZiJwgzZfExydiBWMz / , the host address where application 1 is located is: localhost The type of input parameter of application 1 is: Person Exemplary, message Person{

[0054] string name = 1;

[0055] int32 shengao=2;

[0056] int32 timezhong=3;

[0057] }The output parameter type is: PersonResponse, for example, message PersonResponse{

[0058] string title = 1;

[0059] }

[0060] It is understandable that the local application definition file may also include the name of the sub-function of the target application, the type of the input parameter of the sub-function, the name of the input parameter of the sub-function, the type of the output parameter of the sub-function, and the name of the output parameter of the sub-function.

[0061] S101: The computer device obtains the host address where the target application is located, the path where the application code of the target application is located, the port identifier corresponding to the target application, the name of the input parameter of the target application, the type of the input parameter, the name of the output parameter of the target application, and the type of the output parameter.

[0062] In one possible implementation, a computer device reads from a pre-stored local application definition file the host address of the target application, the path where the application code of the target application is located, the port identifier corresponding to the target application, the name of the input parameter of the target application, the type of the input parameter, the name of the output parameter of the target application, and the type of the output parameter.

[0063] S102: The computer device configures a listening port for the target application according to the port identifier corresponding to the target application.

[0064] Specifically, the computer device monitors the port indicated by the port identifier corresponding to the target application to obtain a webpage resource request for the target application from the port.

[0065] S103: The computer device loads the application code of the target application according to the path where the application code of the target application is located.

[0066] Specifically, the computer device loads the application code of the target application to the loading address according to the path where the application code of the target application is located. Exemplarily, the loading address may be a flash memory address.

[0067] S104: The computer device generates a web application corresponding to the target application according to the host address where the target application is located, the port identifier corresponding to the target application, the name of the target application input parameter, the type of the input parameter, the name of the output parameter, the type of the output parameter and the application code of the target application.

[0068] Specifically, the application server in the computer device sets the name of the input parameter, the type of the input parameter, the name of the output parameter and the type of the output parameter of the target application according to the host address where the target application is located, the port identifier corresponding to the target application, the name of the input parameter of the target application, the type of the input parameter, the name of the output parameter of the target application and the type of the output parameter, so that the input parameter format and the output parameter format of the target application are consistent with the input parameter format and the output parameter format of the target application in the application definition file, the target application is started, and a web application corresponding to the target application is generated.

[0069] It is understandable that the computer device can also generate a web application corresponding to the sub-function of the target application based on the host address of the target application, the port identifier corresponding to the target application, the name of the input parameter of the sub-function of the target application, the type of the input parameter of the sub-function, the name of the output parameter of the sub-function and the type of the output parameter of the sub-function, and the application code of the target application.

[0070] In this way, sub-functions of local applications can also be accessed through the network, further expanding the scope of use of local applications.

[0071] In an embodiment of the present application, for a local application developed in any language, a web application of the local application can be generated on any platform using the method provided by the present application, so that a computer device can easily access the local application through the network, thereby improving the versatility of the generated web application.

[0072] Figure 3 FIG. 1 is a flow chart showing a method for accessing an application program via a network provided by an embodiment of the present application. Figure 3 As shown, the method may include the following steps:

[0073] S200: The computer device obtains a web resource request, where the web resource request is used to access a target function of a target application.

[0074] Among them, the above-mentioned web page resource request may include various forms, such as links, http web page requests or protocols, etc., which are not limited in this embodiment of the present application.

[0075] In a possible implementation, the webpage resource request is any one of a GET type request and a POST type request.

[0076] It is understandable that the type of the webpage resource request and the target function of the target application program that the webpage resource request is used to execute are unique, that is, different types of webpage resource requests may refer to different sub-functions used to execute different applications.

[0077] S201: The computer device parses the web resource request according to the predefined host address of the target application, the port identifier corresponding to the target application, the name of the input parameter of the target function and the type of the input parameter of the target function to obtain the value of the input parameter of the target function and the execution entry of the target function.

[0078] Specifically, when the computer device receives a web resource request, it parses the resource locator URL contained in the web resource request according to the predefined host address of the target application, the port identifier corresponding to the target application, the name of the input parameter of the target function, and the type of the input parameter of the target function, to obtain the execution entry address of the target function, and aligns the "name of the input parameter of the target function and the type of the input parameter" contained in the web resource request with the "name of the actual input parameter of the target function and the type of the input parameter".

[0079] In one possible implementation, the name of the predefined input parameter of the target function is consistent with the name of the input parameter included in the web page resource request. The computer device can determine the value of the input parameter of the target function corresponding to the name of the input parameter based on the name of the input parameter, and convert the type of the value of the input parameter to the type of the actual input parameter of the target function.

[0080] In another possible implementation, a correspondence between an identifier of an input parameter in a web resource request and an identifier of an input parameter of a target function is pre-stored in a computer device. The computer device determines, based on the correspondence, a value of the input parameter of the target function corresponding to the name of the input parameter in the web resource request, and converts the type of the input parameter value into the type of the actual input parameter of the target function.

[0081] Optionally, at least one of the host address of the target application, the port identifier of the target application, the name of the input parameter of the target function, the type of the input parameter of the target function, the name of the output parameter of the target function, or the type of the output parameter of the target function is stored in the Proto file.

[0082] Exemplarily, if the URL included in the request is "http: / / localhost:8080 / subprog1 / function1", the URL can be partitioned. For example, the part after "http: / / " in the URL can be obtained to get "localhost:8080 / subprog1 / function1". Among them, localhost / subprog1 / function1 corresponds to the execution entry (i.e., execution address) of the target function function1 in the target application subprog1, 8080 is the access port of the target application, and the parameters included in the request are {"name":"张三",

[0083] "shengao":180,

[0084] "tizhong":160,

[0085] } Among them, the value of the input parameter name is "张三", the value of the input parameter shengao is 180, and the value of the input parameter tizhong is 160.

[0086] S202: The computer device inputs the values of the input parameters of the target function into the target function according to the execution entry of the target function, runs the target function, and obtains the values of the output parameters of the target function.

[0087] Optionally, S203: The computer device converts the values of the output parameters of the target function according to the predefined types and names of the output parameters of the target function, and responds to the web page resource request according to the converted values of the output parameters.

[0088] In a possible implementation manner, the computer device generates a response object according to the converted values of the output parameters, and this response object is used to respond to the web page resource request.

[0089] In an example, when the value of the output parameter of the target function is not empty, the value of the response is the value of the output parameter of the target function, and the status code of the response is 203. When the value of the output parameter of the target function is empty, the value of the response is empty, and the status code of the response is 200. When the target function does not exist, the status code of the response is set to 404. It can be understood that the specific rules for setting the status code of the response can be preset according to the REST specification.

[0090] In this embodiment, the computer device parses the web resource usage request to obtain the value of the input parameter of the target function and the execution entry of the target function, and executes the target function of the local application, thereby realizing network access to local applications developed in any language deployed on any platform, thereby improving the versatility of web applications generated by local applications.

[0091] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily appreciate that, in combination with the method steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0092] The embodiment of the present application can divide the functional modules of the device for generating a web application according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0093] like Figure 4 As shown, it is a schematic diagram of the structure of a device for generating a web application provided in an embodiment of the present application. The device 40 for generating a web application can be used to execute any of the above embodiments (such as Figure 2The function performed by the computer device in the embodiment shown). The device 40 for generating a web application includes: an acquisition unit 401, a configuration unit 402, a loading unit 403 and a generation unit 404. Among them, the acquisition unit 401: is used to obtain the host address where the target application is located, the path where the application code of the target application is located, the port identifier corresponding to the target application, the name of the input parameter of the target application, the type of the input parameter, the name of the output parameter of the target application, and the type of the output parameter. The configuration unit 402: is used to configure a listening port for the target application according to the port identifier. The loading unit 403: is used to load the application code of the target application according to the path where the application code of the target application is located. The generation unit 404 is used to generate a web application corresponding to the target application according to the host address, the port identifier, the name of the input parameter, the type of the input parameter, the name of the output parameter, the type of the output parameter and the application code of the target application. For example, in combination Figure 2 , the acquisition unit 401 can be used to execute S101. The configuration unit 402 can be used to execute S102. The loading unit 403 can be used to execute S103. The generation unit 404 can be used to execute S104.

[0094] Optionally, the acquisition unit 401 is specifically used to read from a pre-stored local application definition file the host address of the target application, the path where the application code of the target application is located, the port identifier corresponding to the target application, the name of the input parameter of the target application, the type of the input parameter, the name of the output parameter of the target application, and the type of the output parameter.

[0095] Optionally, the local application definition file is a proto file.

[0096] Optionally, the acquisition unit 401 is also used to: acquire the name of the sub-function of the target application, the name of the input parameter of the sub-function of the target application and the type of the input parameter of the sub-function, the name of the output parameter of the sub-function and the type of the output parameter of the sub-function; the generation unit 404 is also used to generate a web application corresponding to the sub-function according to the host address, port identifier, the name of the sub-function, the name of the input parameter of the sub-function of the target application, the type of the input parameter of the sub-function, the name of the output parameter of the sub-function and the type of the output parameter of the sub-function.

[0097] In one example, see Figure 1 The processing functions of the acquisition unit 401, the configuration unit 402, the loading unit 403 and the generation unit 404 can all be Figure 1 The processor 101 in the embodiment calls the computer program stored in the memory 103 for implementation.

[0098] For the detailed description of the above optional methods, please refer to the above method embodiments, which will not be repeated here. In addition, the explanation of any of the above-mentioned devices 40 for generating web applications and the description of the beneficial effects can refer to the above-mentioned corresponding method embodiments, which will not be repeated here.

[0099] It should be noted that the actions performed by the above modules are only specific examples. The actions actually performed by each unit refer to the above-mentioned Figure 2 The actions or steps mentioned in the description of the embodiments are described.

[0100] The embodiment of the present application can divide the functional modules of the device for accessing the application through the network according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0101] like Figure 5 As shown, it is a schematic diagram of the structure of a device for accessing an application via a network provided by an embodiment of the present application. The device 50 for accessing an application via a network can be used to execute any of the above embodiments (such as Figure 3 The function executed by the computer device in the embodiment shown). The device 50 for accessing an application via a network includes: an acquisition unit 501, a parsing unit 502 and an execution unit 503. Among them, the acquisition unit 501: is used to obtain a web resource request; the web resource request is used to access the target function of the target application. The parsing unit 502 is used to parse the web resource request according to the predefined host address of the target application, the port identifier corresponding to the target application, the name of the input parameter of the target function and the type of the input parameter of the target function, and obtain the value of the input parameter of the target function and the execution entry of the target function. The execution unit 503 is used to input the value of the input parameter of the target function into the target function according to the execution entry of the target function, run the target function, and obtain the value of the output parameter of the target function. For example, in combination with Figure 3 The acquisition unit 501 may be used to execute S200, the parsing unit 502 may be used to execute S201, and the execution unit 503 may be used to execute S202.

[0102] Optionally, the device 50 for accessing an application via a network further includes: a conversion unit 504, used to convert the value of the output parameter of the target function according to the predefined type of the output parameter and the name of the output parameter of the target function; and a response unit 505, used to respond to a web page resource request according to the value of the converted output parameter.

[0103] Optionally, the web page resource request is a GET type request or a POST type request.

[0104] Optionally, at least one of the host address, port identifier, name of the input parameter of the target function, type of the input parameter of the target function, name of the output parameter of the target function, or type of the output parameter of the target function is stored in a Proto file.

[0105] In one example, see Figure 2 , the receiving function of the acquisition unit 501 can be Figure 1 The processing functions of the acquisition unit 501, the parsing unit 502, the execution unit 503, the conversion unit 504 and the response unit 505 can all be implemented by Figure 1 The processor 101 in the embodiment calls the computer program stored in the memory 103 for implementation.

[0106] For the detailed description of the above optional methods, please refer to the above method embodiments, which will not be repeated here. In addition, the explanation of any of the above-mentioned devices 50 for accessing applications via a network and the description of the beneficial effects can refer to the above-mentioned corresponding method embodiments, which will not be repeated here.

[0107] It should be noted that the actions performed by the above modules are only specific examples. The actions actually performed by each unit refer to the above-mentioned Figure 3 The actions or steps mentioned in the description of the embodiments are described.

[0108] An embodiment of the present application also provides a computer device, including: a memory and a processor; the memory is used to store a computer program, and the processor is used to call the computer program to execute the actions or steps mentioned in any of the embodiments provided above.

[0109] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed on a computer, the computer is enabled to execute the actions or steps mentioned in any of the embodiments provided above.

[0110] The present application also provides a chip. The chip integrates a circuit and one or more interfaces for implementing the functions of the device for generating a web application and / or the device for accessing an application through a network. Optionally, the functions supported by the chip may include: Figure 2 or Figure 3The processing actions in the embodiments are not described in detail here. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by instructing the relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The processing unit or processor can be a central processing unit, a general-purpose processor, an application specific integrated circuit (ASIC), a microprocessor (digital signal processor, DSP), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.

[0111] The embodiment of the present application also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes any one of the methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that may be integrated with one or more available media. The available media may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.

[0112] The above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to the above-mentioned memories, computer-readable storage media, and communication chips, etc., are all non-transitory.

[0113] In the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit can implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0114] Although the present application has been described in conjunction with specific features and embodiments thereof, various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the accompanying drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application.

Claims

1. A method for generating a web application, characterized in that: The method comprises: Obtaining the host address where the target application is located, the path where the application code of the target application is located, the port identifier corresponding to the target application, the name of the input parameter of the target application, the type of the input parameter of the target application, the name of the output parameter of the target application, and the type of the output parameter; Configuring a listening port for the target application according to the port identifier; According to the path, loading the application code of the target application; A web application corresponding to the target application is generated according to the host address, the port identifier, the name of the input parameter, the type of the input parameter, the name of the output parameter, the type of the output parameter and the application code of the target application.

2. The method according to claim 1, characterized in that The acquiring of the host address where the target application is located, the path where the application code of the target application is located, the port identifier corresponding to the target application, the name of the input parameter of the target application, the type of the input parameter of the target application, the name of the output parameter of the target application, and the type of the output parameter includes: The host address where the target application is located, the path where the application code of the target application is located, the port identifier corresponding to the target application, the name of the input parameter of the target application, the type of the input parameter of the target application, the name of the output parameter of the target application and the type of the output parameter are read from a pre-stored local application definition file.

3. The method according to claim 2, characterized in that The local application definition file is a proto file.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Acquire the name of the sub-function of the target application, the name of the input parameter of the sub-function of the target application, the type of the input parameter of the sub-function, the name of the output parameter of the sub-function, and the type of the output parameter of the sub-function; Generate a web application corresponding to the sub-function according to the host address, the port identifier, the name of the sub-function, the name of the input parameter of the sub-function of the target application, the type of the input parameter of the sub-function, the name of the output parameter of the sub-function and the type of the output parameter of the sub-function.

5. A method for accessing an application via a network, characterized in that: The method comprises: Obtaining a webpage resource request; the webpage resource request is used to access a target function of a target application; Parse the webpage resource request according to the predefined host address of the target application, the port identifier corresponding to the target application, the name of the input parameter of the target function, and the type of the input parameter of the target function, to obtain the value of the input parameter of the target function and the execution entry of the target function; According to the execution entry of the target function, the value of the input parameter of the target function is input into the target function, and the target function is run to obtain the value of the output parameter of the target function.

6. The method according to claim 5, characterized in that The method further comprises: Convert the value of the output parameter of the target function according to the predefined type of the output parameter of the target function and the name of the output parameter; The webpage resource request is responded to according to the converted value of the output parameter.

7. The method according to claim 5, characterized in that The webpage resource request is a GET type request or a POST type request.

8. The method according to any one of claims 5 to 7, characterized in that: At least one of the host address, the port identifier, the name of the input parameter of the target function, the type of the input parameter of the target function, the name of the output parameter of the target function, or the type of the output parameter of the target function is stored in a Proto file.

9. A device for generating a web application, characterized in that: The device comprises: an acquisition unit, used to acquire a host address where a target application is located, a path where an application code of the target application is located, a port identifier corresponding to the target application, a name of an input parameter of the target application, a type of the input parameter, a name of an output parameter of the target application, and a type of the output parameter; A configuration unit, configured to configure a listening port for the target application according to the port identifier; A loading unit, configured to load the application code of the target application according to the path; A generating unit is used to generate a web application corresponding to the target application according to the host address, the port identifier, the name of the input parameter, the type of the input parameter, the name of the output parameter, the type of the output parameter and the application code of the target application.

10. The device according to claim 9, characterized in that The acquisition unit, It is specifically used to read from a pre-stored local application definition file the host address of the target application, the path of the application code of the target application, the port identifier corresponding to the target application, the name of the input parameter of the target application, the type of the input parameter, the name of the output parameter of the target application, and the type of the output parameter.

11. The device according to claim 10, characterized in that The local application definition file is a proto file.

12. The device according to any one of claims 9 to 11, characterized in that: The acquisition unit is also used for: Acquire the name of the sub-function of the target application, the name of the input parameter of the sub-function of the target application, the type of the input parameter of the sub-function, the name of the output parameter of the sub-function, and the type of the output parameter of the sub-function; The generation unit is further used to generate a web application corresponding to the sub-function according to the host address, the port identifier, the name of the sub-function, the name of the input parameter of the sub-function of the target application, the type of the input parameter of the sub-function, the name of the output parameter of the sub-function and the type of the output parameter of the sub-function.

13. A device for accessing an application via a network, characterized in that: The device comprises: An acquisition unit, configured to acquire a webpage resource request; the webpage resource request is used to access a target function of a target application; A parsing unit, configured to parse the webpage resource request according to a predefined host address of the target application, a port identifier corresponding to the target application, a name of an input parameter of the target function, and a type of the input parameter of the target function, to obtain a value of the input parameter of the target function and an execution entry of the target function; The execution unit is used to input the value of the input parameter of the target function into the target function according to the execution entry of the target function, run the target function, and obtain the value of the output parameter of the target function.

14. The device according to claim 13, characterized in that The device also includes: a conversion unit, configured to convert the value of the output parameter of the target function according to the predefined type of the output parameter of the target function and the name of the output parameter; A response unit is used to respond to the webpage resource request according to the converted value of the output parameter.

15. The device according to claim 13, characterized in that The webpage resource request is a GET type request or a POST type request.

16. The device according to any one of claims 13 to 15, characterized in that: At least one of the host address, the port identifier, the name of the input parameter of the target function, the type of the input parameter of the target function, the name of the output parameter of the target function, or the type of the output parameter of the target function is stored in a Proto file.

17. A computer device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to execute the method according to any one of claims 1 to 4, or to execute the method according to any one of claims 5 to 8.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 4, or execute the method according to any one of claims 5 to 8.