Page loading method and device, storage medium and electronic equipment

By pre-setting the target interface function set and hook function on the client side, and using the hook function to process component resources, the problem of wasting time in building different types of component interface functions during page loading is solved, and the page loading efficiency is improved.

CN118626159AActive Publication Date: 2024-09-10TENCENT CLOUD COMPUTING (BEIJING) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202310232040.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-10
Publication Date
2024-09-10
Estimated Expiration
2043-03-10

AI Technical Summary

Technical Problem

During the page loading process, the same page may contain multiple different types of components, causing the client to receive the serialized data returned by the server multiple times and temporarily construct different coding protocol interface functions, resulting in increased time consumption and low efficiency.

Method used

By pre-setting the target interface function set and hook function on the client side, and using the hook function to call the interface function set to process component resources, it reduces the time of rebuilding interface functions for different types of components and improves loading efficiency.

Benefits of technology

It achieves efficient loading of different types of components, reduces page loading time, and improves overall page loading efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626159A
    Figure CN118626159A
Patent Text Reader

Abstract

The invention discloses a page loading method and device, a storage medium and electronic equipment. The method comprises the steps that a page loading request is sent to a server, and the page loading request comprises an identifier of a first component on a target page to be loaded on a client; acquiring a first component resource set of the first component sent by the server; a first interface function set is called through the first hook function to process the first component resource set, so that a first component on the target page is displayed on the client side, and the first interface function set comprises interface functions needed for displaying the first component in a target interface function set preset in the client side; the target interface function set comprises interface functions required for displaying each component in the target component set, and the first hook function is a function preset in the client. According to the method and the device, the technical problem of relatively low efficiency in page loading in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a page loading method and device, a storage medium, and an electronic device. Background Art

[0002] In the related art, the method for implementing page loading includes: the client sends a page loading request to the server; the server parses the page loading request, obtains the component ID and the encoding method of the component currently requested to be loaded, and temporarily constructs an interface function in the coding protocol; then serializes the component resources according to the type of the parsed encoding method to obtain serialized data; returns the serialized data to the client through the interface function in the temporarily constructed coding protocol, and uses the system operation function to load the component.

[0003] However, during the page loading process, the same page may include multiple components of different types. According to the above loading method, for different types of components, different coding protocol interface functions need to be temporarily constructed, so that the client receives serialized data returned by the server multiple times to complete the loading of the page components. In this process, transmitting different serialized data from the server to the client and temporarily constructing interface functions in the coding protocol consume a lot of time, which increases the loading time of each component and the loading time of the entire page, resulting in technical problems of low efficiency during page loading.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a page loading method and device, a storage medium, and an electronic device to at least solve the technical problem of low efficiency that occurs during the page loading process.

[0006] According to one aspect of an embodiment of the present application, a page loading method is provided, including: sending a page loading request to a server, wherein the page loading request includes an identifier of a first component on a target page to be loaded on a client; obtaining a first component resource set of the first component sent by the server; processing the first component resource set by calling a first interface function set through a first hook function to display the first component on the target page on the client, wherein the first interface function set includes interface functions required to display the first component in a target interface function set pre-set in the client, the target interface function set includes interface functions required to display each component in the target component set, at least some of the components in the target component set are components formed using different encoding methods, and the first hook function is a function pre-set in the client.

[0007] Optionally, the above method also includes: when the client is started or after the client is started, replacing the function triggered to be executed when the first component is displayed in the client from the first system operation function to the first hook function, wherein the first system operation function is an operation function in the operating system where the client is located, the first system operation function is set to prohibit calling interface functions in the target interface function set, and the first hook function is set to allow calling interface functions in the target interface function set.

[0008] Optionally, the above-mentioned processing of the first component resource set by calling the first interface function set through the first hook function includes: assigning the first component resource to the input parameter in the first interface function through the first key-value coding KVC statement in the first hook function, and running the first interface function to obtain the processing result of the first component resource, wherein the first component resource is a component resource in the first component resource set, and the first interface function is an interface function in the first interface function set for processing the first component resource.

[0009] Optionally, the above-mentioned processing of the first component resource set by calling the first interface function set through the first hook function includes: when the first component resource set includes N component resources with a hierarchical relationship, the N component resources are assigned to input parameters in a set of interface functions through a set of KVC statements in the first hook function, and a set of interface functions are run to obtain processing results of the N component resources, wherein N is a positive integer greater than or equal to 2, and a set of interface functions are interface functions in the first interface function set for processing N component resources; and the processing results of the N component resources are combined according to the hierarchical relationship.

[0010] Optionally, the above-mentioned processing of the first component resource set by calling the first interface function set through the first hook function includes: when the first component is a component for displaying pictures, and the first component resource set includes encoding information of a target picture to be displayed, calling the picture decoding interface function through the first hook function to decode the encoding information of the target picture to obtain the target picture, wherein the first interface function set includes the picture decoding interface function; or when the first component is a component for displaying pictures, and the first component resource set includes encoding information of a group of pictures to be displayed, calling the picture decoding interface function through the first hook function to decode the encoding information of a group of pictures in sequence to obtain a group of pictures.

[0011] Optionally, the above method further comprises: when the client is started or after the client is started, setting each interface function in the target interface function set to be in a state where it is allowed to be called.

[0012] Optionally, the above method also includes: when the page loading request also includes the identifier of the second component on the target page to be loaded on the client, obtaining a second component resource set of the second component sent by the server, wherein the first component and the second component are components formed by different encoding methods; calling the second interface function set through the first hook function to process the second component resource set to display the second component on the target page on the client, wherein the second interface function set includes the interface functions required to display the second component in the target interface function set.

[0013] Optionally, the second interface function set and the first interface function set have some of the same interface functions; or, the second interface function set is the same as the first interface function set.

[0014] Optionally, the above-mentioned obtaining of the first component resource set of the first component sent by the server includes: receiving a target protocol message sent by the server to the client, wherein the extensible field in the protocol header of the target protocol message carries the first component resource set; obtaining the first component resource set from the extensible field in the protocol header of the target protocol message.

[0015] Optionally, the method further includes: obtaining the first hook function and the target interface function set from the installation file of the client when installing the client; or obtaining the first hook function and the target interface function set from the server after the client is started.

