WO2021120913A1 - 应用加载方法、装置、用户终端和服务器 - Google Patents

应用加载方法、装置、用户终端和服务器 Download PDF

Info

Publication number
WO2021120913A1
WO2021120913A1 PCT/CN2020/126880 CN2020126880W WO2021120913A1 WO 2021120913 A1 WO2021120913 A1 WO 2021120913A1 CN 2020126880 W CN2020126880 W CN 2020126880W WO 2021120913 A1 WO2021120913 A1 WO 2021120913A1
Authority
WO
WIPO (PCT)
Prior art keywords
sub
data
business
user
project data
Prior art date
Application number
PCT/CN2020/126880
Other languages
English (en)
French (fr)
Inventor
马世豪
Original Assignee
北京金山云网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京金山云网络技术有限公司 filed Critical 北京金山云网络技术有限公司
Publication of WO2021120913A1 publication Critical patent/WO2021120913A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Definitions

  • This application relates to the technical field of data centering, in particular to an application loading method, device, user terminal, and server.
  • the development process usually needs to be divided into multiple business modules, and each business module is developed by a different engineer; the code data corresponding to multiple business modules are maintained in a git (a kind of Distributed version control system) warehouse, so in the development process, it is necessary to constantly resolve code conflicts between business modules, resulting in high development costs; in addition, based on the application of this development method, in the running process, each business The code data of the modules are all integrated in one file. If the business needs to be updated, the entire file needs to be updated, resulting in higher maintenance costs for the project; at the same time, because the amount of code data in the above files is large, the time required to load the data is relatively long. Long, so the response time to user operations is also longer.
  • git a kind of Distributed version control system
  • the purpose of the embodiments of the present invention is to provide a data loading method, device, user terminal, and server, so as to reduce development costs and maintenance costs, and shorten the time required for loading data.
  • an application loading method includes: if a user's access request to a target application is received, obtaining the main project data of the target application from the server corresponding to the target application And load the main item data; obtain the business configuration file corresponding to the user from the server; wherein the business configuration file includes the access address of the sub-item data corresponding to the user's business in the target application Information; if a user's request for access to the specified service in the target application is received, the specified service corresponding to the specified service is obtained from the server according to the access address information of the sub-item data corresponding to the specified service in the service configuration file And load the acquired sub-project data corresponding to the specified business.
  • the step of obtaining the business configuration file corresponding to the user from the server includes: running a specified script file in the main project data to obtain the business configuration file corresponding to the user.
  • the access address information of the sub-item data includes: the access address of the data file where the sub-item data is located; the access to the sub-item data corresponding to the specified service in the service configuration file Address information, the step of obtaining the sub-item data corresponding to the designated service from the server includes: searching for the first part of the data file in which the sub-item data corresponding to the designated service is located from the service configuration file corresponding to the user An access address; obtaining the sub-item data stored in the data file on the first access address from the server.
  • the service configuration file further includes: a dependency relationship between the sub-item data corresponding to each service of the user; the data file on the first access address is obtained from the server
  • the step of saving the sub-project data in includes: determining the sub-project data corresponding to the designated business as the target project data; and judging whether the target project data needs to be loaded when loading the target project data according to the dependency relationship Sub-item data other than the data; if necessary, search for the second access address of the data file where the sub-item data other than the target item data that needs to be loaded is located; obtain the first access address and all the data from the server respectively Describe the sub-item data stored in the data file at the second access address.
  • the method further includes: if a service update request of the user is received, sending the service update request to the server, so as to update the service configuration file corresponding to the user through the server .
  • the target application includes a single-page application.
  • an application loading method includes: if an access request to a target application from a client is received, providing the client with the main project data of the target application, and The service configuration file of the user corresponding to the access request; wherein the service configuration file includes the access address information of the sub-item data corresponding to the user’s service in the target application;
  • the access request for the specified service in the target application provides the client with sub-item data corresponding to the specified service; wherein, the access request for the specified service carries: the specified service in the service configuration file The access address information of the corresponding sub-item data.
  • an application loading device includes: a first acquiring module configured to, if a user's access request to a target application is received, acquire all information from the server corresponding to the target application The main project data of the target application is loaded and the main project data is loaded; the second obtaining module is configured to obtain the service configuration file corresponding to the user from the server; wherein, the service configuration file includes the target application The access address information of the sub-item data corresponding to the user’s business in the user’s business; the third acquiring module is configured to, if a user’s access request to the specified service in the target application is received, according to the specified business in the service configuration file Corresponding access address information of the sub-item data, obtain the sub-item data corresponding to the specified service from the server, and load the obtained sub-item data corresponding to the specified service.
  • an application loading device includes: a first providing module configured to provide the target application to the client if a request for access to the target application from the client is received The main item data of the application, and the service configuration file of the user corresponding to the access request; wherein, the service configuration file includes the access address information of the sub-item data corresponding to the user's service in the target application; second A providing module, configured to provide the client with sub-item data corresponding to the specified service if a request for access to a specified service in the target application is received from the client; wherein, the access request for the specified service It carries: the access address information of the sub-item data corresponding to the specified service in the service configuration file.
  • a user terminal provided by an embodiment of the present invention includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions In order to realize the application loading method described in the first aspect.
  • a server provided by an embodiment of the present invention includes a processor and a memory.
  • the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to The application loading method described in the second aspect is implemented.
  • An embodiment of the present invention provides a machine-readable storage medium, the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the foregoing
  • the application loading method according to any one of the first aspect and the second aspect.
  • the main project data of the target application is obtained from the server corresponding to the target application and the main project data is loaded;
  • the server obtains the business configuration file corresponding to the user, including the access address information of the sub-item data corresponding to the user's business in the target application; if it receives the user's access request to the specified service in the target application, it corresponds to the specified business in the business configuration file Access address information of the sub-item data of, obtain the sub-item data corresponding to the specified business from the server, and load the obtained sub-item data corresponding to the specified business.
  • the main project data in the target application and the sub-project data corresponding to each business are independent of each other.
  • the sub-project data of the business used by the user can be obtained through the user's corresponding business configuration file, and the user terminal does not need to Load all the project data of the target application, thus shortening the loading time delay and improving the user experience of the target application.
  • Figure 1 is a schematic diagram of a front-end architecture provided by the present disclosure
  • FIG. 2 is a flowchart of an application loading method provided by the present disclosure
  • FIG. 3 is a flowchart of another application loading method provided by the present disclosure.
  • FIG. 4 is a flowchart of another application loading method provided by the present disclosure.
  • FIG. 5 is a flowchart of another application loading method provided by the present disclosure.
  • FIG. 6 is a flowchart of another application loading method provided by the present disclosure.
  • FIG. 7 is a schematic diagram of another front-end architecture provided by the present disclosure.
  • FIG. 8 is a schematic structural diagram of an application loading device provided by the present disclosure.
  • FIG. 9 is a schematic structural diagram of another application loading device provided by the present disclosure.
  • Fig. 10 is a server or user terminal provided by the present disclosure.
  • the front-end is the front-end part of the website, which usually runs on PC (Personal Computer) devices, mobile terminals and other equipment clients or browsers, and is used to display web pages browsed by users; single-page applications can be understood as the entire WebApp (World Wide) Web Application (Web Application) has only one HTML (Hyper Text Markup Language) file; currently, the front-end architecture of a single-page application usually uses a front-end architecture diagram as shown in Figure 1.
  • a single-page application front-end engineering project usually contains multiple businesses, such as business A, business B, business C, and business D. Each business is developed and maintained by different developers, such as: Developer A is responsible for the development and maintenance of the business A. Developer B is responsible for the development and maintenance of business B, etc.
  • the code data corresponding to each business is stored in its own folder.
  • the code data corresponding to business A is stored in folder A
  • the code data corresponding to business B is stored in files.
  • Folder B is medium, and all business folders are maintained in a git repository.
  • the folders of all businesses are summarized into a total data file, that is, the folders of each business in Figure 1 are integrated into a total folder.
  • the user terminal needs to first load a total data file containing all service data files, and then obtain and display data related to the specified service from the total data file.
  • the embodiments of the present invention provide an application loading method, device, user terminal, and server.
  • the technology can be applied to various Web-based systems and applications, such as multi-page applications, single-page applications, etc., especially It is applied to a single web application with a large number of JavaScript files, resulting in a large amount of code data.
  • the following describes in detail an application loading method disclosed in the embodiment of the present invention. As shown in FIG. 2, the method is applied to a user terminal; the method includes the following steps:
  • Step S202 If the user's request for access to the target application is received, the main project data of the target application is obtained from the server corresponding to the target application and the main project data is loaded.
  • the above-mentioned target application can be understood as the application project accessed by the user.
  • the application project can be a single-page application, a multi-page application, etc.; the target application usually contains one or more business-corresponding project data; the above-mentioned main project data may not include
  • the specific business logic generally only contains the data of the default page of the target application; the main project data is mainly used to load the data of the corresponding resources of other sub-projects.
  • the main project data of the target application and the sub-project data corresponding to each business are all running on the server.
  • the main project data of the target application is loaded from the server to provide The specific business required by the user provides a loading service; the main project data can also be understood as an interface for the user to subsequently access the specified business, and the specified business can be accessed through the main project data.
  • the user can send an access request of the target application through an application on the user terminal, a browser, or other clients, and the access request may specifically be information such as a website address of the target application.
  • the main item data of the target business and the sub-item data corresponding to each business are independent of each other, and both are located in their respective files.
  • the client After the client receives the access request, it does not need to obtain all the code data of the target application from the server corresponding to the target application, but only obtains and loads the main project data, thereby shortening the loading time of the web page data.
  • Step S204 Obtain the service configuration file corresponding to the above-mentioned user from the server; wherein, the service configuration file includes the access address information of the sub-item data corresponding to the user's service in the target application.
  • the business configuration file corresponding to the above-mentioned user may contain the relevant configuration information of the sub-project data of the business that the user needs to access or has access rights, such as the access address of the sub-project data corresponding to the user’s business in the target application, and the sub-project data of each business.
  • the dependency relationship between the business profile and the user can be established one-to-one correspondence, that is, a user can correspond to a business profile.
  • the corresponding business profile is also Different; the above sub-project data can be understood as the specific project data corresponding to each specific business.
  • the business configuration file corresponding to the user can be obtained by loading and running the main project data obtained in the foregoing steps.
  • Step S206 If the user's access request for the specified service in the target application is received, the sub-item data corresponding to the specified service is obtained from the server according to the access address information of the sub-item data corresponding to the specified service in the service configuration file, and Load the acquired sub-project data corresponding to the specified business.
  • the above-mentioned designated service can be understood as the service used or purchased by the user in the target application, and the number of the service may be one or more.
  • the main project data of the target application usually contains an access interface for accessing the sub-project data of each business.
  • the user can send the access request of the specified service to the user terminal.
  • the configuration information of the specified service is extracted from the service configuration file corresponding to the user, and the access address information in the configuration information can be used to obtain the specified service from the server.
  • the application loading method if a user's access request to a target application is received, the main project data of the target application is obtained from the server corresponding to the target application and the main project data is loaded; the user corresponding is obtained from the server, A business configuration file that includes the access address information of the sub-item data corresponding to the user's business in the target application; if a user's access request for a specified service in the target application is received, the access address of the sub-item data corresponding to the specified business in the business configuration file is received Information, obtain the sub-project data corresponding to the specified business from the server, and load the obtained sub-project data corresponding to the specified business.
  • the main project data in the target application and the sub-project data corresponding to each business are independent of each other.
  • the sub-project data of the business used by the user can be obtained through the user's corresponding business configuration file, and the user terminal does not need to Load all the project data of the target application, thus shortening the loading time delay and improving the user experience of the target application.
  • the embodiment of the present invention also provides another application loading method, which is implemented on the basis of the method in the above embodiment; the method focuses on the specific implementation process of obtaining the user's corresponding service configuration file from the server, and specifically corresponds to the following step S304 As shown in Figure 3, the method includes the following steps:
  • Step S302 If the user's request for access to the target application is received, the main project data of the target application is obtained from the server corresponding to the target application and the main project data is loaded.
  • Step S304 Run the specified script file in the main project data to obtain the service configuration file corresponding to the user; wherein, the service configuration file includes the access address information of the subproject data corresponding to the user's service in the target application.
  • the above specified script file can be a Python script file or other script files; in actual implementation, you can obtain the user's corresponding business configuration file from the server by running the specified script file in the main project data; the business configuration file can be Files in json format.
  • Step S306 If the user's access request for the specified service in the target application is received, the sub-item data corresponding to the specified service is obtained from the server according to the access address information of the sub-item data corresponding to the specified service in the service configuration file, and Load the acquired sub-project data corresponding to the specified business.
  • the main project data of the target application is obtained and loaded from the server corresponding to the target application, and then the specified script file in the main project data is run to obtain the user's corresponding business Configuration file.
  • the main project data in the target application and the sub-project data corresponding to each business are independent of each other.
  • the sub-project data of the business used by the user can be obtained through the user's corresponding business configuration file, and the user terminal does not need to Load all the project data of the target application, thus shortening the loading time delay and improving the user experience of the target application.
  • the embodiment of the present invention also provides another application loading method, which is implemented on the basis of the method in the above-mentioned embodiment; the method focuses on describing the access address information of the sub-item data corresponding to the specified service in the service configuration file, which is obtained from the server.
  • the specific implementation process of the sub-item data corresponding to the designated service specifically corresponds to the following steps S406 to S408.
  • the access address information of the sub-item data includes: the access address of the data file where the sub-item data is located; the business configuration file also includes: the dependency relationship between the sub-item data corresponding to each business of the user; for example, the user is in The business used or purchased in the target application includes business A and business B.
  • the access address of data file A where the sub-project data A corresponding to business A is located is a
  • the data file B where the sub-project data B corresponding to business B is located The access address of is b
  • the configuration file corresponding to the user includes the access address a and the access address b, and the dependency relationship between the sub-item data A and the sub-item data B.
  • the method includes the following steps:
  • Step S402 If the user's request for access to the target application is received, the main project data of the target application is obtained from the server corresponding to the target application and the main project data is loaded.
  • Step S404 Obtain the service configuration file corresponding to the above-mentioned user from the server; wherein, the service configuration file includes the access address information of the sub-item data corresponding to the user's service in the target application.
  • step S406 if the user's access request for the specified service in the target application is received, the service configuration file corresponding to the user searches for the first access address of the data file where the sub-item data corresponding to the specified service is located.
  • the above-mentioned first access address can be understood as the specific access location of the saved data file; the business configuration file usually contains the first access address of the data file where the sub-item data corresponding to the service specified by the user is located. After the service access request, the first access address of the corresponding data file is searched from the service configuration file corresponding to the user.
  • the business configuration file may be a json file generated by a Python script, and the static resources corresponding to the sub-project data are loaded to the user's client through the json file.
  • Step S408 Obtain the sub-item data stored in the data file on the first access address from the server.
  • step S408 can be implemented by the following methods:
  • the aforementioned target item data can be understood as the sub-item data actually saved in the found data file on the aforementioned first access address.
  • the above-mentioned dependency relationship can be understood as the coupling relationship between the data of each sub-item; when loading the above-mentioned target item data, it is necessary to determine whether there is other sub-item data that has a coupling relationship with the target item data.
  • search for the second access address of the data file where the sub-item data other than the target item data that needs to be loaded is located.
  • the target project data saved in the data file on the first access address and the subproject data saved in the data file on the second access address from the server; as an example, if the subproject data A is the target project data, There is a certain association relationship between sub-item data B and sub-item data A, so sub-item data A and sub-item data B need to be extracted at the same time.
  • Step S410 Load the acquired sub-item data corresponding to the aforementioned designated service.
  • the main project data in the target application and the sub-project data corresponding to each business are independent of each other.
  • the sub-project data of the business used by the user can be obtained through the user's corresponding business configuration file, and the user terminal does not need to Load all the project data of the target application, thus shortening the loading time delay and improving the user experience of the target application.
  • the embodiment of the present invention also provides another application loading method, which is implemented on the basis of the method in the foregoing embodiment; as shown in FIG. 5, the method includes the following steps:
  • Step S502 If the user's request for access to the target application is received, the main project data of the target application is obtained from the server corresponding to the target application and the main project data is loaded.
  • Step S504 Obtain the service configuration file corresponding to the above-mentioned user from the server; wherein, the service configuration file includes the access address information of the sub-item data corresponding to the user's service in the target application.
  • Step S506 If the user's access request for the specified service in the target application is received, the sub-item data corresponding to the specified service is obtained from the server according to the access address information of the sub-item data corresponding to the specified service in the service configuration file, and Load the acquired sub-project data corresponding to the specified business.
  • Step S508 If the service update request of the user is received, the service update request is sent to the server to update the service configuration file corresponding to the user through the server.
  • the above service update request can be understood as a user’s request to add or delete services.
  • the service update request is sent to the server so that the server can update the user’s service according to the service update request.
  • Business configuration file as an example, if a user requests to add a service, add the relevant configuration information of the sub-item data corresponding to the service in the user’s service configuration file, and increase the dependency between the service and other services; if the user When a designated service is requested to be deleted, the relevant configuration information of the sub-project data corresponding to the designated service will be deleted in the user's service configuration file, and the dependency between the service and other services will be deleted at the same time.
  • the service update request is sent to the server to update the service configuration file corresponding to the user through the server.
  • the main project data in the target application and the sub-project data corresponding to each business are independent of each other.
  • the sub-project data of the business used by the user can be obtained through the user's corresponding business configuration file, and the user terminal does not need to Load all the project data of the target application, thus shortening the loading time delay and improving the user experience of the target application.
  • the maintenance phase of the above-mentioned target application if the user needs to update the business or the business function itself needs to be updated, only the sub-project data corresponding to the business needs to be updated. There is no need to modify the application code as a whole, and the maintenance cost of the project is low.
  • the embodiment of the present invention also provides another application loading method, which can be applied to a server, and the server can run on a server such as a web server, a proxy server, etc.; as shown in FIG. 6, the method includes the following steps:
  • Step S602 If an access request to the target application from the client is received, the main project data of the target application and the service profile of the user corresponding to the access request are provided to the client; wherein, the service profile includes the target application Access address information of the sub-item data corresponding to the user’s business in the.
  • the above-mentioned target applications can include single-page applications or other application projects such as multi-page applications; among them, single-page applications can be understood as the entire WebApp has only one HTML file, and each functional page in it is javascript routed through hash or history api , And through ajax (Asynchronous Javascript And XML, asynchronous JavaScript and XML) to pull data to achieve the response function, the above-mentioned entire WebApp has only one HTML application is a single-page application; it can also be understood as, in the entire application process, The browser is not refreshed from beginning to end, all data interaction is completed by ajax, but there is a clear distinction between the pages, the so-called WebApp.
  • Single page WebApp can be understood as an application with only one web page.
  • SPA is a web application that loads a single HTML page and dynamically updates the page when the user interacts with the application. The browser will load the necessary HTML, CSS (Cascading Style Sheets) and JavaScript at the beginning. All operations are completed on this page and controlled by JavaScript.
  • Step S604 If a request for access to a specified service in the target application from the client is received, the client is provided with sub-item data corresponding to the specified service; wherein, the access request for the specified service carries: the specified service in the service configuration file The access address information of the corresponding sub-item data.
  • the server When the server receives a request from the client to access a specified service in the target application, it provides the client with sub-project data corresponding to the specified service; the sub-project data usually includes the target project data corresponding to the specified service, and The target project data is dependent on other sub-project data; the access request usually carries the access address information of the target project data corresponding to the specified business, and the access address information of other sub-project data dependent on the target project data .
  • the above application loading method can be applied to the server. If a request for access to the target application from the client is received, the client is provided with the main project data of the target application and the user’s business configuration file corresponding to the access request; if the request is received from The client's request for access to the specified business in the target application provides the client with the sub-project data corresponding to the specified business; in this method, the main project data in the target application and the sub-project data corresponding to each business are independent of each other, and at the same time, The subproject data of the service used by the user can be obtained through the user's corresponding service configuration file, and the user terminal does not need to load all the project data of the target application, thus shortening the loading delay and improving the user experience of the target application.
  • the main project data in the target application and the sub-project data corresponding to each business are maintained in different git warehouses, which avoids that all business code data is maintained in the same git warehouse. Code conflicts, thereby reducing project development costs.
  • the maintenance phase of the above-mentioned target application if the user needs to update the business or the business function itself needs to be updated, only the sub-project data corresponding to the business needs to be updated. There is no need to modify the application code as a whole, and the maintenance cost of the project is low.
  • the embodiment of the present invention also provides another application loading method, which is implemented on the basis of the method in the above embodiment; the method includes the following two steps:
  • Step 1 If a request for access to the target application from the client is received, the client is provided with the main project data of the target application and the user’s business profile corresponding to the access request; the business profile includes the user’s profile in the target application. Access address information of the sub-item data corresponding to the business.
  • the above-mentioned target application includes the data file where the main project data is located and the data file where the sub-project data corresponding to at least one business is located; the main project data and the sub-project data corresponding to the business are stored in their respective data files; if the business is There are many types.
  • the sub-project data corresponding to each business is stored in its own data file. For example, two businesses have been developed in the target application, business A and business B.
  • the main project data is stored in the data file main, and business A
  • the corresponding sub-project data is stored in data file A, and the sub-project data corresponding to business B is stored in data file B.
  • the target application includes data file main and data file A, or data file main and data file B, or both Contains the data file main, data file A and data file B; the above data files are independent of each other.
  • the data file used to save the main project data and the data file used to save the sub-project data corresponding to the business can be generated by the following methods:
  • the main project data is maintained in a separate git repository, which can be an open source distributed version control system, which can be understood as a project repository hosted on the network, which can include one or more Project data corresponding to the business; GitHub is a hosting platform for open source and private software projects, and only supports git as the only repository format for hosting. If the main project data is contained in the git repository, the main project data is obtained from the git repository. In actual implementation, the above-mentioned git repository containing the main project data can be represented by "git repository main".
  • the sub-project data of each business is maintained in a separate git warehouse, that is, the sub-project data corresponding to each business is stored in its own independent git warehouse, so it is usually in each business and its There is a one-to-one correspondence between the business-corresponding sub-project data and the git warehouse.
  • Each sub-project data is independent of each other, and the degree of coupling between each other is low.
  • git warehouse A contains business A and sub-project data A corresponding to business A
  • git warehouse B contains business B and sub-project data B corresponding to business B, and so on.
  • sub-project data A is obtained from git warehouse A
  • sub-project data B is obtained from git warehouse B.
  • Each sub-project data forms one Separate data file
  • main project data also form a separate data file.
  • new sub-project data can be easily added or deleted according to customer needs, and there is no need to modify the code of the target application as a whole.
  • the target application has developed three businesses, namely Business A and Business B.
  • business C the user purchased business A and business B, if the user needs to purchase business C, add the relevant configuration information of business C in the configuration file corresponding to the user; if the user no longer needs business A or business B, usually Delete the relevant configuration information of the business A or business B from the configuration file; if you need to develop a new business D for the target application, in the project development process, establish a corresponding git warehouse D for the business D.
  • the development is completed, Generate the data file corresponding to the sub-item data of the business D.
  • the above main project data and the above sub-project data are packaged through Webpack to obtain the data file where the main project data is located and the data file where the sub-project data corresponding to each business is located.
  • the above-mentioned Webpack can be used to package project data corresponding to one or more businesses in the project.
  • the dependency relationship between the project data corresponding to each business is analyzed, for example: a project data and
  • Step 2 If receiving a request from the client to access the specified service in the target application, provide the client with the sub-item data corresponding to the specified service; among them, the access request of the specified service carries: the service corresponding to the specified service in the service configuration file Access address information of sub-item data.
  • the main project data and the sub-project data corresponding to each business in the target application are maintained in different git warehouses, which avoids the code caused by maintaining all business code data in the same git warehouse. Conflict, thereby reducing project development costs.
  • the maintenance phase of the above target application if the user needs to update the business, or the business function itself needs to be updated, only the sub-project data corresponding to the business needs to be updated. There is no need to modify the application code as a whole, and the maintenance cost of the project is lower.
  • FIG. 7 Another front-end architecture diagram is provided below.
  • the main project data is stored in the git repository main, and the main project data is usually not Contains business logic and is mainly responsible for loading sub-project data resources; multiple sub-project data are stored in their respective git warehouses.
  • Business A and its corresponding sub-project data A stored in git warehouse A are developed and developed by developer A.
  • Maintenance, business B and its corresponding sub-project data B stored in git warehouse B are developed and maintained by developer B.
  • each sub-project static resource configuration json file is generated through the Python script, and the static resource corresponding to the sub-project data is loaded through the json file.
  • the main project data can load the data files corresponding to different sub-project data according to the user's business configuration file.
  • the user's business configuration file also records the dependency relationship between the data of each sub-project. If the user only needs a part of the business, such as business A, business B, and business C, then only need to generate business configuration files for business A, business B, and business C.
  • Each user corresponds to a business configuration file, and the business configuration file points to The sub-item data is the sub-item data required by the user.
  • the above architecture method is based on Webpack technology, splits each business into a single independent git warehouse, and then releases it online through Jenkins; it can be understood that a data center is set between the client and the back-end big data, and the data center can It is understood as collecting, calculating, storing, and processing massive amounts of data through data technology, and at the same time unifying standards and calibers. Users can manage big data information in the console, such as viewing monitoring, operating databases, etc.
  • the enterprise sets up a data center between the enterprise and the user. After the data center unifies the data, standard data will be formed and then stored to form big data.
  • the asset layer provides customers with efficient services and guarantees the needs of different groups of users to the greatest extent. These services have a strong correlation with the business of the enterprise. They are unique and reusable. They are the precipitation of the business and data of the enterprise. They can not only reduce repeated construction and reduce the cost of chimney collaboration, but also differentiate. Where the competitive advantage lies.
  • the method described in the foregoing embodiment can also be understood as a front-end automated scaffolding architecture; wherein, the front-end is the front-end part of the website, which runs on the PC, mobile and other browsers to show the web pages browsed by the user.
  • Scaffolding can be understood as the preliminary work of project development. Every time you start a new project, you need to build the entire file directory structure and build the necessary files, which is the process of building scaffolding. This process is required every time you build a new project. Scaffolding can reduce the user's repetitive work.
  • the source language is ES6 (ECMAScript 6, a JavaScript voice standard), using sass (Syntactically Awesome Stylesheets, Auditing Standards Manual) language
  • the backend is node.js (node.js is Server-side JavaScript runtime environment).
  • ES6 ECMAScript 6, a JavaScript voice standard
  • sass Synchrontactically Awesome Stylesheets, Auditing Standards Manual
  • node.js is Server-side JavaScript runtime environment
  • the source language is ES6, sass language, and the back end is node.js
  • the user is required Subsequent projects repeatedly prepare similar gulp scripts, that is, preparing multiple gulp scripts has become a repetitive task.
  • the scaffolding can help users reduce these repetitive tasks. Through the scaffolding, the directory structure, gulp scripts, babel configuration, and empty test files can be built. Users can write core business codes directly, saving users' repetitive work. This is scaffolding. The role of.
  • the device includes: a first obtaining module 80 configured to receive a user's access request to the target application from the corresponding target application
  • the server obtains the main project data of the target application and loads the main project data
  • the second obtaining module 81 is configured to obtain the user-corresponding business configuration file from the server; where the business configuration file includes the subordinates corresponding to the user's business in the target application Access address information of the project data
  • the third acquisition module 82 is set to obtain from the server according to the access address information of the sub-project data corresponding to the specified service in the service configuration file if a user's access request to the specified service in the target application is received Specify the sub-project data corresponding to the business, and load the acquired sub-project data corresponding to the specified business.
  • the application loading device In the application loading device provided by the embodiment of the present invention, if a user's request for access to a target application is received, it obtains the main project data of the target application from the server corresponding to the target application and loads the main project data; obtains the user corresponding from the server, A business configuration file that includes the access address information of the sub-item data corresponding to the user's business in the target application; if a user's access request for a specified service in the target application is received, the access address of the sub-item data corresponding to the specified business in the business configuration file is received Information, obtain the sub-project data corresponding to the specified business from the server, and load the obtained sub-project data corresponding to the specified business.
  • the main project data in the target application and the sub-project data corresponding to each business are independent of each other.
  • the sub-project data of the business used by the user can be obtained through the user's corresponding business configuration file, and the user terminal does not need to Load all the project data of the target application, thus shortening the loading time delay and improving the user experience of the target application.
  • the second obtaining module 81 is further configured to run the designated script file in the main project data, so as to obtain the business configuration file corresponding to the user.
  • the access address information of the sub-item data includes: the access address of the data file where the sub-item data is located; the third obtaining module 82 is also set to: search for the sub-item corresponding to the specified service from the service configuration file corresponding to the user The first access address of the data file where the project data is located; the sub-project data stored in the data file at the first access address is obtained from the server.
  • the business configuration file further includes: the dependency relationship between the sub-item data corresponding to each business of the user; the third obtaining module 82 is further configured to: determine the sub-item data corresponding to the specified business as the target item data ;According to the dependency relationship, judge whether it is necessary to load the sub-project data other than the target project data when loading the target project data; if necessary, find the second access address of the data file where the sub-project data other than the target project data that needs to be loaded is located ; Obtain the sub-item data stored in the data file on the first access address and the second access address from the server respectively.
  • the device is further configured to: if a service update request from the user is received, the service update request is sent to the server to update the service configuration file corresponding to the user through the server.
  • the target application includes a single-page application.
  • the apparatus includes: a first providing module 90 configured to send a request to the client to the client if an access request to the target application from the client is received
  • the terminal provides the main project data of the target application and the business configuration file of the user corresponding to the access request; the business configuration file includes the access address information of the sub-project data corresponding to the user’s business in the target application;
  • the second providing module 91 setting In order to provide the client with the sub-item data corresponding to the specified service if it receives a request from the client to access the specified service in the target application; among them, the specified service access request carries: the sub-item corresponding to the specified service in the service configuration file Data access address information.
  • the main project data and the sub-project data corresponding to the business are stored in their respective data files. If there are multiple types of business, the sub-project data corresponding to each business is stored in their respective data files.
  • the data file set to save the main project data and the data file set to save the sub-project data corresponding to the business are generated by the following method: obtain the main project data from the git warehouse where the main project data is located; from The corresponding sub-project data is obtained in the git warehouse where the sub-project data corresponding to each business is located; the main project data and sub-project data are packaged through Webpack to obtain the data file set to save the main project data and set to save the business correspondence The data file of the sub-item data.
  • the main project data in the target application and the sub-project data corresponding to each business are maintained in different git warehouses, which avoids that all business code data is maintained in the same git warehouse. Code conflicts, thereby reducing project development costs.
  • the maintenance phase of the above-mentioned target application if the user needs to update the business or the business function itself needs to be updated, only the sub-project data corresponding to the business needs to be updated. There is no need to modify the application code as a whole, and the maintenance cost of the project is low.
  • the embodiment of the present invention also provides a server and a user terminal.
  • the server or user terminal includes a processor 130 and a memory 131.
  • the memory 131 stores machine executable instructions that can be executed by the processor 130.
  • the processor 130 executes machine-executable instructions to implement the above application loading method.
  • the server or user terminal shown in FIG. 10 further includes a bus 132 and a communication interface 133, and the processor 130, the communication interface 133, and the memory 131 are connected through the bus 132.
  • the memory 131 may include a high-speed random access memory (RAM, Random Access Memory), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
  • the communication connection between the system network element and at least one other network element is realized through at least one communication interface 133 (which may be wired or wireless), and the Internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
  • the bus 132 may be an ISA bus, a PCI bus, an EISA bus, or the like.
  • the bus can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one bidirectional arrow is used to indicate in FIG. 10, but it does not mean that there is only one bus or one type of bus.
  • the processor 130 may be an integrated circuit chip with signal processing capability. In the implementation process, the steps of the foregoing method may be completed by an integrated logic circuit of hardware in the processor 130 or instructions in the form of software.
  • the aforementioned processor 130 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; it may also be a Digital Signal Processor (DSP for short). ), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • CPU Central Processing Unit
  • NP Network Processor
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in combination with the embodiments of the present invention may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory 131, and the processor 130 reads the information in the memory 131, and completes the steps of the method of the foregoing embodiment in combination with its hardware.
  • the embodiment of the present invention also provides a machine-readable storage medium, the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor.
  • the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor.
  • the computer program product of the application loading method, device, user terminal, and server provided by the embodiments of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the instructions in the previous method embodiments.
  • program code storing program code
  • the instructions included in the program code can be used to execute the instructions in the previous method embodiments.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the related technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium. It includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
  • the main item data in the target application and the sub-item data corresponding to each business are independent of each other, and at the same time, it can be obtained through the user's corresponding business configuration file
  • the user terminal does not need to load all the project data of the target application, thus shortening the loading time delay and improving the user experience of the target application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种应用加载方法、装置、用户终端和服务器,如果接收到用户对目标应用的访问请求,从目标应用对应的服务端获取并加载对应的主项目数据;从服务端获取包括目标应用中用户的业务对应的子项目数据的访问地址信息的业务配置文件;如果接收到用户对目标应用中指定业务的访问请求,根据业务配置文件中指定业务对应的子项目数据的访问地址信息,从服务端获取并加载对应的子项目数据。该方法中,目标应用中的主项目数据和各个业务对应的子项目数据之间相互独立,通过用户对应的业务配置文件即可获取该用户所使用的业务的子项目数据,用户终端无需加载目标应用的全部的项目数据,因而缩短了加载时延,提高了目标应用的用户体验度。

