CN110187932B - Business data page loading method and system - Google Patents

Business data page loading method and system Download PDF

Info

Publication number
CN110187932B
CN110187932B CN201910433563.2A CN201910433563A CN110187932B CN 110187932 B CN110187932 B CN 110187932B CN 201910433563 A CN201910433563 A CN 201910433563A CN 110187932 B CN110187932 B CN 110187932B
Authority
CN
China
Prior art keywords
page
loading
function
service data
functional
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201910433563.2A
Other languages
Chinese (zh)
Other versions
CN110187932A (en
Inventor
王明臣
解媛
方翔
王栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Electronics Technology Taili Communication Technology Co.,Ltd.
Original Assignee
Beijing Potevio Taili Communication Technology Co ltd
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 Beijing Potevio Taili Communication Technology Co ltd filed Critical Beijing Potevio Taili Communication Technology Co ltd
Priority to CN201910433563.2A priority Critical patent/CN110187932B/en
Publication of CN110187932A publication Critical patent/CN110187932A/en
Application granted granted Critical
Publication of CN110187932B publication Critical patent/CN110187932B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a method and a system for loading a service data page, wherein the method comprises the following steps: loading service data of a first function page in a main page; generating a multiplexing component of a second functional page in the first functional page; and calling the multiplexing component in the main page to load the service data of the second function page. According to the business data page loading method and system provided by the embodiment of the invention, after the first function page is loaded on the main page, the page fragment content of the second function page is directly obtained in the first function page, so that the second function page can be multiplexed in the first function page, and therefore, business data with different functions can be loaded without switching pages, the page loading speed and the page response time are improved, meanwhile, code redundancy is reduced, resources are saved, and the operation is more efficient.

Description

Business data page loading method and system
Technical Field
The invention relates to the technical field of computers, in particular to a business data page loading method and system.
Background
At present, for the paged loading of business data, functional pages are componentized and fragmented, and relevant parameters and variables of the pages are stored in corresponding JS pages to complete the loading.
However, in the above-mentioned service data loading manner in the prior art, if the loaded content is a non-single-page application, the service data may be lost, for example, the data set at present is lost after the page jump is performed.
Therefore, a new method for loading service data pages is needed to solve the above problems.
Disclosure of Invention
In order to solve the above problems, embodiments of the present invention provide a method and a system for loading a service data page, which overcome the above problems or at least partially solve the above problems.
In a first aspect, an embodiment of the present invention provides a method for loading a service data page, including:
loading service data of a first functional page in a main page;
generating a multiplexing component of a second functional page in the first functional page;
and calling the multiplexing component in the main page to load the service data of the second functional page.
A second aspect of the present invention further provides a service data page loading system, including:
the main page loading module is used for loading the service data of the first functional page in the main page;
the function page multiplexing module is used for generating a multiplexing component of a second function page in the first function page;
and the function page loading module is used for calling the multiplexing component in the main page to load the service data of the second function page.
Third aspect an embodiment of the present invention provides an electronic device, including:
a processor, a memory, a communication interface, and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the business data page loading method.
In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, where the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the above service data page loading method.
According to the business data page loading method and system provided by the embodiment of the invention, after the first function page is loaded on the main page, the page fragment content of the second function page is directly obtained in the first function page, so that the second function page can be multiplexed in the first function page, and therefore, business data with different functions can be loaded without switching pages, the page loading speed and the page response time are improved, meanwhile, code redundancy is reduced, resources are saved, and the operation is more efficient.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for loading a service data page according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a service data page loading system according to an embodiment of the present invention;
fig. 3 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments, but not all embodiments, of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flowchart of a method for loading a service data page according to an embodiment of the present invention, as shown in fig. 1, including:
101. loading service data of a first functional page in a main page;
102. generating a multiplexing component of a second functional page in the first functional page;
103. and calling the multiplexing component in the main page to load the service data of the second functional page.
It should be noted that, an execution subject of the embodiment of the present invention is a computer device, and in order to solve a problem of service data loss that may exist when non-single-page function applications are switched in the prior art, an embodiment of the present invention provides a service data page loading method.
Specifically, in step 101, the main page is an spa (single page application) page in the embodiment of the present invention, that is, only one Web page is applied, and all operations of the service data are completed on the main page and generally controlled by JavaScript. When the service data of the first function needs to be loaded, the embodiment of the present invention may directly load the component fragment page of the first function and the resource file corresponding to the first function in the main interface, and during actual operation, a new functional page is created in the embodiment of the present invention as the service component of the main page to store the currently used service data, that is, the service data of the first function.
It can be understood that, when service data of different functions needs to be switched, in step 102, in the embodiment of the present invention, page content of a second function page is directly obtained from a first function page, where the page content includes parameter configuration, permission configuration, personalized display configuration, and the like, and then the second function page is generated as a reusable component according to the page content, that is, a multiplexing component in the embodiment of the present invention. It should be noted that the first functional page and the second functional page are only used for name differentiation, and do not imply access sequence or execution logic.
Finally, in step 103, after the second function page is generated as a multiplexing component, the component fragment page of the second function and corresponding resources, parameter configuration information, and the like can be directly loaded in the main page, and during actual operation, the multiplexing component is called in the newly-built function page, so that the data stored in the function page is replaced by the service data of the second function, and direct switching of the function page is realized without repeated loading.
According to the business data page loading method provided by the embodiment of the invention, after the first function page is loaded on the main page, the page fragment content of the second function page is directly obtained in the first function page, so that the second function page can be multiplexed in the first function page, and therefore, business data with different functions can be loaded without switching pages, the page loading speed and the page response time are improved, meanwhile, the code redundancy is reduced, the resources are saved, and the operation is more efficient.
On the basis of the above embodiment, before the loading the service data of the first functional page in the main page, the method further includes:
initializing all page parameters in a main page, and storing the page parameters to a page global variable.
It can be understood that, before loading the service data page, all parameters of the user, including user login information, authority authentication information, etc., need to be initialized, and then the initialized result is saved to the page global variable. It can be understood that the embodiment of the present invention divides the front end of the computer into a global configuration and a service local configuration, the global configuration stores global information such as data interaction request configuration and personal permission configuration, and the service local configuration only stores personalized parameters for specific functions, so that the function loading only needs to adjust the service local configuration without adjusting the global configuration.
On the basis of the above embodiment, the loading the service data of the first functional page in the main page includes:
loading page fragment content and parameter configuration information with a first function in the main page;
and storing the content of the page segment with the first function and the parameter configuration information into a corresponding JS file.
As can be seen from the content of the above embodiment, in the embodiment of the present invention, the first function page is loaded, the component fragment page having the first function and the parameter configuration information are substantially loaded, the component fragment page further includes the resource file corresponding to the first function, then the loaded content of the page fragment having the first function and the parameter configuration information are stored in the corresponding JS file for parameter persistence, and in a specific implementation, after the page loading is completed, the system automatically loads and logs in the personal information of the user, and then reads the configuration data related to the user. And classifying and storing the data according to types by combining the loading result and the default configuration item of the system, wherein the Storage address generally adopts a JSON object of a Javascript file and the Storage (Cookie and Storage) of a browser, so that the reusability of service data is achieved as much as possible, and the Http repeated request is avoided.
Preferably, the embodiment of the invention adopts an AJAX mode, and can meet the requirement of multiplexing page service data without refreshing a global page. It should be noted that part of the parameters of the first function may need to be stored in the storage in html.
On the basis of the foregoing embodiment, the multiplexing component for generating the second functional page in the first functional page includes:
and acquiring the fragment content of the second function page from the first function page in a preset loading mode so as to convert the second function page into the multiplexing component.
As can be seen from the content of the foregoing embodiment, in the embodiment of the present invention, a multiplexing component of a second function page needs to be generated in a first function page, and specifically, in the embodiment of the present invention, a page fragment content having a second function is obtained according to a preset resource loading manner, so that the second function page is converted into the multiplexing component. It can be known from the content of the above embodiment that, after the page loading is completed, the system of the embodiment of the present invention automatically loads and logs in the personal information of the user and then reads the configuration data related to the user. And classifying and storing the data according to types by combining the loading result and the default configuration item of the system, wherein the Storage address generally adopts a JSON object of a Javascript file and the Storage (Cookie and Storage) of a browser, so as to realize the reusability of the service data.
It can be understood that the process of generating the multiplexing component in the embodiment of the present invention is based on multiplexing at the JavaScript code level, rather than based on the HTML source code, and therefore when other modules in the system need to multiplex the component, the corresponding JS file of the component can be directly introduced, and the corresponding JS object method is executed, so that the dynamic HTML page rendering and display can be performed without modification from the HTML source code.
On the basis of the above embodiment, the preset loading manner includes:
popup loads or page partial loads.
Preferably, the embodiment of the present invention provides two ways of loading the content of the second functional page segment on the first functional page, which are popup loading or page local loading, respectively. And the popup loading means that the page fragment content of the second function is displayed in a popup mode in the first function page, and the page local loading means that a part of preset areas in the first function page is selected for fixed representation.
On the basis of the above embodiment, the invoking the multiplexing component in the main page to load the service data of the second functional page includes:
calling the multiplexing component to acquire the page fragment content with the second function and parameter configuration information;
and loading the page segment content and the parameter configuration information corresponding to the first function page in the main page based on the page segment content and the parameter configuration information with the second function.
The embodiment of the invention calls the multiplexing component, thereby loading the component fragment page with the second function and the corresponding resource and parameter configuration information to the main page, and simultaneously removing the page fragment content and the parameter configuration information corresponding to the first function page, so that only the page fragment content and the parameter configuration information corresponding to the second function page are reserved in the function page. When the second functional page needs to be switched to other functional pages, the switching can be completed in a similar way without repeated loading.
Fig. 2 is a schematic structural diagram of a service data page loading system provided in an embodiment of the present invention, as shown in fig. 2, including: a main page loading module 201, a function page multiplexing module 202 and a function page loading module 203, wherein:
the main page loading module 201 is configured to load service data of a first function page in a main page;
the function page multiplexing module 202 generates a multiplexing component of a second function page in the first function page;
the function page loading module 203 is configured to call the multiplexing component in the main page to load the service data of the second function page.
Specifically, how to use the main page loading module 201, the functional page multiplexing module 202, and the functional page loading module 203 to execute the technical solution of the embodiment of the service data page loading method shown in fig. 1 is similar, and the implementation principle and the technical effect thereof are similar, and are not described herein again.
According to the business data page loading system provided by the embodiment of the invention, after the first function page is loaded on the main page, the page fragment content of the second function page is directly obtained in the first function page, so that the second function page can be multiplexed in the first function page, and therefore, business data with different functions can be loaded without switching pages, the page loading speed and the page response time are improved, meanwhile, the code redundancy is reduced, the resources are saved, and the operation is more efficient.
On the basis of the above embodiment, the system further includes:
and the initialization module is used for initializing all page parameters in the main page and storing the page parameters to the page global variable.
On the basis of the above embodiment, the main page loading module is specifically configured to:
loading page fragment content and parameter configuration information with a first function in the main page;
and storing the content of the page segment with the first function and the parameter configuration information into a corresponding JS file.
On the basis of the above embodiment, the function page multiplexing module is specifically configured to:
and acquiring the fragment content of the second function page from the first function page in a preset loading mode so as to convert the second function page into the multiplexing component.
On the basis of the above embodiment, the preset loading manner includes:
popup loads or page partial loads.
On the basis of the above embodiment, the functional page loading module is specifically configured to:
calling the multiplexing component to acquire the page fragment content with the second function and parameter configuration information;
and loading the page segment content and the parameter configuration information corresponding to the first function page in the main page based on the page segment content and the parameter configuration information with the second function.
An embodiment of the present invention provides an electronic device, including: at least one processor; and at least one memory communicatively coupled to the processor, wherein:
fig. 3 is a block diagram of a structure of another electronic device according to an embodiment of the present invention, and referring to fig. 3, the electronic device includes: a processor (processor)301, a communication Interface (Communications Interface)302, a memory (memory)303 and a bus 304, wherein the processor 301, the communication Interface 302 and the memory 303 are configured to communicate with each other via the bus 304. Processor 301 may call logic instructions in memory 303 to perform the following method: loading service data of a first function page in a main page; generating a multiplexing component of a second functional page in the first functional page; and calling the multiplexing component in the main page to load the service data of the second functional page.
An embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer can execute the methods provided by the above method embodiments, for example, the method includes: loading service data of a first functional page in a main page; generating a multiplexing component of a second functional page in the first functional page; and calling the multiplexing component in the main page to load the service data of the second functional page.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer instructions, which cause a computer to execute the method provided by the above method embodiments, for example, including: loading service data of a first function page in a main page; generating a multiplexing component of a second functional page in the first functional page; and calling the multiplexing component in the main page to load the service data of the second functional page.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to each embodiment or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (7)

1. A method for loading service data page is characterized by comprising the following steps:
loading service data of a first functional page in a main page;
generating a multiplexing component of a second functional page in the first functional page;
calling the multiplexing component in the main page to load the service data of the second functional page;
the loading of the service data of the first functional page in the main page includes:
loading page fragment content with a first function and parameter configuration information in the main page;
storing the page segment content with the first function and the parameter configuration information into a corresponding JS file;
the multiplexing component for generating the second functional page in the first functional page comprises:
acquiring the fragment content of the second function page from the first function page in a preset loading mode so as to convert the second function page into the multiplexing component;
wherein, the obtaining the fragment content of the second function page from the first function page through a preset loading manner to convert the second function page into the multiplexing component includes:
after the page loading is finished, automatically loading and logging in personal information of a user, reading configuration data related to the user, and classifying and storing the data according to types by combining a loading result and default configuration items of the system so as to convert the second function page into the multiplexing component.
2. The method for loading service data page according to claim 1, wherein before said loading service data of the first functional page in the main page, said method further comprises:
initializing all page parameters in a main page, and storing the page parameters to a page global variable.
3. The business data page loading method according to claim 1, wherein the preset loading manner comprises:
popup loads or page partial loads.
4. The method for loading service data page according to claim 1, wherein said calling the multiplexing component in the main page to load service data of the second functional page comprises:
calling the multiplexing component to acquire the page fragment content with the second function and parameter configuration information;
and loading the page segment content and the parameter configuration information corresponding to the first function page in the main page based on the page segment content and the parameter configuration information with the second function.
5. A business data page loading system, comprising:
the main page loading module is used for loading the service data of the first functional page in the main page;
the function page multiplexing module is used for generating a multiplexing component of a second function page in the first function page;
a function page loading module, configured to call the multiplexing component in the main page to load service data of the second function page;
the loading of the service data of the first functional page in the main page includes:
loading page fragment content and parameter configuration information with a first function in the main page;
storing the page segment content with the first function and the parameter configuration information into a corresponding JS file;
the multiplexing component for generating the second functional page in the first functional page comprises:
acquiring the fragment content of the second function page from the first function page in a preset loading mode so as to convert the second function page into the multiplexing component;
wherein, the obtaining the fragment content of the second function page in the first function page through a preset loading manner to convert the second function page into the multiplexing component includes:
after the page loading is finished, automatically loading and logging in personal information of a user, reading configuration data related to the user, and classifying and storing the data according to types by combining a loading result and default configuration items of the system so as to convert the second function page into the multiplexing component.
6. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method for page loading of service data according to any of claims 1 to 4 are implemented when the program is executed by the processor.
7. A non-transitory computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, performs the steps of the method for loading a service data page according to any one of claims 1 to 4.
CN201910433563.2A 2019-05-23 2019-05-23 Business data page loading method and system Active CN110187932B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910433563.2A CN110187932B (en) 2019-05-23 2019-05-23 Business data page loading method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910433563.2A CN110187932B (en) 2019-05-23 2019-05-23 Business data page loading method and system

Publications (2)

Publication Number Publication Date
CN110187932A CN110187932A (en) 2019-08-30
CN110187932B true CN110187932B (en) 2022-06-14

Family

ID=67717440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910433563.2A Active CN110187932B (en) 2019-05-23 2019-05-23 Business data page loading method and system

Country Status (1)

Country Link
CN (1) CN110187932B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111612501B (en) * 2020-04-11 2023-09-26 上海淇玥信息技术有限公司 Information generation method and device based on strategy multiplexing and electronic equipment
CN112651012B (en) * 2020-12-28 2023-03-24 五八同城信息技术有限公司 Information processing method and device
CN114090146B (en) * 2021-10-28 2023-06-16 青岛海尔科技有限公司 Method, device and equipment for determining completion of data loading
CN114416369B (en) * 2022-01-19 2024-04-26 重庆长安汽车股份有限公司 Method and system for distributing data in instrument

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108446116B (en) * 2018-02-26 2021-10-08 平安普惠企业管理有限公司 Application program page generation method and device, computer equipment and storage medium
CN108874389A (en) * 2018-06-27 2018-11-23 中国建设银行股份有限公司 front end page development framework
CN109508191B (en) * 2018-11-22 2022-03-22 北京腾云天下科技有限公司 Code generation method and system

Also Published As

Publication number Publication date
CN110187932A (en) 2019-08-30

Similar Documents

Publication Publication Date Title
CN110187932B (en) Business data page loading method and system
US11144711B2 (en) Webpage rendering method, device, electronic apparatus and storage medium
WO2017088509A1 (en) Page customization method and device
CN113010827B (en) Page rendering method and device, electronic equipment and storage medium
US11269611B2 (en) Data interface processing method, device, server and medium
CN111124574A (en) First screen rendering acceleration method, development terminal, server, system and electronic equipment
CN111131352A (en) Theme switching method and device
CN114138372B (en) Front-end component loading method and device
CN110750255A (en) Applet rendering method and device
CN107479868B (en) Interface loading method, device and equipment
CN109299331B (en) Method and device for displaying hypertext markup language HTML5 page by Air
CN108345683B (en) Webpage display method, device, terminal and storage medium
CN113296823A (en) Method, device, equipment and storage medium for generating resource configuration file
CN112214250B (en) Application program component loading method and device
CN111737614B (en) Page display method, page display device, electronic equipment and storage medium
US9407584B2 (en) Instant messaging terminal and method for displaying session message in real time
CN105868201B (en) Page generation method and device
CN113835803A (en) Application theme display method and device
CN104317819A (en) Method and system for webpage cross-domain communication based on browsers
CN110807162A (en) Method and device for loading occupation bitmap
CN113076099A (en) Page generation method, device, equipment and computer storage medium
CN112926002A (en) Service request processing method and device
CN110362305B (en) Form component state switching method and device
CN112527424A (en) Control method and device for popup window
CN107622063B (en) Page switching method and device for avoiding white pages

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 1206, 12th Floor, No. 6 North 2nd Street, Haidian District, Beijing, 100080

Patentee after: China Electronics Technology Taili Communication Technology Co.,Ltd.

Address before: 12 / F, Putian building, No. 6, Beier street, Haidian District, Beijing 100080

Patentee before: BEIJING POTEVIO TAILI COMMUNICATION TECHNOLOGY Co.,Ltd.