[0016] Optionally, the above-mentioned obtaining of the first component resource set of the first component sent by the server includes: obtaining serialized data sent by the server, wherein the serialized data is data obtained by serializing the first component resource set; and deserializing the serialized data to obtain the first component resource set.

[0017] According to another aspect of an embodiment of the present application, a page loading device is also provided, including: a first sending unit, used to send a page loading request to a server, wherein the page loading request includes an identifier of a first component on a target page to be loaded on a client; a first acquisition unit, used to acquire a first component resource set of the first component sent by the server; a first processing unit, used to process the first component resource set by calling a first interface function set through a first hook function to display the first component on the target page on the client, wherein the first interface function set includes interface functions required to display the first component in a target interface function set pre-set in the client, the target interface function set includes interface functions required to display each component in the target component set, at least some of the components in the target component set are components formed by different encoding methods, and the first hook function is a function pre-set in the client.

[0018] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned page loading method when running.

[0019] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program / instruction, which implements the steps of the above method when executed by a processor.

[0020] According to another aspect of the embodiments of the present application, there is further provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the page loading method through the computer program.

[0021] Through the above-mentioned embodiment provided by the present application, when the first component resource set of the first component sent by the server is obtained, the first component resource set is processed by calling the target interface function set pre-set in the client through the first hook function, and the first component is loaded by using the interface function required to display the first component in the target interface function set, so that the first component is displayed on the target page. In other words, for different types of components, the interface functions required to display different components in the target interface function set can be used respectively to process the component resource sets of different types of components, so that each component can be displayed on the target page, which reduces the time spent on rebuilding different interface functions for different types of components, improves the loading efficiency of components, solves the technical problem of low efficiency in the page loading process, and achieves the technical effect of improving page loading efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0023] Figure 1 is a schematic diagram of an application scenario of an optional page loading method according to an embodiment of the present application;

[0024] Figure 2 is a flowchart of an optional page loading method according to an embodiment of the present application;

[0025] Figure 3 It is a schematic diagram of different display forms of an optional carousel image in an application according to an embodiment of the present application;

[0026] Figure 4 is a timing flow chart of an optional page loading method according to an embodiment of the present application;

[0027] Figure 5 is an optional flowchart of processing component data based on KVC according to an embodiment of the present application;

[0028] Figure 6 It is a specific embodiment of an optional hook function calling an interface function in an interface function set to encode component resources according to an embodiment of the present application;

[0029] Figure 7 is a schematic diagram of an optional method of transmitting component data using the STEP protocol according to an embodiment of the present application;

[0030] Figure 8 is a schematic diagram of an optional serialization operation on component data according to an embodiment of the present application;

[0031] Fig. 9 is a schematic structural diagram of an optional page loading device according to an embodiment of the present application;

[0032] Fig.10 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0035] The technical solutions in the embodiments of the present application will comply with legal provisions during implementation. When performing operations according to the technical solutions in the embodiments, the data used will not involve user privacy. While ensuring that the operation process is compliant and legal, the security of the data is guaranteed.

[0036] Glossary:

[0037] KVC: Key-value coding, key-value coding is a mechanism enabled by the NSKeyValueCoding informal protocol, which objects adopt to provide indirect access to their properties. When an object conforms to key-value coding, its properties can be addressed through string parameters through a concise, unified messaging interface;

[0038] STEP protocol: also known as the lightweight real-time STEP message transmission protocol, it mainly optimizes the underlying financial data transmission in the financial industry.

[0039] According to one aspect of the embodiments of the present application, a page loading method is provided. As an optional implementation, the page loading method can be applied to, but is not limited to, Figure 1 The application scenario shown in Figure 1 In the application scenario shown, the terminal device 102 may, but is not limited to, communicate with the server 106 via the network 104, and the server 106 may, but is not limited to, perform operations on the database 108, such as write data operations or read data operations. The above-mentioned terminal device 102 may, but is not limited to, include a human-computer interaction screen, a processor, and a memory. The above-mentioned human-computer interaction screen may, but is not limited to, be used to display a loading page on the terminal device 102, a first component displayed on a target page, etc. The above-mentioned processor may, but is not limited to, be used to respond to the above-mentioned human-computer interaction operation, perform a corresponding operation, or generate a corresponding instruction, and send the generated instruction to the server 106. The above-mentioned memory is used to store relevant processing data, such as a page loading request, a first component resource set, an identifier of the first component, etc.

[0040] As an optional manner, the following steps in the page loading method can be executed on the server 106: step S102, sending a page loading request to the server, wherein the page loading request includes an identifier of the first component on the target page to be loaded on the client; step S104, obtaining a first component resource set of the first component sent by the server; step S106, calling a first interface function set through a first hook function to process the first component resource set to display the first component on the target page on the client, wherein the first interface function set includes interface functions required to display the first component in a target interface function set pre-set in the client, the target interface function set includes interface functions required to display each component in the target component set, at least some of the components in the target component set are components formed by different encoding methods, and the first hook function is a function pre-set in the client.

[0041] By adopting the above method, when the first component resource set of the first component sent by the server is obtained, the first component resource set is processed by calling the target interface function set pre-set in the client through the first hook function, and the first component is loaded by using the interface function required to display the first component in the target interface function set, so that the first component is displayed on the target page. In other words, for different types of components, the interface functions required to display different components in the target interface function set can be used respectively to process the component resource sets of different types of components, so that each component can be displayed on the target page, reducing the time spent on rebuilding different interface functions for different types of components, improving the loading efficiency of components, solving the technical problem of low efficiency in the page loading process, and achieving the technical effect of improving page loading efficiency.

[0042] In order to solve the problem of low efficiency in the above-mentioned page loading, a page loading method is proposed in an embodiment of the present application. Figure 2 is a flow chart of a page loading method according to an embodiment of the present application, the flow includes the following steps:

[0043] Step S202, sending a page loading request to the server, wherein the page loading request includes an identifier of a first component on a target page to be loaded on the client;

[0044] Step S204, obtaining a first component resource set of the first component sent by the server;