Description

应用加载方法、装置、用户终端和服务器
本申请要求于2019年12月20日提交中国专利局、申请号为201911335288.7、发明名称为“应用加载方法、装置、用户终端和服务器”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据中台技术领域,具体涉及一种应用加载方法、装置、用户终端和服务器。
背景技术
相关技术中,对于一个前端应用项目,在开发过程中通常需要划分为多个业务模块,每个业务模块由不同的工程师进行开发;多个业务模块对应的代码数据都维护在一个git(一种分布式版本控制系统)仓库中,因此在开发过程中,需要不断解决业务模块之间的代码冲突,导致开发成本较大;另外,基于这种开发方式得到的应用,在运行过程中,各个业务模块的代码数据都综合在一个文件中,如果业务需要更新,则需要更新整个文件,导致项目的维护成本较高;同时,由于上述文件中的代码数据量较大,加载数据所需的时间较长,从而对用户操作的响应时间也较长。
发明内容
本发明实施例的目的在于提供一种数据加载方法、装置、用户终端和服务器,以降低开发成本和维护成本,缩短加载数据所需的时间。
第一方面,本发明实施例提供的一种应用加载方法,所述方法包括:如果接收到用户对目标应用的访问请求,从所述目标应用对应的服务端获取所述目标应用的主项目数据并加载所述主项目数据;从所述服务端获取所述用户对应的业务配置文件;其中,所述业务配置文件中包括所述目标应用中所述用户的业务对应的子项目数据的访问地址信息;如果接收到用户对所述目标应用中指定业务的访问请求,根据所述业务配置文件中所述指定业务对应的子项目数据的访问地址信息,从所述服务端获取所述指定业务对应的子项目数据,并加载获取到的指定业务对应的子项目数据。
在一实施方式中,所述从服务端获取所述用户对应的业务配置文件的步 骤,包括:运行所述主项目数据中的指定脚本文件,从而获取所述用户对应的业务配置文件。
在一实施方式中,所述子项目数据的访问地址信息包括:所述子项目数据所在的数据文件的访问地址;所述根据所述业务配置文件中所述指定业务对应的子项目数据的访问地址信息,向所述服务端获取所述指定业务对应的子项目数据的步骤,包括:从所述用户对应的业务配置文件中,查找所述指定业务对应的子项目数据所在的数据文件的第一访问地址;从所述服务端获取所述第一访问地址上的数据文件中保存的子项目数据。
在一实施方式中,所述业务配置文件中还包括:所述用户的各个业务对应的子项目数据之间的依赖关系;所述从所述服务端获取所述第一访问地址上的数据文件中保存的子项目数据的步骤,包括:将所述指定业务对应的子项目数据确定为目标项目数据;根据所述依赖关系,判断加载所述目标项目数据时,是否需要加载除所述目标项目数据以外的子项目数据;如果需要,查找需要加载的除所述目标项目数据以外的子项目数据所在的数据文件的第二访问地址;分别从所述服务端获取所述第一访问地址和所述第二访问地址上的数据文件中保存的子项目数据。
在一实施方式中,所述方法还包括:如果接收到所述用户的业务更新请求,向所述服务端发送所述业务更新请求,以通过所述服务端更新所述用户对应的业务配置文件。
在一实施方式中,所述目标应用包括单页应用。
第二方面,本发明实施例提供的一种应用加载方法,所述方法包括:如果接收到来自客户端的对目标应用的访问请求,向所述客户端提供所述目标应用的主项目数据,以及所述访问请求对应的用户的业务配置文件;其中,所述业务配置文件中包括所述目标应用中所述用户的业务对应的子项目数据的访问地址信息;如果接收到来自所述客户端的对所述目标应用中指定业务的访问请求,向所述客户端提供所述指定业务对应的子项目数据;其中,所述指定业务的访问请求中携带有:所述业务配置文件中所述指定业务对应的子项目数据的访问地址信息。
第三方面,本发明实施例提供的一种应用加载装置,所述装置包括:第一获取模块,设置为如果接收到用户对目标应用的访问请求,从所述目标应用对应的服务端获取所述目标应用的主项目数据并加载所述主项目数据;第二获取模块,设置为从所述服务端获取所述用户对应的业务配置文件;其中,所述业务配置文件中包括所述目标应用中所述用户的业务对应的子项目数据的访问地址信息;第三获取模块,设置为如果接收到用户对所述目标应用中指定业务的访问请求,根据所述业务配置文件中所述指定业务对应的子项目数据的访问地址信息,从所述服务端获取所述指定业务对应的子项目数据,并加载获取到的指定业务对应的子项目数据。
第四方面,本发明实施例提供的一种应用加载装置,所述装置包括:第一提供模块,设置为如果接收到来自客户端的对目标应用的访问请求,向所述客户端提供所述目标应用的主项目数据,以及所述访问请求对应的用户的业务配置文件;其中,所述业务配置文件中包括所述目标应用中所述用户的业务对应的子项目数据的访问地址信息;第二提供模块,设置为如果接收到来自所述客户端的对所述目标应用中指定业务的访问请求,向所述客户端提供所述指定业务对应的子项目数据;其中,所述指定业务的访问请求中携带有:所述业务配置文件中所述指定业务对应的子项目数据的访问地址信息。
第五方面,本发明实施例提供的一种用户终端,包括处理器和存储器,所述存储器存储有能够被所述处理器执行的机器可执行指令,所述处理器执行所述机器可执行指令以实现上述第一方面所述的应用加载方法。
第六方面,本发明实施例提供的一种服务器,包括处理器和存储器,所述存储器存储有能够被所述处理器执行的机器可执行指令,所述处理器执行所述机器可执行指令以实现上述第二方面所述的应用加载方法。
本发明实施例提供的一种机器可读存储介质,该机器可读存储介质存储有机器可执行指令,该机器可执行指令在被处理器调用和执行时,机器可执行指令促使处理器实现上述第一方面和第二方面任一项所述的应用加载方法。
本发明实施例提供的应用加载方法、装置、用户终端和服务器,如果接收到用户对目标应用的访问请求,从目标应用对应的服务端获取该目标应用的主项目数据并加载主项目数据;从服务端获取用户对应的,包括目标应用中用户 的业务对应的子项目数据的访问地址信息的业务配置文件;如果接收到用户对目标应用中指定业务的访问请求,根据业务配置文件中指定业务对应的子项目数据的访问地址信息,从服务端获取该指定业务对应的子项目数据,并加载获取到的指定业务对应的子项目数据。该方法中,目标应用中的主项目数据和各个业务对应的子项目数据之间相互独立,同时,通过用户对应的业务配置文件即可获取该用户所使用的业务的子项目数据,用户终端无需加载目标应用的全部的项目数据,因而缩短了加载时延,提高了目标应用的用户体验度。
附图说明
为了更清楚的说明本发明实施例或相关技术的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本公开提供的一种前端架构示意图;
图2为本公开提供的一种应用加载方法的流程图;
图3为本公开提供的另一种应用加载方法的流程图;
图4为本公开提供的另一种应用加载方法的流程图;
图5为本公开提供的另一种应用加载方法的流程图;
图6为本公开提供的另一种应用加载方法的流程图;
图7为本公开提供的另一种前端架构示意图;
图8为本公开提供的一种应用加载装置的结构示意图;
图9为本公开提供的另一种应用加载装置的结构示意图;
图10为本公开提供的一种服务器或用户终端。
具体实施方式
下面将结合实施例对本发明实施例的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明实施例一部分实施例,而不是全部的实施例。基于本发明实施例中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明实施例保护的范围。
前端即网站前台部分,通常运行在PC(Personal Computer,个人计算机)设备,移动终端等设备的客户端或浏览器,用于展现给用户浏览的网页;单页 应用可以理解为整个WebApp(World Wide Web Application,Web应用)只有一个HTML(Hyper Text Markup Language,超文本标记语言)文件;目前,对单页应用的前端架构通常采用的方式,可以参照如图1所示的一种前端架构示意图,在一个单页应用前端工程项目中通常包含多个业务,如业务A、业务B、业务C和业务D等,每个业务由不同的开发人员进行开发维护,如:开发人员A负责开发维护业务A、开发人员B负责开发维护业务B等,每个业务对应的代码数据保存在各自的文件夹中,如业务A对应的代码数据保存在文件夹A中,业务B对应的代码数据保存在文件夹B中等,所有业务的文件夹都维护在一个git仓库中。
项目开发完毕后,将所有业务的文件夹汇总为一个总数据文件,即将图1中各个业务的文件夹综合为一个总的文件夹。当用户需要访问指定业务时,用户终端需要先加载包含所有业务数据文件的总数据文件,然后从该总数据文件中获取指定业务相关的数据并显示。
上述方式中,多个开发人员维护一个git仓库,导致在开发过程中,需要不断解决业务之间的代码冲突,如还需要对代码进行合并等,导致开发成本较大;如果业务需要更新,如对代码进行修改或删除等,则需要更新整个文件,导致项目的维护成本较高;并且随着业务增多,总数据文件中的代码数据量会越来越大,用户终端加载数据所需的时间较长,从而对用户操作的响应时间也较长。
基于上述问题,本发明实施例提供了一种应用加载方法、装置、用户终端和服务器,该技术可以应用于各类基于Web的系统和应用,如多网页应用、单网页应用等,尤其是可以应用于JavaScript文件较多,导致代码数据量较大的单网页应用。下面对本发明实施例所公开的一种应用加载方法进行详细介绍,如图2所示,该方法应用于用户终端;该方法包括如下步骤:
步骤S202,如果接收到用户对目标应用的访问请求,从该目标应用对应的服务端获取该目标应用的主项目数据并加载该主项目数据。
上述目标应用可以理解为用户所访问的应用项目,该应用项目可以为单页应用、多页应用等;该目标应用中通常包含一个或多个业务对应的项目数据;上述主项目数据可以不包含具体业务逻辑,一般仅包含目标应用的默认页面的 数据;主项目数据主要用于加载其他子项目对应资源的数据。该目标应用的主项目数据,以及各个业务对应的子项目数据均运行在服务端,当用户终端接收到用户对目标应用的访问请求后,从服务端加载该目标应用的主项目数据,以便为用户所需要的具体业务提供加载服务;该主项目数据也可以理解为用户后续访问指定业务的一个接口,通过该主项目数据访问指定业务。
在实际实现时,用户可以通过用户终端上的应用程序、浏览器等客户端发送目标应用的访问请求,该访问请求具体可以为目标应用的网址等信息。本实施例中,目标业务的主项目数据和各个业务对应的子项目数据之间相互独立,均位于各自的文件中。客户端接收到该访问请求后,无需从目标应用对应的服务端获取目标应用全部的代码数据,仅获取并加载主项目数据即可,从而缩短网页数据的加载时间。
步骤S204,从服务端获取上述用户对应的业务配置文件;其中,该业务配置文件中包括目标应用中该用户的业务对应的子项目数据的访问地址信息。
上述用户对应的业务配置文件可以包含用户需要访问或具有访问权限的业务的子项目数据的相关配置信息,如目标应用中用户的业务对应的子项目数据的访问地址、各个业务的子项目数据之间的依赖关系等;可以将业务配置文件与用户之间建立一一对应关系,即一个用户可以对应一个业务配置文件,考虑到不同用户的业务通常会有差异,其所对应的业务配置文件也不同;上述子项目数据可以理解为每个具体业务所对应的具体的项目数据。当接收到用户对目标应用的访问请求后,从服务端获取包括目标应用中用户的业务对应的子项目数据的访问地址信息的业务配置文件。
具体可以通过加载并运行前述步骤获取到的主项目数据,来获取到与用户对应的业务配置文件。
步骤S206,如果接收到上述用户对目标应用中指定业务的访问请求,根据业务配置文件中该指定业务对应的子项目数据的访问地址信息,从服务端获取该指定业务对应的子项目数据,并加载获取到的该指定业务对应的子项目数据。
上述指定业务可以理解为用户在目标应用中所使用的或购买的业务,该业务的数量可以为一个或多个。目标应用的主项目数据中通常包含有访问各个业 务的子项目数据的访问接口,用户通过触发指定业务的访问接口,即可向用户终端发送该指定业务的访问请求。当接收到用户对目标应用中指定业务的访问请求后,从该用户对应的业务配置文件中提取该指定业务的配置信息,并根据该配置信息中的访问地址信息,即可从服务端获取该指定业务所对应的子项目数据。
将上述获取到的子项目数据加载至用户的客户端,即可完成用户对该指定业务的访问。需要说明的是,前述步骤中,已经加载目标应用的主项目数据至客户端,当用户需要访问某个指定业务时,再加载该指定业务的子项目数据;如果用户后续还需要访问其他业务,则继续加载该业务的子项目数据。该方式中,实现了目标应用的主项目数据、各业务的子项目数据之间的解耦,各项目数据之间相互独立,相对于一次性加载目标应用全部数据的方式,这种仅加载部分数据的方式降低了加载数据量。
本发明实施例提供的应用加载方法,如果接收到用户对目标应用的访问请求,从目标应用对应的服务端获取该目标应用的主项目数据并加载主项目数据;从服务端获取用户对应的,包括目标应用中用户的业务对应的子项目数据的访问地址信息的业务配置文件;如果接收到用户对目标应用中指定业务的访问请求,根据业务配置文件中指定业务对应的子项目数据的访问地址信息,从服务端获取该指定业务对应的子项目数据,并加载获取到的指定业务对应的子项目数据。该方法中,目标应用中的主项目数据和各个业务对应的子项目数据之间相互独立,同时,通过用户对应的业务配置文件即可获取该用户所使用的业务的子项目数据,用户终端无需加载目标应用的全部的项目数据,因而缩短了加载时延,提高了目标应用的用户体验度。
本发明实施例还提供另一种应用加载方法,该方法在上述实施例方法的基础上实现;该方法重点描述从服务端获取用户对应的业务配置文件的具体实现过程,具体对应下述步骤S304,如图3所示,该方法包括以下步骤:
步骤S302,如果接收到用户对目标应用的访问请求,从该目标应用对应的服务端获取该目标应用的主项目数据并加载该主项目数据。
步骤S304,运行上述主项目数据中的指定脚本文件,从而获取上述用户对应的业务配置文件;其中,该业务配置文件中包括目标应用中用户的业务对 应的子项目数据的访问地址信息。
上述指定脚本文件可以是Python脚本文件,也可以是其他脚本文件;在实际实现时,可以通过运行主项目数据中的指定脚本文件,从服务器获取用户对应的业务配置文件;该业务配置文件可以是json格式的文件。
步骤S306,如果接收到上述用户对目标应用中指定业务的访问请求,根据业务配置文件中该指定业务对应的子项目数据的访问地址信息,从服务端获取该指定业务对应的子项目数据,并加载获取到的该指定业务对应的子项目数据。
上述应用加载方法,当接收到用户对目标应用的访问请求,从目标应用对应的服务端获取并加载目标应用的主项目数据后,运行主项目数据中的指定脚本文件,从而获取用户对应的业务配置文件。该方法中,目标应用中的主项目数据和各个业务对应的子项目数据之间相互独立,同时,通过用户对应的业务配置文件即可获取该用户所使用的业务的子项目数据,用户终端无需加载目标应用的全部的项目数据,因而缩短了加载时延,提高了目标应用的用户体验度。
本发明实施例还提供另一种应用加载方法,该方法在上述实施例方法的基础上实现;该方法重点描述根据业务配置文件中指定业务对应的子项目数据的访问地址信息,从服务端获取指定业务对应的子项目数据的具体实现过程,具体对应下述步骤S406-步骤S408。
该方法中,子项目数据的访问地址信息包括:子项目数据所在的数据文件的访问地址;业务配置文件中还包括:用户的各个业务对应的子项目数据之间的依赖关系;例如:用户在目标应用中所使用或购买的业务包括业务A和业务B,其中,业务A对应的子项目数据A所在的数据文件A的访问地址为a,业务B对应的子项目数据B所在的数据文件B的访问地址为b,则该用户对应的配置文件中包括访问地址a和访问地址b,以及子项目数据A和子项目数据B之间的依赖关系。
如图4所示,该方法包括以下步骤:
步骤S402,如果接收到用户对目标应用的访问请求,从该目标应用对应的服务端获取该目标应用的主项目数据并加载该主项目数据。
步骤S404,从服务端获取上述用户对应的业务配置文件;其中,该业务 配置文件中包括目标应用中用户的业务对应的子项目数据的访问地址信息。
步骤S406,如果接收到上述用户对上述目标应用中指定业务的访问请求,从该用户对应的业务配置文件中,查找该指定业务对应的子项目数据所在的数据文件的第一访问地址。
上述第一访问地址可以理解为保存数据文件的具体访问位置;业务配置文件中通常包含有用户指定业务对应的子项目数据所在的数据文件的第一访问地址,当接收到用户对目标应用中指定业务的访问请求后,从该用户对应的业务配置文件中查找所对应的数据文件的第一访问地址。在实际实现时,业务配置文件可以是通过Python脚本所生成的json文件,通过该json文件将子项目数据对应的静态资源加载至用户的客户端。
步骤S408,从服务端获取上述第一访问地址上的数据文件中保存的子项目数据。
当通过上述步骤查找到对应的数据文件的第一访问地址后,从服务端获取该第一访问地址上的数据文件,并从该数据文件中提取出所保存的子项目数据。在实际实现时,该步骤S408可以通过以下方法实现:
首先,将指定业务对应的子项目数据确定为目标项目数据。
上述目标项目数据可以理解为查找到的上述第一访问地址上的数据文件中,实际所保存的子项目数据。
然后,根据上述依赖关系,判断加载目标项目数据时,是否需要加载除目标项目数据以外的子项目数据。
上述依赖关系可以理解为各个子项目数据之间的耦合关系;当加载上述目标项目数据时,需要判断是否存在与该目标项目数据存在耦合关系的其他子项目数据。
进而,如果需要,查找需要加载的除目标项目数据以外的子项目数据所在的数据文件的第二访问地址。
若通过判断,确认存在与该目标项目数据存在耦合关系的其他子项目数据,则在提取该目标项目数据时,需要同时提取出与其存在耦合关系的其他子项目数据,这时,通常需要先从该用户对应的业务配置文件中查找其他子项目数据所在的数据文件的第二访问地址。
最后,分别从服务端获取第一访问地址和第二访问地址上的数据文件中保存的子项目数据。
从服务端获取第一访问地址上的数据文件中保存的目标项目数据,以及,从第二访问地址上的数据文件中保存的子项目数据;作为示例,如果子项目数据A为目标项目数据,子项目数据B与子项目数据A之间存在一定的关联关系,则需要同时提取子项目数据A和子项目数据B。
步骤S410,加载获取到的上述指定业务对应的子项目数据。
上述应用加载方法,当接收到用户对目标应用中指定业务的访问请求后,从该用户对应的业务配置文件中,查找该指定业务对应的子项目数据所在的数据文件的访问地址,获取该访问地址上的数据文件中保存的子项目数据,以及与该子项目数据存在依赖关系的其他子项目数据。该方法中,目标应用中的主项目数据和各个业务对应的子项目数据之间相互独立,同时,通过用户对应的业务配置文件即可获取该用户所使用的业务的子项目数据,用户终端无需加载目标应用的全部的项目数据,因而缩短了加载时延,提高了目标应用的用户体验度。
本发明实施例还提供另一种应用加载方法,该方法在上述实施例方法的基础上实现;如图5所示,该方法包括以下步骤:
步骤S502,如果接收到用户对目标应用的访问请求,从该目标应用对应的服务端获取该目标应用的主项目数据并加载该主项目数据。
步骤S504,从服务端获取上述用户对应的业务配置文件;其中,该业务配置文件中包括目标应用中用户的业务对应的子项目数据的访问地址信息。
步骤S506,如果接收到上述用户对目标应用中指定业务的访问请求,根据业务配置文件中该指定业务对应的子项目数据的访问地址信息,从服务端获取该指定业务对应的子项目数据,并加载获取到的该指定业务对应的子项目数据。
步骤S508,如果接收到上述用户的业务更新请求,向服务端发送该业务更新请求,以通过服务端更新该用户对应的业务配置文件。
上述业务更新请求可以理解为用户需要增加或删除业务的请求等,当接收到用户的业务更新请求后,向服务端发送该业务更新请求,以使服务端根据该 业务更新请求,更新该用户的业务配置文件,作为示例,如果用户请求增加业务,则在该用户的业务配置文件中增加该业务对应的子项目数据的相关配置信息,同时增加该业务与其它业务之间的依赖关系;如果用户请求删除指定业务,则在该用户的业务配置文件中删除该指定业务对应的子项目数据的相关配置信息,同时删除该业务与其它业务之间的依赖关系。
上述应用加载方法,当接收到用户的业务更新请求后,向服务端发送业务更新请求,以通过服务端更新用户对应的业务配置文件。该方法中,目标应用中的主项目数据和各个业务对应的子项目数据之间相互独立,同时,通过用户对应的业务配置文件即可获取该用户所使用的业务的子项目数据,用户终端无需加载目标应用的全部的项目数据,因而缩短了加载时延,提高了目标应用的用户体验度。在上述目标应用的维护阶段,如果用户需要更新业务,或业务功能本身需要更新,只需要更新该业务对应的子项目数据即可,无需整体修改应用代码,项目的维护成本较低。
本发明实施例还提供另一种应用加载方法,该方法可以应用于服务端,该服务端可以运行在网页服务器、代理服务器等服务器上;如图6所示,该方法包括如下步骤:
步骤S602,如果接收到来自客户端的对目标应用的访问请求,向客户端提供该目标应用的主项目数据,以及该访问请求对应的用户的业务配置文件;其中,该业务配置文件中包括目标应用中用户的业务对应的子项目数据的访问地址信息。
上述目标应用可以包括单页应用,也可以包括多页应用等其他应用项目;其中,单页应用可以理解为整个WebApp只有一个HTML文件,里面的各个功能页面是javascript通过hash或者history api来进行路由,并通过ajax(Asynchronous Javascript And XML,异步JavaScript和XML)拉取数据来实现的响应功能,上述整个WebApp只有一个HTML的应用即为单页应用;还可以理解为,在应用整个使用流程中,浏览器由始至终没有刷新,所有的数据交互由ajax完成,但有明确的页面区分,即所谓的WebApp。
单页WebApp(single page web application,单页Web应用),可以理解为只有一张Web页面的应用。SPA是加载单个HTML页面并在用户与应用程序 交互时动态更新该页面的Web应用程序。浏览器一开始会加载必需的HTML、CSS(Cascading Style Sheets,层叠样式表)和JavaScript,所有的操作都在这张页面上完成,都由JavaScript来控制。
当接收到来自客户端的对目标应用的访问请求后,向客户端提供目标应用的主项目数据,以及访问请求对应的,包括目标应用中用户的业务对应的子项目数据的访问地址信息的业务配置文件。
步骤S604,如果接收到来自客户端的对目标应用中指定业务的访问请求,向客户端提供该指定业务对应的子项目数据;其中,该指定业务的访问请求中携带有:业务配置文件中指定业务对应的子项目数据的访问地址信息。
当服务端接收到来自客户端的对目标应用中指定业务的访问请求,向客户端提供指定业务对应的子项目数据;其中,该子项目数据通常包括,该指定业务对应的目标项目数据,以及与该目标项目数据有依赖关系的其他子项目数据;该访问请求中通常携带有指定业务对应的目标项目数据的访问地址信息,以及与该目标项目数据有依赖关系的其他子项目数据的访问地址信息。
上述应用加载方法,可以应用于服务端,如果接收到来自客户端的对目标应用的访问请求,向客户端提供目标应用的主项目数据,以及访问请求对应的用户的业务配置文件;如果接收到来自客户端的对目标应用中指定业务的访问请求,向客户端提供指定业务对应的子项目数据;该方法中,目标应用中的主项目数据和各个业务对应的子项目数据之间相互独立,同时,通过用户对应的业务配置文件即可获取该用户所使用的业务的子项目数据,用户终端无需加载目标应用的全部的项目数据,因而缩短了加载时延,提高了目标应用的用户体验度。
另外,上述目标应用在开发阶段,目标应用中的主项目数据和各个业务对应的子项目数据分别维护在不同的git仓库中,避免了所有的业务的代码数据都维护在同一个git仓库中导致的代码冲突,从而降低了项目开发成本。在上述目标应用的维护阶段,如果用户需要更新业务,或业务功能本身需要更新,只需要更新该业务对应的子项目数据即可,无需整体修改应用代码,项目的维护成本较低。
本发明实施例还提供另一种应用加载方法,该方法在上述实施例方法的基 础上实现;该方法包括如下两个步骤:
步骤一,如果接收到来自客户端的对目标应用的访问请求,向客户端提供目标应用的主项目数据,以及访问请求对应的用户的业务配置文件;其中,业务配置文件中包括目标应用中用户的业务对应的子项目数据的访问地址信息。
上述目标应用包括主项目数据所在的数据文件和至少一种业务对应的子项目数据所在的数据文件;该主项目数据和该业务对应的子项目数据分别保存在各自的数据文件中;如果业务为多种,每种业务对应的子项目数据保存在各自的数据文件中,例如,目标应用中共开发了两个业务,分别为业务A和业务B,主项目数据保存在数据文件main中,业务A对应的子项目数据保存在数据文件A中,业务B对应的子项目数据保存在数据文件B中,则目标应用中包括数据文件main和数据文件A,或者数据文件main和数据文件B,或者同时包含该数据文件main、数据文件A和数据文件B;上述各数据文件之间相互独立。
用于保存主项目数据的数据文件和用于保存业务对应的子项目数据的数据文件,可以通过以下方法生成:
首先,从上述主项目数据所在的git仓库中获取该主项目数据。
在应用开发过程中,主项目数据维护在一个单独的git仓库中,该git仓库可以是一个开源的分布式版本控制系统,可以理解为托管在网络上的项目仓库,其中可以包括一个或多个业务对应的项目数据;GitHub是一个面向开源及私有软件项目的托管平台,只支持git作为唯一的版本库格式进行托管。如果git仓库中包含主项目数据,则从该git仓库中获取该主项目数据,在实际实现时,上述包含主项目数据的git仓库可以用“git仓库main”来表示。
其次,从每种业务对应的子项目数据所在的git仓库中分别获取相应的子项目数据。
在项目开发过程中,每个业务的子项目数据维护在一个单独的git仓库中,即,每种业务对应的子项目数据存储在各自独立的git仓库中,因而通常在每种业务及其该业务对应的子项目数据与git仓库之间建立一一对应关系,各个子项目数据之间相互独立,彼此之间耦合程度较低。例如,git仓库A中包含业务A及该业务A对应的子项目数据A,git仓库B中包含业务B及该业务B 对应的子项目数据B等等。
目标应用开发完成后,从各个git仓库中分别获取对应的子项目数据,例如,从git仓库A中获取子项目数据A,从git仓库B中获取子项目数据B等,每个子项目数据形成一个单独的数据文件,主项目数据也形成一个单独的数据文件。目标应用在维护过程中,可以根据客户需求,方便地增加或删除新的子项目数据,并且不需要整体修改目标应用的代码,例如,目标应用开发了三个业务,分别为业务A、业务B和业务C,用户购买了业务A和业务B,如果用户还需要购买业务C,则在该用户对应的配置文件中增加业务C的相关配置信息;如果用户不再需要业务A或业务B,通常从配置文件中删除该业务A或业务B的相关配置信息即可;如果需要对目标应用开发新的业务D,则在项目开发过程中,为业务D建立对应的git仓库D,开发完成后,生成该业务D的子项目数据对应的数据文件。
最后,通过Webpack对上述主项目数据和上述子项目数据进行打包处理,得到该主项目数据所在的数据文件和每种业务对应的子项目数据所在的数据文件。
本实施例中,上述Webpack可以用于对项目中的一个或多个业务所对应的项目数据进行打包,在打包过程中分析各个业务对应的项目数据之间的依赖关系,例如:一个项目数据和另外一个或多个项目数据之间的关联关系,如引用关系等;具体的,通过Webpack对主项目数据进行打包处理,得到包含主项目数据的数据文件;通过Webpack对各个子项目数据分别进行打包处理,得到分别包含各个子项目数据的数据文件。
步骤二,如果接收到来自客户端的对目标应用中指定业务的访问请求,向客户端提供指定业务对应的子项目数据;其中,指定业务的访问请求中携带有:业务配置文件中指定业务对应的子项目数据的访问地址信息。
上述目标应用在开发阶段,目标应用中的主项目数据和各个业务对应的子项目数据分别维护在不同的git仓库中,避免了所有的业务的代码数据都维护在同一个git仓库中导致的代码冲突,从而降低了项目开发成本。在上述目标应用的维护阶段,如果用户需要更新业务,或业务功能本身需要更新,只需要更新该业务对应的子项目数据即可,无需整体修改应用代码,项目的维护成本 较低。
为进一步理解上述实施例,下面提供另一种前端架构示意图,如图7所示,项目开发过程中,通常会创建多个git仓库,主项目数据保存在git仓库main中,主项目数据通常不包含业务逻辑,主要负责加载子项目数据资源;多个子项目数据分别保存在各自对应的git仓库中,保存在git仓库A中的业务A及其对应的子项目数据A由开发人员A负责开发和维护,保存在git仓库B中的业务B及其对应的子项目数据B由开发人员B负责开发和维护等。git仓库main与git仓库A、git仓库B等之间是相互独立的;通过Python脚本生成子项目静态资源配置json文件,通过json文件加载子项目数据对应的静态资源。项目开发完成后,将所创建的多个git仓库上传至服务器,每个子项目数据形成一个单独的数据文件,主项目数据也形成一个单独的数据文件。
在项目运行过程中,根据用户在客户端上的操作指令,向服务端发送指定业务的访问请求,由主项目数据根据该用户的业务配置文件加载不同的子项目数据对应的数据文件即可,该用户的业务配置文件中还记录了各个子项目数据之间的依赖关系。如果用户只需要一部分业务,如业务A、业务B和业务C,则只需要生成业务A、业务B和业务C的业务配置文件即可,一个用户对应一个业务配置文件,业务配置文件所指向的子项目数据即为用户所需要的子项目数据。相关技术中,对于单页应用项目,比如,开始只有一个业务项,后期可能会拓展至十几个业务项,导致单页应用项目中会包含较多的业务配置文件,项目比较复杂;而本方案中的架构方式,只需要根据用户指定的业务需求生成对应的业务配置文件即可,可以有效降低单页应用项目的复杂度。
上述架构方式基于Webpack技术,把各个业务拆分成为单个独立的git仓库,然后通过Jenkins发布上线;可以理解为在客户端和后端大数据之间设置了一个数据中台,该数据中台可以理解为通过数据技术,对海量数据进行采集、计算、存储、加工,同时统一标准和口径。用户在控制台可以管理大数据信息,如查看监控、操作数据库等。
企业在服务于用户时,不同的用户可能是不同的需求,企业在企业和用户之间,设置一个数据中台,数据中台把数据统一之后,会形成标准数据,再进行存储,形成大数据资产层,进而为客户提供高效服务,最大程度保障不同群 体的用户需求。这些服务跟企业的业务有较强的关联性,是企业独有的且能复用的,它是企业业务和数据的沉淀,其不仅能降低重复建设、减少烟囱式协作的成本,也是差异化竞争优势所在。
在当今互联网时代,用户才是商业战场的中心,为了快速响应用户的需求,借助平台化的力量可以事半功倍。不断快速响应、探索、挖掘、引领用户的需求,才是企业得以生存和持续发展的关键因素。
上述实施例所述的方法,也可以理解为一种前端自动化脚手架架构;其中,前端即网站前台部分,运行在PC端,移动端等浏览器上展现给用户浏览的网页。脚手架可以理解为项目开发的前期工作。每开始新建一个项目,需要先搭建好整个文件目录结构,建好必要的文件,即为搭建脚手架的过程,每次新建项目都需要这个过程,脚手架可以减少用户的重复性工作。
作为示例,如果用户需要新建一个项目0,源语言为ES6(ECMAScript 6,一种JavaScript语音标准),采用sass(Syntactically Awesome Stylesheets,审计准则说明书)语言,后端是node.js(node.js是服务器端的JavaScript运行环境)。用户每完成一部分功能,需要重复执行把ES6编译到ES5、编译sass、压缩html文件的操作过程;为了减少上述重复性工作,用户可以采用gulp(一种基于node的自动化构建工具)工具,实现在前端开发过程中对代码进行自动化构建,用户可以预先准备好gulp脚本,每次有代码改动,通过简单的gulp build就可以完成上述重复性工作。
如果用户还需要新建项目1,项目2、项目3等,并且与项目0一样,采用源语言为ES6,sass语言,后端是node.js,每次都用相同的技术栈,就需要用户为后续的多个项目重复准备类似gulp脚本,即,准备多个gulp脚本也成了重复性工作。而脚手架可以帮助用户减少这些重复性工作,通过脚手架就可以建好目录结构、gulp脚本、babel配置、空的测试文件,用户可以直接写核心业务代码,节省了用户的重复性工作,这就是脚手架的作用。
对应于上述方法实施例,参见图8所示的一种应用加载装置的结构示意图,该装置包括:第一获取模块80,设置为如果接收到用户对目标应用的访问请求,从目标应用对应的服务端获取目标应用的主项目数据并加载主项目数据;第二获取模块81,设置为从服务端获取用户对应的业务配置文件;其中, 业务配置文件中包括目标应用中用户的业务对应的子项目数据的访问地址信息;第三获取模块82,设置为如果接收到用户对目标应用中指定业务的访问请求,根据业务配置文件中指定业务对应的子项目数据的访问地址信息,从服务端获取指定业务对应的子项目数据,并加载获取到的指定业务对应的子项目数据。
本发明实施例提供的应用加载装置,如果接收到用户对目标应用的访问请求,从目标应用对应的服务端获取该目标应用的主项目数据并加载主项目数据;从服务端获取用户对应的,包括目标应用中用户的业务对应的子项目数据的访问地址信息的业务配置文件;如果接收到用户对目标应用中指定业务的访问请求,根据业务配置文件中指定业务对应的子项目数据的访问地址信息,从服务端获取该指定业务对应的子项目数据,并加载获取到的指定业务对应的子项目数据。该装置中,目标应用中的主项目数据和各个业务对应的子项目数据之间相互独立,同时,通过用户对应的业务配置文件即可获取该用户所使用的业务的子项目数据,用户终端无需加载目标应用的全部的项目数据,因而缩短了加载时延,提高了目标应用的用户体验度。
在一实施方式中,第二获取模块81还设置为:运行主项目数据中的指定脚本文件,从而获取用户对应的业务配置文件。
在一实施方式中,子项目数据的访问地址信息包括:子项目数据所在的数据文件的访问地址;第三获取模块82还设置为:从用户对应的业务配置文件中,查找指定业务对应的子项目数据所在的数据文件的第一访问地址;从服务端获取第一访问地址上的数据文件中保存的子项目数据。
在一实施方式中,业务配置文件中还包括:用户的各个业务对应的子项目数据之间的依赖关系;第三获取模块82还设置为:将指定业务对应的子项目数据确定为目标项目数据;根据依赖关系,判断加载目标项目数据时,是否需要加载除目标项目数据以外的子项目数据;如果需要,查找需要加载的除目标项目数据以外的子项目数据所在的数据文件的第二访问地址;分别从服务端获取第一访问地址和第二访问地址上的数据文件中保存的子项目数据。
在一实施方式中,该装置还设置为:如果接收到用户的业务更新请求,向服务端发送业务更新请求,以通过服务端更新用户对应的业务配置文件。
在一实施方式中,目标应用包括单页应用。
本发明实施例所提供的应用加载装置,其实现原理及产生的技术效果和前述应用加载方法实施例相同,为简要描述,应用加载装置实施例部分未提及之处,可参考前述应用加载方法实施例中相应内容。
对应于上述方法实施例,参见图9所示的另一种应用加载装置的结构示意图,该装置包括:第一提供模块90,设置为如果接收到来自客户端的对目标应用的访问请求,向客户端提供目标应用的主项目数据,以及访问请求对应的用户的业务配置文件;其中,业务配置文件中包括目标应用中用户的业务对应的子项目数据的访问地址信息;第二提供模块91,设置为如果接收到来自客户端的对目标应用中指定业务的访问请求,向客户端提供指定业务对应的子项目数据;其中,指定业务的访问请求中携带有:业务配置文件中指定业务对应的子项目数据的访问地址信息。
在一实施方式中,主项目数据和业务对应的子项目数据分别保存在各自的数据文件中,如果业务为多种,每种业务对应的子项目数据保存在各自的数据文件中。
在一实施方式中,设置为保存主项目数据的数据文件和设置为保存业务对应的子项目数据的数据文件,通过下述方式生成:从主项目数据所在的git仓库中获取主项目数据;从每种业务对应的子项目数据所在的git仓库中分别获取相应的子项目数据;通过Webpack对主项目数据和子项目数据进行打包处理,得到设置为保存主项目数据的数据文件和设置为保存业务对应的子项目数据的数据文件。
另外,上述目标应用在开发阶段,目标应用中的主项目数据和各个业务对应的子项目数据分别维护在不同的git仓库中,避免了所有的业务的代码数据都维护在同一个git仓库中导致的代码冲突,从而降低了项目开发成本。在上述目标应用的维护阶段,如果用户需要更新业务,或业务功能本身需要更新,只需要更新该业务对应的子项目数据即可,无需整体修改应用代码,项目的维护成本较低。
本发明实施例还提供了一种服务器和用户终端,参见图10所示,该服务器或用户终端包括处理器130和存储器131,该存储器131存储有能够被处理 器130执行的机器可执行指令,该处理器130执行机器可执行指令以实现上述应用加载方法。
进一步地,图10所示的服务器或用户终端还包括总线132和通信接口133,处理器130、通信接口133和存储器131通过总线132连接。
其中,存储器131可能包含高速随机存取存储器(RAM,Random Access Memory),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个通信接口133(可以是有线或者无线)实现该系统网元与至少一个其他网元之间的通信连接,可以使用互联网,广域网,本地网,城域网等。总线132可以是ISA总线、PCI总线或EISA总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图10中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。
处理器130可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器130中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器130可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(Digital Signal Processor,简称DSP)、专用集成电路(Application Specific Integrated Circuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器131,处理器130读取存储器131中的信息,结合其硬件完成前述实施例的方法的步骤。
本发明实施例还提供了一种机器可读存储介质,该机器可读存储介质存储有机器可执行指令,该机器可执行指令在被处理器调用和执行时,该机器可执行指令促使处理器实现上述应用加载方法,具体实现可参见方法实施例,在此 不再赘述。
本发明实施例所提供的应用加载方法、装置、用户终端和服务器的计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行前面方法实施例中所述的方法,具体实现可参见方法实施例,在此不再赘述。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。
工业实用性
基于本发明实施例提供的应用加载方法、装置、用户终端和服务器,目标应用中的主项目数据和各个业务对应的子项目数据之间相互独立,同时,通过用户对应的业务配置文件即可获取该用户所使用的业务的子项目数据,用户终端无需加载目标应用的全部的项目数据,因而缩短了加载时延,提高了目标应用的用户体验度。

Claims (15)

  1. 一种应用加载方法,所述方法包括:
    如果接收到用户对目标应用的访问请求,从所述目标应用对应的服务端获取所述目标应用的主项目数据并加载所述主项目数据;
    从所述服务端获取所述用户对应的业务配置文件;其中,所述业务配置文件中包括所述目标应用中所述用户的业务对应的子项目数据的访问地址信息;
    如果接收到用户对所述目标应用中指定业务的访问请求,根据所述业务配置文件中所述指定业务对应的子项目数据的访问地址信息,从所述服务端获取所述指定业务对应的子项目数据,并加载获取到的指定业务对应的子项目数据。
  2. 根据权利要求1所述的方法,其中,所述从服务端获取所述用户对应的业务配置文件的步骤,包括:
    运行所述主项目数据中的指定脚本文件,从而获取所述用户对应的业务配置文件。
  3. 根据权利要求1所述的方法,其中,所述子项目数据的访问地址信息包括:所述子项目数据所在的数据文件的访问地址;
    所述根据所述业务配置文件中所述指定业务对应的子项目数据的访问地址信息,从所述服务端获取所述指定业务对应的子项目数据的步骤,包括:
    从所述用户对应的业务配置文件中,查找所述指定业务对应的子项目数据所在的数据文件的第一访问地址;
    从所述服务端获取所述第一访问地址上的数据文件中保存的子项目数据。
  4. 根据权利要求3所述的方法,其中,所述业务配置文件中还包括:所述用户的各个业务对应的子项目数据之间的依赖关系;
    所述从所述服务端获取所述第一访问地址上的数据文件中保存的子项目数据的步骤,包括:
    将所述指定业务对应的子项目数据确定为目标项目数据;
    根据所述依赖关系,判断加载所述目标项目数据时,是否需要加载除所述目标项目数据以外的子项目数据;
    如果需要,查找需要加载的除所述目标项目数据以外的子项目数据所在的 数据文件的第二访问地址;
    分别从所述服务端获取所述第一访问地址和所述第二访问地址上的数据文件中保存的子项目数据。
  5. 根据权利要求1所述的方法,其中,所述方法还包括:如果接收到所述用户的业务更新请求,向所述服务端发送所述业务更新请求,以通过所述服务端更新所述用户对应的业务配置文件。
  6. 根据权利要求1至5任一项所述的方法,其中,所述目标应用包括单页应用。
  7. 一种应用加载方法,所述方法包括:
    如果接收到来自客户端的对目标应用的访问请求,向所述客户端提供所述目标应用的主项目数据,以及所述访问请求对应的用户的业务配置文件;其中,所述业务配置文件中包括所述目标应用中所述用户的业务对应的子项目数据的访问地址信息;
    如果接收到来自所述客户端的对所述目标应用中指定业务的访问请求,向所述客户端提供所述指定业务对应的子项目数据;其中,所述指定业务的访问请求中携带有:所述业务配置文件中所述指定业务对应的子项目数据的访问地址信息。
  8. 根据权利要求7所述的方法,其中,所述主项目数据和所述业务对应的子项目数据分别保存在各自的数据文件中,如果所述业务为多种,每种所述业务对应的子项目数据保存在各自的数据文件中。
  9. 根据权利要求8所述的方法,其中,用于保存所述主项目数据的数据文件和用于保存所述业务对应的子项目数据的数据文件,通过下述方式生成:
    从所述主项目数据所在的git仓库中获取所述主项目数据;
    从每种所述业务对应的子项目数据所在的git仓库中分别获取相应的子项目数据;
    通过Webpack对所述主项目数据和所述子项目数据进行打包处理,得到用于保存所述主项目数据的数据文件和用于保存所述业务对应的子项目数据的数据文件。
  10. 根据权利要求7所述的方法,其中,所述业务配置文件为json文件。
  11. 一种应用加载装置,所述装置包括:
    第一获取模块,设置为如果接收到用户对目标应用的访问请求,从所述目标应用对应的服务端获取所述目标应用的主项目数据并加载所述主项目数据;
    第二获取模块,设置为从所述服务端获取所述用户对应的业务配置文件;其中,所述业务配置文件中包括所述目标应用中所述用户的业务对应的子项目数据的访问地址信息;
    第三获取模块,设置为如果接收到用户对所述目标应用中指定业务的访问请求,根据所述业务配置文件中所述指定业务对应的子项目数据的访问地址信息,从所述服务端获取所述指定业务对应的子项目数据,并加载获取到的指定业务对应的子项目数据。
  12. 一种应用加载装置,所述装置包括:
    第一提供模块,设置为如果接收到来自客户端的对目标应用的访问请求,向所述客户端提供所述目标应用的主项目数据,以及所述访问请求对应的用户的业务配置文件;其中,所述业务配置文件中包括所述目标应用中所述用户的业务对应的子项目数据的访问地址信息;
    第二提供模块,设置为如果接收到来自所述客户端的对所述目标应用中指定业务的访问请求,向所述客户端提供所述指定业务对应的子项目数据;其中,所述指定业务的访问请求中携带有:所述业务配置文件中所述指定业务对应的子项目数据的访问地址信息。
  13. 一种用户终端,包括处理器和存储器,所述存储器存储有能够被所述处理器执行的机器可执行指令,所述处理器执行所述机器可执行指令以实现权利要求1至6任一项所述的应用加载方法。
  14. 一种服务器,包括处理器和存储器,所述存储器存储有能够被所述处理器执行的机器可执行指令,所述处理器执行所述机器可执行指令以实现权利要求7-10任一项所述的应用加载方法。
  15. 一种机器可读存储介质,该机器可读存储介质存储有机器可执行指令,该机器可执行指令在被处理器调用和执行时,机器可执行指令促使处理器实现权利要求1至10任一项所述的应用加载方法。
PCT/CN2020/126880 2019-12-20 2020-11-06 应用加载方法、装置、用户终端和服务器 WO2021120913A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911335288.7A CN113010149B (zh) 2019-12-20 2019-12-20 应用加载方法、装置、用户终端和服务器
CN201911335288.7 2019-12-20

Publications (1)

Publication Number Publication Date
WO2021120913A1 true WO2021120913A1 (zh) 2021-06-24

Family

ID=76383021

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/126880 WO2021120913A1 (zh) 2019-12-20 2020-11-06 应用加载方法、装置、用户终端和服务器

Country Status (2)

Country Link
CN (1) CN113010149B (zh)
WO (1) WO2021120913A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113835732A (zh) * 2021-09-29 2021-12-24 马上消费金融股份有限公司 版本更新方法及相关设备

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114385191A (zh) * 2021-12-11 2022-04-22 埃夫特智能装备股份有限公司 一种基于git的知识资产交易管理系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105260206A (zh) * 2015-10-10 2016-01-20 北京京东尚科信息技术有限公司 数据源插件实现方法及服务器
CN105975319A (zh) * 2016-05-26 2016-09-28 天脉聚源(北京)传媒科技有限公司 一种加载应用程序的方法及装置
CN106293311A (zh) * 2015-05-26 2017-01-04 阿里巴巴集团控股有限公司 基于移动应用的页面显示方法、客户端、服务器及平台
US20180089326A1 (en) * 2004-10-04 2018-03-29 Iii Holdings 1, Llc System and Method for Stepped Loading of Web Page Content
CN109284458A (zh) * 2018-09-28 2019-01-29 平安普惠企业管理有限公司 网页显示方法、装置、计算机设备及存储介质
CN109542538A (zh) * 2018-11-22 2019-03-29 郑州云海信息技术有限公司 一种子系统管理方法和系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007179209A (ja) * 2005-12-27 2007-07-12 Hitachi Ltd 業務プロセスやドキュメントの記録・管理方法
CN108228305A (zh) * 2018-02-02 2018-06-29 广东欧珀移动通信有限公司 应用页面的显示方法、装置、存储介质及电子设备
CN110365724B (zh) * 2018-04-08 2021-11-02 腾讯科技(深圳)有限公司 任务处理方法、装置及电子设备
CN109783076A (zh) * 2018-12-14 2019-05-21 深圳壹账通智能科技有限公司 基于git的代码管理方法、装置、设备和存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180089326A1 (en) * 2004-10-04 2018-03-29 Iii Holdings 1, Llc System and Method for Stepped Loading of Web Page Content
CN106293311A (zh) * 2015-05-26 2017-01-04 阿里巴巴集团控股有限公司 基于移动应用的页面显示方法、客户端、服务器及平台
CN105260206A (zh) * 2015-10-10 2016-01-20 北京京东尚科信息技术有限公司 数据源插件实现方法及服务器
CN105975319A (zh) * 2016-05-26 2016-09-28 天脉聚源(北京)传媒科技有限公司 一种加载应用程序的方法及装置
CN109284458A (zh) * 2018-09-28 2019-01-29 平安普惠企业管理有限公司 网页显示方法、装置、计算机设备及存储介质
CN109542538A (zh) * 2018-11-22 2019-03-29 郑州云海信息技术有限公司 一种子系统管理方法和系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113835732A (zh) * 2021-09-29 2021-12-24 马上消费金融股份有限公司 版本更新方法及相关设备

Also Published As

Publication number Publication date
CN113010149B (zh) 2024-04-05
CN113010149A (zh) 2021-06-22

Similar Documents

Publication Publication Date Title
CN111221521B (zh) 日志代码的生成方法、装置、计算机系统和可读存储介质
WO2022033055A1 (zh) 页面渲染方法、装置、设备及计算机可读存储介质
US20130191439A1 (en) Managing script file dependencies and load times
US20130054792A1 (en) Cloud-based performance testing of functionality of an application prior to completion of development
AU2012238127B2 (en) Recovery of tenant data across tenant moves
CN106293675B (zh) 系统静态资源加载方法及装置
WO2021120913A1 (zh) 应用加载方法、装置、用户终端和服务器
US20200249921A1 (en) Structured development for web application frameworks
CN112256772A (zh) 数据服务方法、装置以及可读存储介质
CN107391528B (zh) 前端组件依赖信息搜索方法及设备
US11775290B2 (en) Detection of API backward compatibility across software versions
US20240095298A1 (en) Systems and methods for rendering interactive web pages
CN108959294B (zh) 一种访问搜索引擎的方法和装置
CN116069725A (zh) 文件迁移方法、装置、设备、介质和程序产品
CN116414855A (zh) 信息处理方法及装置、电子设备和计算机可读存储介质
US11250084B2 (en) Method and system for generating content from search results rendered by a search engine
US11843679B2 (en) Automated dependency management based on page components
US10223393B1 (en) Efficient processing of source code objects using probabilistic data structures
CN113064987A (zh) 数据处理方法、装置、电子设备、介质和程序产品
US20160321226A1 (en) Insertion of unsaved content via content channel
CN107341263B (zh) 一种静态页面数据处理的方法及装置
US10445306B1 (en) Database index storage based on temporal data
CN110740046A (zh) 分析服务契约的方法和装置
CN112965747B (zh) 挖掘代码漏洞的方法、装置、设备和计算机可读介质
US11960560B1 (en) Methods for analyzing recurring accessibility issues with dynamic web site behavior and devices thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20901630

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20901630

Country of ref document: EP

Kind code of ref document: A1