[0045] Step S206, calling the first interface function set through the first hook function to process the first component resource set, so as to display the first component on the target page on the client, wherein the first interface function set includes the interface functions required to display the first component in the target interface function set pre-set in the client, the target interface function set includes the interface functions required to display each component in the target component set, at least some of the components in the target component set are components formed by different encoding methods, and the first hook function is a function pre-set in the client.

[0046] In the embodiment of the present application, the number and type of components on the page are not limited. For example, the components on the page include two pictures and a button; or the components on the page include Figure 3 The carousel, comment box, etc. shown.

[0047] exist Figure 3 In the example, assuming that there are 4 pictures in total, the display forms of the carousel pictures include but are not limited to Figure 3 There are three situations shown in the figure: (1) The currently displayed picture is picture 1-1. By sliding the page to the right, picture 1-1 is switched to another picture. Figure 3 As shown in (a); (2) Assume that the currently displayed picture is picture 2-2, and within a preset time interval, picture 2-2 is automatically rotated to other pictures, such as Figure 3 (b); (3) according to the transparency rotation play mode, for example, four pictures are overlapped, by setting the transparency of the picture, and according to the size of the transparency, the picture 3-1 and other pictures are played in sequence, such as Figure 3 As shown in (b).

[0048] for Figure 3 The three types of carousels shown can be understood as three different types of components. The page loading method in the embodiment of the present application is optimized for data transmission, reading, writing and assembly of diversified components, which will be described in detail in the following embodiments.

[0049] Combine the following Figure 4 The overall solution of the above page loading method is introduced.

[0050] When a page loading request is sent from a client to a server, the server receives the first component identifier Z in the received page loading request. 1 _ID, returns the first component resource set to the client, wherein the first component resource set includes data such as the position, character length, font, font size, etc. for displaying the first component, such as steps S402-S404.

[0051] When the server sends the first component resource set to the client, it encodes the binary data of each component data. Therefore, the client side needs to process the binary data (for example, decode it) before loading the component and displaying it on the target page. For example, the client calls the interface function required for displaying the first component in the first interface function set through the hook function to display the first component. For details, please refer to steps S406 to S408.

[0052] In this embodiment, it is assumed that the first hook function is a hook function, and the target function set pre-set on the client includes interface functions required for displaying different types of components, that is, the target function set includes the interface function required for displaying the first component, and the first component resource set is processed by displaying the interface function required for the first component, for example, decoding the resources in the first component resource set, storing the decoded data, displaying the components, etc., so that the first component is displayed on the target page.

[0053] The first component resource set is processed by calling the interface function required to display the first component in the target interface function set through the hook function, for example, Figure 4 As shown, the interface functions required to display the first component include an interface function API_dec (Res_1=xx, L) for decoding the first component resource set, and an interface function API_disp (Res_2=xx, Path=xxx) for determining the display mode of the first component.

[0054] It should be noted that the hook function is a special message processing mechanism that can monitor various event messages in the system or process, intercept messages sent to the target window and process them.

[0055] As an optional example, the application of the first hook function in the embodiment of the present application includes:

[0056] When the client is started or after the client is started, the function triggered to be executed when the first component is displayed in the client is replaced from the first system operation function to the first hook function, wherein the first system operation function is an operation function in the operating system where the client is located, the first system operation function is set to prohibit calling interface functions in a target interface function set, and the first hook function is set to allow calling interface functions in a target interface function set.

[0057] As an optional implementation, the first hook function and the target interface function set are obtained in the following manner:

[0058] When installing the client, obtaining the first hook function and the target interface function set from the installation file of the client; or

[0059] After the client is started, the first hook function and the target interface function set are obtained from the server.

[0060] Combine the following Figure 5 , describes in detail the process of unifying different types of component data based on KVC.

[0061] It is easy to understand that during the development process, the front-end developers will code the pages or components according to the standard UI diagrams involved in the product or UI personnel, and the back-end needs to assemble according to the component data that the front-end needs to display. Therefore, during the development process, it is necessary to unify the component data of various types based on KVC. The specific process is as follows:

[0062] (1) Through step S502, the "source class" after the object of the access operation KVC is encapsulated, and different types of persistence operation methods dynamically generate derived data classes based on the source class, including database, archive, key-value pair, file, etc.

[0063] The source class can be, but is not limited to, understood as a page instance or a memory area, based on which a page can be rendered. By performing KVC encapsulation on the source class, a derived data class is obtained.

[0064] By using runtime technology and executing step S504, the address of the original image data operation function is obtained in the source class, and then a hook function of its own is created. Finally, by executing step S506, the function addresses of the two are replaced to realize the exchange of the existing data storage method.

[0065] Each derived class implements each specific data operation function, and the operation functions of the original image are expanded in an enumerated manner. For example, there are four basic operation functions for accessing the database: add, delete, modify, and query. In the derived database class, the four functions will be enumerated first, and then these four types of functions will be rewritten. The rewriting process is to preset each field according to the key-value-coding method in KVC. Each time the component data is accessed, the access object, key value, return value, and the corresponding storage coding rules need to be determined. Finally, the enumerated function is replaced through the hook function of the source class;

[0066] (2) The configuration layer of the server receives configuration instructions from products and operators, maps corresponding component types, and operates corresponding component data through derived data classes, as shown in step S510;

[0067] The configuration layer is provided to the corresponding operators in the form of web pages, and the basic component elements can be arbitrarily combined to form independent functional components, such as carousels, players, posters, feed information flows, etc. Each configured component will generate a unique corresponding ID on the server for mapping, and the component configuration information can be obtained through the ID, such as the number of pictures contained in the carousel, description tags and carousel intervals, internal coordinates, etc.

[0068] (3) Based on the diverse component types, determine the corresponding clusters and split the control granularity, including labels, buttons, pictures, input boxes, progress bars, etc. When the derived data class is saved as component elements, the fine-grained control cluster will be used to implement their own coding methods. Each coding will have a key value path to save the cluster, and keyPath access will be performed based on the cluster's attribute dimension. For example, when coding labels in different carousels, they will be accessed through keyPath according to the label's font, font size, character length, position and other attributes, as shown in step S512.

[0069] It should be noted that when the client is started or after the client is started, each interface function in the target interface function set is set to be in a state where it is allowed to be called.

[0070] As an optional example, the above-mentioned processing of the first component resource set by calling the first interface function set through the first hook function includes:

[0071] The first component resource is assigned to the input parameter in the first interface function through the first key-value coding KVC statement in the first hook function, and the first interface function is run to obtain the processing result of the first component resource, wherein the first component resource is a component resource in the first component resource set, and the first interface function is an interface function in the first interface function set for processing the first component resource.

[0072] like Figure 6 As shown, it is assumed that the target page includes component 1 (first component) Z to be loaded 1 and component 2 (denoted as Z 2 ), when receiving the page loading request sent by the client including the identifier of component 1, the server returns the first component resource set to the client.

[0073] When the client receives the first component resource set, if it is detected that the first system operation function calls the interface function in the target interface function set, Figure 5 In step S508, the function triggered to be executed when the first component is displayed is replaced from the first system operation function to the first hook function ( Figure 6 hook1 function shown).

[0074] Assume that the hook1 function includes a first interface function set and a key-value KVC statement that can be called, wherein the first interface function set includes a first interface function API_dec(Res_1=xx, L) and a second interface function API_disp(Res_2=xx, Path=xxx). Through the first key-value coding KVC statement L=kvc_setvalue(Res_Z 1 ), assign the first component resource to the input parameter L in the first interface function, and run the first interface function to obtain the processing result of the first component resource.

[0075] For example, when the input parameter L in the first interface function represents the encoding method, the first key-value encoding KVC statement L=kvc_setvalue(Res_Z 1 ), the value of the input parameter L in the first interface function can be directly determined, for example, the pre-set xml encoding, json encoding, etc.

[0076] By running the first interface function, the first component resource sent by the server can be encoded. When the input parameter L is xml encoding, execute Figure 6 The xml decoding paragraph shown in ; when the input parameter L is json encoded, execute Figure 6 The json decoding paragraph shown in .

[0077] It should be noted that, usually, one component corresponds to one hook function, and the number of interface functions in the target interface function set that a hook function can call is not fixed. For example, when displaying component 1, the number of interface functions allowed to be called is 2, and when displaying component 2, the number of interface functions allowed to be called is 3, and so on. It is specifically related to the steps that need to be performed to display each component.

[0078] As another optional example, the above-mentioned processing of the first component resource set by calling the first interface function set through the first hook function includes:

[0079] In the case where the first component resource set includes N component resources having a hierarchical relationship, the N component resources are assigned to input parameters in a set of interface functions through a set of KVC statements in the first hook function, and the set of interface functions are run to obtain processing results of the N component resources, wherein N is a positive integer greater than or equal to 2, and the set of interface functions is the interface functions in the first interface function set for processing the N component resources;

[0080] The processing results of N component resources are combined according to the hierarchical relationship.

[0081] Example 1

[0082] In the case where the target page includes a component 1 to be loaded including two component resources having a hierarchical relationship, the two component resources are assigned to the input parameters in the first group of interface functions through a set of KVC statements of the first hook function hook, for example, Figure 6 As shown, it is assumed that component 1 includes two component resources, and component resource 1 is used to determine the encoding method of the received binary data, and component resource 2 is used to determine the location, style and other properties of component 1.

[0083] Then through the KVC statement L = kvc_setvalue (Res_Z 1 ) and Res_1 = kvc_setvalue(Res_Z 1 ), assigns component resource 1 to the input parameters Res_1 and L in the first interface function API_dec(Res_1=xx,L); through the KVC statement Res_2=kvc_setvalue(Res_Z 1 ) and Path = kvc_setvalue(Res_Z 1 ), assign component resource 2 to the input parameters Res_2 and Path of the second interface function API_disp(Res_2=xx,Path=xxx), and run the first interface function and the second interface function to obtain the processing results of the two component resources.

[0084] According to the hierarchical relationship between component resource 1 and component resource 2, the processing results of the two component resources are combined. For example, component 1 is displayed on the target page with attributes such as a font size of 4 and a display position in the middle of the page.

[0085] Using the above method, the first set of KVC statements is called through the first hook function, N component resources are assigned to each input parameter in a set of interface functions, and the first set of interface functions is run to obtain the processing results of the N component resources, so that the first component is displayed in the target page according to the processing results of the N component resources.

[0086] According to the same principle, when the target page includes components 1 and 2 to be loaded, component 2 may be displayed in the following manners, but is not limited to:

[0087] When the page loading request also includes an identifier of a second component on a target page to be loaded on the client, obtaining a second component resource set of the second component sent by the server, wherein the first component and the second component are components formed by using different encoding methods;

[0088] The second component resource set is processed by calling the second interface function set through the first hook function to display the second component on the target page on the client, wherein the second interface function set includes the interface functions required to display the second component in the target interface function set.

[0089] Example 2

[0090] According to the method in the above embodiment 1, component 1 is loaded, and component 2 is loaded according to the following steps:

[0091] S11, obtain the second component Z sent by the server 2 The second component resource collection;

[0092] Among them, the second component resource set includes component resource 3 and component resource 4.

[0093] S12, assigning two component resources in the second component resource set to input parameters of each interface function in the second interface function set through a set of KVC statements of the first hook function hook1;

[0094] S13, through the KVC statement L = kvc_setvalue (Res_Z 2 ) and Res_3 = kvc_setvalue(Res_Z 2 ), assigns the component resource 3 to the input parameters Res_3 and L in the third interface function API_dec(Res_3=xx,L); through the KVC statement Res_4=kvc_setvalue(Res_Z 2 ) and Path = kvc_setvalue(Res_Z 2 ), assign component resource 2 to the input parameters Res_4 and Path of the fourth interface function API_disp(Res_4=xx,Path=xxx), and run the third interface function and the fourth interface function to obtain the processing results of the two component resources.

[0095] The second interface function set includes a third interface function and a fourth interface function.

[0096] S14, combining the processing results of component resource 3 and component resource 4 according to the hierarchical relationship between the two component resources, so as to display component 2 on the target page of the client.

[0097] Among them, one component corresponds to one hook function, and the hook functions corresponding to different components may be the same or different. For example, Figure 6The hook functions of component 1 and component 2 are both hook1, or the hook function of component 1 is hook1, the hook function of component 2 is hook2, and so on.

[0098] Exemplarily, the second interface function set and the first interface function set have some of the same interface functions; or, the second interface function set is the same as the first interface function set.

[0099] like Figure 6 As shown, in the first interface function API_dec (Res_1=xx, L) in the first interface function set of component 1 and the third interface function API_dec (Res_3=xx, L) in the second interface function set of component 2, the two functions have the same type, and the values ​​of the input parameters Res_1 and Res_3 of the two functions may be the same or different, and the value of the input parameter L may also be the same or different.

[0100] Similarly, in the second interface function API_disp (Res_2=xx, Path=xxx) in the first interface function set of component 1 and the fourth interface function API_disp (Res_4=xx, Path=xxx) in the second interface function set of component 2, the two functions have the same type, and the values ​​of the input parameters Res_2 and Res_4 of the two functions may be the same or different, and the value of the input parameter Path may also be the same or different.

[0101] Through the loading process of component 1 and component 2 in the above embodiment, it can be seen that in the process of processing component resources of different types (different encoding methods) using the page loading method in the embodiment of the present application, different types of components can share a hook function, and this hook function can directly assign N component resources to an input function in a set of interface functions through KVC statements, thereby avoiding the process of repeatedly constructing interface functions and constantly searching for system operation functions required to load different types of components, thereby improving the efficiency of component loading.

[0102] It should be noted that the page loading method in the embodiment of the present application is that after responding to the page loading request, the server returns a group of resources, the component triggers the hook function through the calling interface in the coding protocol to obtain the identification of a group of resources, and KVC assembles a group of resources and assigns them to input parameters in a group of interface functions, thereby determining each interface function in the target interface function set for loading the first component.

[0103] In addition, on the client, the business call interfaces required by components of the coding protocol including different encoding methods for pages are pre-configured and stored.

[0104] Through the above-mentioned embodiment provided by the present application, when the first component resource set of the first component sent by the server is obtained, the first component resource set is processed by calling the target interface function set pre-set in the client through the first hook function, and the first component is loaded by using the interface function required to display the first component in the target interface function set, so that the first component is displayed on the target page. In other words, for different types of components, the interface functions required to display different components in the target interface function set can be used respectively to process the component resource sets of different types of components, so that each component can be displayed on the target page, which reduces the time spent on rebuilding different interface functions for different types of components, improves the loading efficiency of components, solves the technical problem of low efficiency in the page loading process, and achieves the technical effect of improving page loading efficiency.

[0105] As an optional implementation, the above-mentioned processing of the first component resource set by calling the first interface function set through the first hook function includes:

[0106] When the first component is a component for displaying a picture, and the first component resource set includes coding information of a target picture to be displayed, the coding information of the target picture is decoded by calling a picture decoding interface function through a first hook function to obtain the target picture, wherein the first interface function set includes the picture decoding interface function; or

[0107] When the first component is a component for displaying pictures, and the first component resource set includes encoding information of a group of pictures to be displayed, the encoding information of a group of pictures is decoded in sequence by calling the picture decoding interface function through the first hook function to obtain a group of pictures.

[0108] As in the above-mentioned embodiment 1, assuming that the first component is a component for displaying pictures, the picture decoding interface function API_dec (Res_1=xx, L) and the second interface function API_disp (Res_2=xx, Path=xxx) are called through the first hook function hook1 to decode the encoded information in the target picture to obtain the target picture.

[0109] According to the above method, when the first component is a component for displaying pictures, and the first component resource set includes encoding information of a group of pictures to be displayed, for example, the first component is a component for displaying a carousel picture, the encoding information of a group of pictures in the carousel picture is decoded in turn by calling the picture decoding interface function through the first hook function hoo1 to obtain a group of pictures in the carousel picture.

[0110] It should be noted that the component resources in the above embodiments include but are not limited to the configuration information of the component, for example, the number of images contained in the carousel, description labels and carousel intervals, internal coordinates, etc.; or corresponding clusters (a set of controls split according to the fine-grainedness of the page, and one component corresponds to one cluster), usually including labels, buttons, pictures, input boxes, progress bars, etc.

[0111] Obviously, the above-mentioned first component is a component for displaying pictures, which is only an example and is not limited thereto. For example, it can also be a component for displaying text, a component for page jumping, a component for displaying a search box, etc.

[0112] Combined with the analysis of the above embodiments, it can be seen that for components with different encoding methods, the system operation function is replaced by a hook function to form a coding protocol, which is provided to the business operation interface (interface function), and then the KVC statement is used to assign values ​​to the input variables of the interface function.

[0113] For example, for sliding screens, live broadcast type short videos, trailer short videos or advertising videos, the corresponding underlying decoders are different, thus forming the decoder calling interface in their respective coding protocols and pre-saving them on the client.

[0114] For the carousel component on the page, the component ID is sent to the server, and the server returns a set of resources. The component triggers the hook function through the calling interface in the coding protocol to obtain the identifier of a set of resources. KVC assembles and assigns values ​​to the resources. The coding protocol includes the business calling interfaces required for components with different codes on the page, which are all saved on the client.

[0115] As an optional implementation manner, the obtaining of the first component resource set of the first component sent by the server includes:

[0116] Receive a target protocol message sent by the server to the client, wherein an extensible field in a protocol header of the target protocol message carries a first component resource set;

[0117] A first component resource set is obtained from an extensible field in a protocol header of a target protocol message.

[0118] like Figure 7 As shown, assuming that there are four component loading requests corresponding to component sessions 1 to 4 respectively, when the server receives the component ID in each component session, after determining the two parties of the transmission and the message header according to the STEP protocol, the message body needs to be indexed and configured.

[0119] Among them, the message header domain name field Message Encoding (ME) is an optional type, indicating the encoding type in the message. The first byte in ME is used to index the message body data. Each segment of message data is divided into 8 parts according to the binary length to correspond to each bit of the first byte of ME. The tail of the divided message body data is pointed to the header of the next segment of the message by a pointer. Therefore, one segment of the message body can be reused during the component data assembly process.

[0120] That is to say, by utilizing the extensible fields in the protocol header of the STEP protocol message to transmit component resource sets of different types of components, it is avoided to use different types of transmission protocols to transmit different types of component data, thereby ensuring the security of the diversified data transmission of the components and improving the transmission efficiency of the diversified data transmission of the components.

[0121] In this embodiment, the component data is transmitted in the form of a protocol header through the STEP protocol; each sub-component data transmission starts with a standard message header. The message header specifies the type, length, destination, sequence number, start point and time of the message, and no encrypted transmission is performed at the session layer. Due to the diversity of client (initiator) components, the data size, receiving start and end time, sequence number, etc. required by different components will be different. Therefore, each type of component will be loaded on demand and establish a message sending and receiving session with the server (receiver).

[0122] In addition, when the client generates loading behavior, the page will initiate a Logon message, which includes the component ID, data serialization method, device ID, encryption suite and authorization function. There is an authorization function with the same implementation on the server side, and any encryption algorithm can be selected from the encryption suite. Each component under the page will establish a session. The message header in the session has the domain name fields SenderCompID and TargetCompID, which represent the sender and receiver codes. This string of codes is generally an encoded string. After the server determines the component ID in the diverse components, SenderCompID determines the server extension number and sends it down. The target terminal is resolved by TargetCompID to the corresponding device ID for reception. The MsgSeqNum field is the sequence number of the message. In the case of packet loss or timeout, the client returns the MsgSeqNum value to determine the next data packet of the component data.

[0123] After receiving the message, the client opens a receiving context of the corresponding size according to the component ID of the data sent, processes the segmented data during the transmission process, and assembles the binary data according to the pointer of the message segment based on the binary data calculated by the authorization function. Finally, the binary data is deserialized in the context according to the data serialization method in the protocol. The purpose of deserialization is to convert binary data into objects that can be processed during the client operation.

[0124] As an optional example, the above-mentioned obtaining the first component resource set of the first component sent by the server includes:

[0125] Obtain serialized data sent by the server, wherein the serialized data is data obtained by performing a serialization operation on the first component resource set;

[0126] Deserialize the serialized data to obtain a first component resource set.

[0127] After the server sends the first component resource set of the first component to the client, in order to improve the efficiency of configuring various serialized data at the client's business layer, the client and the server usually use similar KVC operations to serialize the data, as shown in the following example: Figure 8 As shown, including:

[0128] S802, receiving binary data sent by the server;

[0129] The way in which the server sends the first component resource set to the client is to first use the KVC encoding method to serialize the resources in the first component resource set to obtain serialized binary data, and then send the binary data to the client.

[0130] S804, deserialize according to cluster information;

[0131] Get the information of a single cluster and parse the information of a single cluster to get the cluster attribute field information in each component.

[0132] The cluster may be understood, but is not limited to, as a collection of fine-grained split pages, and one component corresponds to one cluster.

[0133] S806, rewrite the attribute set and get methods to implement the setting and retrieval of attribute values;

[0134] It should be noted that KVC provides a mechanism for indirect access to object properties, and its main function is to set property values ​​(assign values ​​through dot syntax, across levels) and get property values.

[0135] S808, using the runtime mechanism to obtain Ivars in the object;

[0136] Among them, RunTime is short for runtime, that is, runtime mechanism, which refers to some mechanisms at runtime. The most important one is the message mechanism. For C language, the function call will decide which function to call during compilation.

[0137] The runtime is a relatively low-level pure C language API, which belongs to a C language library and contains many low-level C language APIs.

[0138] Ivars is an array (also called member variables), each element in the array is a pointer to Ivar (variable information).

[0139] S810, traverse the attributes according to the pointer represented by each element in Ivar to obtain the attribute name and type;

[0140] Initialize the cluster object and use the runtime mechanism to obtain the Ivars in the object, the pointer to the member variable. Since most cluster objects are custom objects, it is necessary to traverse the attributes according to the pointer to obtain the attribute name and type.

[0141] S812, executing the KVC set method call according to the deserialized data to realize the generation of a single cluster.

[0142] For example, in the above embodiment, the first component resource is assigned to the input parameter in the first interface function through the first key-value coding KVC statement in the first hook function, and the first interface function is run to obtain the processing result of the first component resource to display the first group member in the target page, where one cluster corresponds to one component.

[0143] After the generation of a single cluster is completed, the assembly components are constructed according to the relationship of the client configuration layer. For example, according to the hierarchical relationship between component resources, the processing results of N component resources are combined to complete the rendering and display each component on the target page.

[0144] In the above way, the client and the server use similar KVC operations to serialize the data, which can reduce the adaptation of various serialization methods at the business layer, and the traversal assignment of custom cluster objects improves the rendering efficiency of component diversity.

[0145] Through the analysis of the above embodiments, it can be known that in the page loading method in the embodiments of the present application, the server generates a general configuration layer through KVC, and uses the configuration layer to map the entries of the database, archive, key-value pairs and other data persistence methods for storing page controls, with the smallest unit of each storage as a cluster; the encrypted number of the component is placed in the form of a protocol header for transmission through the STEP protocol, and a routing layer is generated at the receiving end of the client, and the cluster is accessed using KVC, thereby realizing the diversification of page controls during the reading and writing process of component data and improving the loading efficiency of the page.

[0146] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0147] According to another aspect of the embodiment of the present application, there is also provided Fig. 9 A page loading device is shown, the device comprising:

[0148] A first sending unit 902 is used to send a page loading request to the server, wherein the page loading request includes an identifier of a first component on a target page to be loaded on the client;

[0149] A first obtaining unit 904 is used to obtain a first component resource set of a first component sent by a server;

[0150] The first processing unit 906 is used to process the first component resource set by calling the first interface function set through the first hook function to display the first component on the target page on the client, wherein the first interface function set includes the interface functions required to display the first component in the target interface function set pre-set in the client, the target interface function set includes the interface functions required to display each component in the target component set, at least some of the components in the target component set are components formed by different encoding methods, and the first hook function is a function pre-set in the client.

[0151] Optionally, the above device further includes:

[0152] A replacement unit is used to replace the function triggered to be executed when the first component is displayed in the client from the first system operation function to the first hook function when the client is started or after the client is started, wherein the first system operation function is an operation function in the operating system where the client is located, the first system operation function is set to prohibit calling the interface function in the target interface function set, and the first hook function is set to allow calling the interface function in the target interface function set.

[0153] Optionally, the first processing unit 906 includes:

[0154] The first processing module is used to assign the first component resource to the input parameter in the first interface function through the first key-value coding KVC statement in the first hook function, and run the first interface function to obtain the processing result of the first component resource, wherein the first component resource is a component resource in the first component resource set, and the first interface function is an interface function in the first interface function set for processing the first component resource.

[0155] Optionally, the first processing unit 906 includes:

[0156] A second processing module is used for assigning the N component resources to input parameters in a set of interface functions through a set of KVC statements in the first hook function when the first component resource set includes N component resources having a hierarchical relationship, and running the set of interface functions to obtain processing results of the N component resources, wherein N is a positive integer greater than or equal to 2, and the set of interface functions is the interface functions in the first interface function set for processing the N component resources;

[0157] The third processing module is used to combine the processing results of the N component resources according to the hierarchical relationship.

[0158] Optionally, the first processing unit 906 includes:

[0159] a fourth processing module, configured to decode the encoding information of the target picture by calling the picture decoding interface function through the first hook function to obtain the target picture when the first component is a component for displaying a picture and the first component resource set includes encoding information of a target picture to be displayed, wherein the first interface function set includes the picture decoding interface function; or

[0160] When the first component is a component for displaying pictures, and the first component resource set includes encoding information of a group of pictures to be displayed, the encoding information of a group of pictures is decoded in sequence by calling the picture decoding interface function through the first hook function to obtain a group of pictures.

[0161] Optionally, the above device further includes:

[0162] The second processing unit is used to set each interface function in the target interface function set to a state that allows being called when or after the client is started.

[0163] Optionally, the above device further includes:

[0164] A second acquisition unit is used to acquire a second component resource set of the second component sent by the server when the page loading request also includes an identifier of the second component on the target page to be loaded on the client, wherein the first component and the second component are components formed by different encoding methods;

[0165] The third processing unit is used to process the second component resource set by calling the second interface function set through the first hook function to display the second component on the target page on the client, wherein the second interface function set includes the interface functions required to display the second component in the target interface function set.

[0166] Optionally, the second interface function set and the first interface function set have some of the same interface functions; or, the second interface function set is the same as the first interface function set.

[0167] Optionally, the first obtaining unit 904 includes:

[0168] A receiving module, configured to receive a target protocol message sent by a server to a client, wherein an extensible field in a protocol header of the target protocol message carries a first component resource set;

[0169] The first acquisition module is used to acquire a first component resource set from an extensible field in a protocol header of a target protocol message.

[0170] Optionally, the above device further includes:

[0171] A third acquisition unit is used to acquire the first hook function and the target interface function set from the installation file of the client when installing the client; or

[0172] After the client is started, the first hook function and the target interface function set are obtained from the server.

[0173] Optionally, the first obtaining unit 904 includes:

[0174] A second acquisition module is used to acquire serialized data sent by the server, wherein the serialized data is data obtained by performing a serialization operation on the first component resource set;

[0175] The fifth processing module is used to perform a deserialization operation on the serialized data to obtain a first component resource set.

[0176] By applying the above-mentioned device to the case where the first component resource set of the first component sent by the server is obtained, the first component resource set is processed by calling the target interface function set pre-set in the client through the first hook function, and the first component is loaded by using the interface function required to display the first component in the target interface function set, so that the first component is displayed on the target page. In other words, for different types of components, the interface functions required to display different components in the target interface function set can be used respectively to process the component resource sets of different types of components, so that each component can be displayed on the target page, reducing the time spent on rebuilding different interface functions for different types of components, improving the loading efficiency of components, solving the technical problem of low efficiency in the page loading process, and achieving the technical effect of improving page loading efficiency.

[0177] It should be noted that the embodiment of the page loading device here can refer to the embodiment of the above-mentioned page loading method, which will not be repeated here.

[0178] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned page loading method is also provided. The electronic device may be Fig.10 The terminal device shown in FIG. This embodiment is described by taking the electronic device as a background device as an example. Fig.10 As shown, the electronic device includes a memory 1002 and a processor 1004. The memory 1002 stores a computer program, and the processor 1004 is configured to execute the steps in any of the above method embodiments through the computer program.

[0179] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0180] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0181] S1, sending a page loading request to a server, wherein the page loading request includes an identifier of a first component on a target page to be loaded on a client;

[0182] S2, obtaining a first component resource set of a first component sent by the server;

[0183] S3, calling the first interface function set through the first hook function to process the first component resource set, so as to display the first component on the target page on the client, wherein the first interface function set includes the interface functions required to display the first component in the target interface function set pre-set in the client, the target interface function set includes the interface functions required to display each component in the target component set, at least some of the components in the target component set are components formed by different encoding methods, and the first hook function is a function pre-set in the client.

[0184] Alternatively, a person skilled in the art may understand that: Fig.10 The structure shown is for illustration only, and the electronic device may also be a target terminal such as a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, and a mobile Internet device (MID), a PAD, etc. Fig.10 The electronic device and the electronic equipment described above are not limited in structure. Fig.10 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.10 Different configurations shown.

[0185] Among them, the memory 1002 can be used to store software programs and modules, such as the program instructions / modules corresponding to the page loading method and device in the embodiment of the present application. The processor 1004 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002, that is, realizing the above-mentioned page loading method. The memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1002 may further include a memory remotely arranged relative to the processor 1004, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 1002 can be specifically but not limited to being used to store page loading requests, identification of the first component, and a first component resource set, etc. As an example, such as Fig.10 As shown, the memory 1002 may include but is not limited to the first sending unit 902, the second acquiring unit 904 and the first processing unit 906 in the page loading device. In addition, it may also include but is not limited to other module units in the page loading device, which will not be repeated in this example.

[0186] Optionally, the transmission device 1006 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 1006 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1006 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0187] In addition, the electronic device further includes: a display 1008 for displaying the direction prompt information of the target sound; and a connection bus 1010 for connecting various module components in the electronic device.

[0188] In other embodiments, the target terminal or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes in the form of network communication. Among them, the nodes may form a peer-to-peer (P2P) network, and any form of computing device, such as a server, terminal or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.

[0189] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the page loading method provided in various optional implementations of the above-mentioned server verification processing and other aspects, wherein the computer program is configured to perform the steps of any of the above-mentioned method embodiments when running.

[0190] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0191] S1, sending a page loading request to a server, wherein the page loading request includes an identifier of a first component on a target page to be loaded on a client;

[0192] S2, obtaining a first component resource set of a first component sent by the server;

[0193] S3, calling the first interface function set through the first hook function to process the first component resource set, so as to display the first component on the target page on the client, wherein the first interface function set includes the interface functions required to display the first component in the target interface function set pre-set in the client, the target interface function set includes the interface functions required to display each component in the target component set, at least some of the components in the target component set are components formed by different encoding methods, and the first hook function is a function pre-set in the client.

[0194] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing the hardware related to the target terminal through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0195] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0196] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.

[0197] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0198] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0199] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

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

[0201] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A page loading method, characterized in that: include: Sending a page loading request to a server, wherein the page loading request includes an identifier of a first component on a target page to be loaded on a client; Obtaining a first component resource set of the first component sent by the server; The first component resource set is processed by calling the first interface function set through the first hook function to display the first component on the target page on the client, wherein the first interface function set includes the interface functions required to display the first component in the target interface function set pre-set in the client, the target interface function set includes the interface functions required to display each component in the target component set, at least some of the components in the target component set are components formed by different encoding methods, and the first hook function is a function pre-set in the client.

2. The method according to claim 1, characterized in that The method further comprises: When the client is started or after the client is started, the function triggered for execution when the first component is displayed in the client is replaced from the first system operation function to the first hook function, wherein the first system operation function is an operation function in the operating system where the client is located, the first system operation function is set to prohibit calling interface functions in the target interface function set, and the first hook function is set to allow calling interface functions in the target interface function set.

3. The method according to claim 1, characterized in that The processing of the first component resource set by calling the first interface function set through the first hook function includes: The first component resource is assigned to the input parameter in the first interface function through the first key-value coding KVC statement in the first hook function, and the first interface function is run to obtain the processing result of the first component resource, wherein the first component resource is a component resource in the first component resource set, and the first interface function is an interface function in the first interface function set for processing the first component resource.

4. The method according to claim 1, characterized in that: The processing of the first component resource set by calling the first interface function set through the first hook function includes: In the case where the first component resource set includes N component resources having a hierarchical relationship, the N component resources are assigned to input parameters in a set of interface functions through a set of KVC statements in the first hook function, and the set of interface functions are run to obtain processing results of the N component resources, wherein N is a positive integer greater than or equal to 2, and the set of interface functions are interface functions in the first interface function set for processing the N component resources; The processing results of the N component resources are combined according to the hierarchical relationship.

5. The method according to claim 1, characterized in that: The processing of the first component resource set by calling the first interface function set through the first hook function includes: In a case where the first component is a component for displaying a picture, and the first component resource set includes encoding information of a target picture to be displayed, decoding the encoding information of the target picture by calling a picture decoding interface function through the first hook function to obtain the target picture, wherein the first interface function set includes the picture decoding interface function; or When the first component is a component for displaying pictures, and the first component resource set includes encoding information of a group of pictures to be displayed, the encoding information of the group of pictures is decoded in sequence by calling the picture decoding interface function through the first hook function to obtain the group of pictures.

6. The method according to claim 1, characterized in that The method further comprises: When the client is started or after the client is started, each interface function in the target interface function set is set to be in a state that allows being called.

7. The method according to claim 1, characterized in that The method further comprises: When the page loading request further includes an identifier of a second component on the target page to be loaded on the client, obtaining a second component resource set of the second component sent by the server, wherein the first component and the second component are components formed by using different encoding methods; The second component resource set is processed by calling the second interface function set through the first hook function to display the second component on the target page on the client, wherein the second interface function set includes the interface functions required to display the second component in the target interface function set.

8. The method according to claim 7, characterized in that The second interface function set and the first interface function set have some of the same interface functions; or, the second interface function set and the first interface function set are the same.

9. The method according to any one of claims 1 to 8, characterized in that The acquiring the first component resource set of the first component sent by the server includes: Receiving a target protocol message sent by the server to the client, wherein an extensible field in a protocol header of the target protocol message carries the first component resource set; The first component resource set is obtained from the extensible field in the protocol header of the target protocol message.

10. The method according to any one of claims 1 to 8, characterized in that The method further comprises: acquiring the first hook function and the target interface function set from the installation file of the client when installing the client; or After the client is started, the first hook function and the target interface function set are obtained from the server.

11. The method according to any one of claims 1 to 8, characterized in that The acquiring the first component resource set of the first component sent by the server includes: Acquire serialized data sent by the server, wherein the serialized data is data obtained by performing a serialization operation on the first component resource set; Deserialize the serialized data to obtain the first component resource set.

12. A page loading device, characterized in that: include: A first sending unit, configured to send a page loading request to a server, wherein the page loading request includes an identifier of a first component on a target page to be loaded on a client; A first acquiring unit, configured to acquire a first component resource set of the first component sent by the server; A first processing unit is used to process the first component resource set by calling a first interface function set through a first hook function, so as to display the first component on the target page on the client, wherein the first interface function set includes interface functions required to display the first component in a target interface function set pre-set in the client, the target interface function set includes interface functions required to display each component in a target component set, at least some of the components in the target component set are components formed by different encoding methods, and the first hook function is a function pre-set in the client.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program can be executed by a terminal device or a computer to execute the method described in any one of claims 1 to 11.

14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method described in any one of claims 1 to 11 are implemented.

15. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 11 through the computer program.

Citation Information

Patent Citations

  • Data collection method and device, medium and computing equipment

    CN107423048A

  • Data processing system, method and device

    CN107885653A

  • Front-end modular development method and device, computer equipment and storage medium

    CN111427552A

  • Mobile terminal page processing method and device, equipment and medium

    CN113609417A

  • Resource loading and page rendering method and program product

    CN114491330A