Page loading method and device, storage medium and electronic device

CN118626159BActive Publication Date: 2026-08-21TENCENT CLOUD COMPUTING (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

[0005]本申请实施例提供了一种页面加载方法和装置、存储介质及电子设备,以至少解决在页面加载过程中出现的效率较低的技术问题

Benefits of technology

[0021] Through the embodiments provided in this application, upon obtaining the first component resource set of the first component sent by the server, the first component resource set is processed by calling a target interface function set pre-set in the client through a first hook function, and the first component is loaded using the interface functions required to display the first component in the target interface function set, thereby displaying the first component on the target page. In other words, for different types of components, the component resource sets of different types of components can be processed by using the interface functions required to display different components in the target interface function set, thereby displaying each component on the target page. This reduces the time spent reconstructing different interface functions for different types of components, improves component loading efficiency, solves the technical problem of low efficiency during page loading, and achieves the technical effect of improving page loading efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626159B_ABST
    Figure CN118626159B_ABST
Patent Text Reader

Abstract

The application discloses a page loading method and device, a storage medium and an electronic device. The method comprises the following steps: sending a page loading request to a server, wherein the page loading request comprises the identification 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; calling a first interface function set through a 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 comprises an interface function required for displaying the first component in a target interface function set pre-set in the client, the target interface function set comprises an interface function required for displaying each component in a target component set, and the first hook function is a function pre-set in the client. The application solves the technical problem of low efficiency in page loading in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a page loading method and apparatus, a storage medium, and an electronic device. Background Technology

[0002] In related technologies, methods for implementing page loading include: the client sending a page loading request to the server; the server parsing the page loading request to obtain the component ID and encoding method of the currently requested component, and temporarily constructing an interface function in the encoding protocol; then, the component resource is serialized according to the type of the parsed encoding method to obtain serialized data; the serialized data is returned to the client through the interface function in the temporarily constructed encoding protocol, and the component is loaded using system operation functions.

[0003] However, during page loading, a single page may contain multiple components of different types. Following the loading method described above, different coding protocol interface functions need to be temporarily constructed for different component types. This requires the client to receive serialized data returned by the server multiple times to complete the loading of each page component. In this process, transmitting different serialized data from the server to the client and temporarily constructing interface functions in the coding protocol consumes a significant amount of time, increasing the loading time of each component and the overall page loading time, resulting in inefficiency during page loading.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This application provides a page loading method and apparatus, storage medium and electronic device to at least solve the technical problem of low efficiency during page loading.

[0006] According to one aspect of the embodiments of this application, a page loading method is provided, comprising: 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; and 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 from 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 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 further includes: replacing the function triggered when the first component is displayed in the client with a first hook function when the client starts up or after the client starts up, 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 encoding (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 the component resource in the first component resource set, and the first interface function is the interface function in the first interface function set used to process the first component resource.

[0009] Optionally, the above-mentioned processing of the first component resource set by calling the first set of interface functions through the first hook function includes: when the first component resource set includes N component resources with hierarchical relationship, assigning the N component resources to the input parameters in a set of interface functions through a set of KVC statements in the first hook function, and running the set of interface functions to obtain the processing results of the N component resources, where N is a positive integer greater than or equal to 2, and the set of interface functions is the interface functions in the first set of interface functions used to process the N component resources; and combining the processing results of the N component resources 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 images and the first component resource set includes the encoding information of the target image to be displayed, decoding the encoding information of the target image by calling the image decoding interface function through the first hook function to obtain the target image, wherein the first interface function set includes the image decoding interface function; or when the first component is a component for displaying images and the first component resource set includes the encoding information of a group of images to be displayed, decoding the encoding information of a group of images sequentially by calling the image decoding interface function through the first hook function to obtain a group of images.

[0011] Optionally, the above method further includes setting each interface function in the target interface function set to a state that is allowed to be called when the client starts or after the client starts.

[0012] Optionally, the above method further includes: if the page loading request also includes the identifier of the second component on the target page to be loaded on the client, obtaining the second component resource set of the second component sent by the server, wherein the first component and the second component are components formed using different encoding methods; processing 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.

[0013] Optionally, the second set of interface functions may have some of the same interface functions as the first set of interface functions; or, the second set of interface functions may be the same as the first set of interface functions.

[0014] Optionally, obtaining 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 first component resource set is carried in the extensible field of the protocol header of the target protocol message; and obtaining the first component resource set from the extensible field of the protocol header of the target protocol message.

[0015] Optionally, the above method further includes: obtaining the first hook function and the target interface function set from the client's installation file during client installation; or obtaining the first hook function and the target interface function set from the server after the client starts.

[0016] Optionally, the above-mentioned acquisition of the first component resource set of the first component sent by the server includes: acquiring serialized data sent by the server, wherein the serialized data is data obtained by performing a serialization operation on the first component resource set; and performing a deserialization operation on the serialized data to obtain the first component resource set.

[0017] According to another aspect of the embodiments of this application, a page loading apparatus is also provided, comprising: 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 obtaining unit, configured to obtain a first component resource set of the first component sent by the server; and a first processing unit, configured 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 from 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 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.

[0018] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described page loading method at runtime.

[0019] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.

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

[0021] Through the embodiments provided in this application, upon obtaining the first component resource set of the first component sent by the server, the first component resource set is processed by calling a target interface function set pre-set in the client through a first hook function, and the first component is loaded using the interface functions required to display the first component in the target interface function set, thereby displaying the first component on the target page. In other words, for different types of components, the component resource sets of different types of components can be processed by using the interface functions required to display different components in the target interface function set, thereby displaying each component on the target page. This reduces the time spent reconstructing different interface functions for different types of components, improves component loading efficiency, solves the technical problem of low efficiency during page loading, and achieves the technical effect of improving page loading efficiency. Attached Figure Description

[0022] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

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

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

[0025] Figure 3 This is a schematic diagram illustrating different display formats of an optional carousel in an application according to an embodiment of this application;

[0026] Figure 4 This is a timing flowchart of an optional page loading method according to an embodiment of this application;

[0027] Figure 5 This is a flowchart of an optional KVC-based process for processing component data according to an embodiment of this application;

[0028] Figure 6 This is a specific embodiment of an optional hook function call interface function set to encode component resources according to the embodiments of this application;

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

[0030] Figure 8 This is a schematic diagram illustrating an optional serialization operation of component data according to an embodiment of this application;

[0031] Figure 9 This is a schematic diagram of an optional page loading device according to an embodiment of this application;

[0032] Figure 10 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application. Detailed Implementation

[0033] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort 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, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

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

[0036] Definitions:

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

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

[0039] According to one aspect of the embodiments of this application, a page loading method is provided. As an optional implementation, the above-described page loading method may be applied to, but is not limited to, [examples of other methods]. Figure 1 The application scenarios shown are as follows. In, for example... Figure 1 In the application scenario shown, terminal device 102 can communicate with server 106 via network 104, but is not limited to this. Server 106 can perform operations on database 108, such as write or read data operations. Terminal device 102 may include, but is not limited to, a human-computer interaction screen, a processor, and a memory. The human-computer interaction screen may be used to display a loading page on terminal device 102, a first component displayed on a target page, etc. The processor may be used to respond to the human-computer interaction operations, execute corresponding operations, or generate corresponding instructions and send the generated instructions to server 106. The memory is used to store relevant processing data, such as page loading requests, first component resource sets, and first component identifiers.

[0040] As an optional approach, the following steps in the page loading method can be executed on server 106: Step S102, sending a page loading request to the server, wherein the page loading request includes the identifier of the first component on the target page to be loaded on the client; Step S104, obtaining the first component resource set of the first component sent by the server; Step S106, processing 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 from 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 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.

[0041] Using the above method, upon obtaining the resource set of the first component sent by the server, the resource set of the first component is processed by calling the target interface function set pre-set in the client through the first hook function. The interface functions required to display the first component are then used from the target interface function set to load the first component, thereby displaying the first component on the target page. In other words, for different types of components, the component resource sets of different types of components can be processed separately using the interface functions required to display different components from the target interface function set, thereby displaying each component on the target page. This reduces the time spent rebuilding different interface functions for different types of components, improves component loading efficiency, solves the technical problem of low efficiency during page loading, and achieves the technical effect of improving page loading efficiency.

[0042] To address the inefficiency issue in page loading mentioned above, this application proposes a page loading method. Figure 2 This is a flowchart of a page loading method according to an embodiment of this application, which includes the following steps:

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

[0044] Step S204: Obtain the first component resource set of the first component sent by the server;

[0045] Step S206: 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. The first interface function set includes the interface functions required to display the first component from 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 components in the target component set are components formed using different encoding methods. The first hook function is a function pre-set in the client.

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

[0047] exist Figure 3 In this example, assuming there are a total of 4 images participating in the carousel, the display formats of the carousel include, but are not limited to, the following: Figure 3 The three scenarios shown are: (1) The currently displayed image is image 1-1. By swiping the page to the right, image 1-1 can be switched to another image, as shown in the figure below. Figure 3 As shown in (a); (2) Assuming the currently displayed image is image 2-2, within a preset time interval, image 2-2 will be automatically rotated to other images, such as... Figure 3 As shown in (b); (3) Play the images in rotation according to their transparency, for example, by overlapping four images together, setting the transparency of the images, and playing the images 3-1 and the others in sequence according to their transparency, 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 this application embodiment is optimized for the data transmission, reading, writing and assembly of diverse components, which will be described in detail in the following embodiments.

[0049] The following is combined with Figure 4 The overall solution for the above page loading method is introduced.

[0050] When a page load request is sent from the client to the server, the server returns the first component resource set to the client based on the identifier Z1_ID of the first component in the received page load request. The first component resource set includes data such as the position, character length, font, and font size of the first component, as shown in steps S402-S404.

[0051] Since the server sends the first component resource set to the client as binary data after encoding each component's data, the client needs to process the binary data (e.g., decode it) before loading the component and displaying it on the target page. For example, the client can use a hook function to call the interface functions in the first interface function set required to display the first component, as detailed in steps S406 to S408.

[0052] In this embodiment, assuming the first hook function is a hook function, the target function set pre-set on the client includes interface functions required to display different types of components. That is, the target function set includes interface functions required to display the first component. By using the interface functions required to display the first component, the resource set of the first component is processed. For example, the resources in the resource set of the first component are decoded, the data of the decoded data is stored, and the display method of the component is determined, so as to display the first component on the target page.

[0053] By hooking functions to call the interface functions required to display the first component from the target set of interface functions, the resource set of the first component is processed, for example, such as... Figure 4 As shown, the interface functions required to display the first component include API_dec(Res_1=xx,L) for decoding the resource set of the first component, and API_disp(Res_2=xx,Path=xxx) for determining the display method of the first component.

[0054] It should be noted that a hook function is a special message handling 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 described above in this application embodiment includes:

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

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

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

[0059] After the client starts, it retrieves the first hook function and the set of target interface functions from the server.

[0060] The following is combined with Figure 5 This paper describes in detail the process of unifying different types of component data based on KVC.

[0061] It's easy to understand that during development, front-end developers code pages or components based on standard UI diagrams provided by product or UI personnel, while the back-end needs to assemble them based on the component data required by the front-end. Therefore, during development, it's necessary to unify the data of various component types based on Key-Value Coding (KVC). The specific process is as follows:

[0062] (1) In step S502, the "source class" of the object that operates KVC is encapsulated is accessed. Different types of persistence operation methods dynamically generate derived data classes based on the source class, including database, archive, key-value pairs, file and other methods.

[0063] The source class can be understood as, but is not limited to, a page instance or a memory region. Based on the page instance, the page can be rendered. By encapsulating the source class using KVC, derived data classes are 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, then a custom hook function is created, and finally, by executing step S506, the function addresses of the two are replaced to realize the exchange of existing data storage methods.

[0065] Each derived class implements a unique data manipulation function, and the manipulation functions in the original image are expanded using an enumeration. For example, database access has four basic operations: add, delete, update, and query. In the derived database class, these four functions are first enumerated, and then overridden. The overriding process involves pre-setting each field according to the key-value coding method in KVC. Each time the component accesses data, the access object, key value, return value, and corresponding storage coding rules need to be determined. Finally, the enumerated functions are replaced using the hook functionality of the source class.

[0066] (2) The configuration layer of the server receives configuration instructions from product and operation personnel, maps the corresponding component types, and operates the corresponding component data through derived data classes, as in step S510.

[0067] The configuration layer is provided to operators as a web page, allowing them to freely combine basic component elements to form independent functional components, such as carousels, players, posters, and feeds. Each configured component generates a unique ID on the server for mapping. This ID allows access to the component's configuration information, such as the number of images in the carousel, description tags, carousel interval, and internal coordinates.

[0068] (3) Based on the diverse component types, determine the corresponding clusters and break down the control granularity, including labels, buttons, images, input boxes, progress bars, etc. When saving as component elements in the derived data class, the fine-grained coding method of each control cluster will be implemented. Each coding will have a key-value path for saving the cluster, and keyPath will be used to access the cluster's attribute dimension. For example, when coding labels in different carousels, the labels will be accessed through keyPath according to their font, font size, character length, position, and other attributes, as in step S512.

[0069] It should be noted that, either when the client starts or after the client starts, each interface function in the target interface function set is set to be allowed to be called.

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

[0071] The first component resource is assigned to the input parameter in the first interface function by the first key-value encoding (KVC) statement in the first hook function, and the first interface function is run to obtain the processing result of the first component resource. Here, the first component resource is the component resource in the first component resource set, and the first interface function is the interface function in the first interface function set used to process the first component resource.

[0072] like Figure 6 As shown, assuming the target page includes component 1 (first component) Z1 and component 2 (denoted as Z2) to be loaded, if the server receives a page load request from the client that includes the identifier of component 1, the server will return the resource set of the first component to the client.

[0073] If the client receives the first component resource set, and detects that the first system operation function calls an interface function in the target interface function set, then... Figure 5 In step S508, the function triggered when the first component is displayed is replaced from the first system operation function with the first hook function. Figure 6 (The hook1 function shown).

[0074] Assume that the hook1 function includes a set of callable first interface functions and key-value KVC statements. The first set of interface functions includes the first interface function API_dec(Res_1 = xx, L) and the second interface function API_disp(Res_2 = xx, Path = xxx). The first key-value KVC statement L = kvc_setvalue(Res_Z1) assigns the first component resource to the input parameter L in the first interface function, and then runs the first interface function to obtain the processing result of the first component resource.

[0075] For example, if the input parameter L in the first interface function represents the encoding method, the value of the input parameter L in the first interface function can be directly determined by the pre-set first key-value encoding KVC statement L = kvc_setvalue(Res_Z1), such as 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 in XML encoding, the following steps are executed: Figure 6 The XML decoding section shown; when the input parameter L is JSON encoded, execute... Figure 6 The JSON decoding section shown.

[0077] It should be noted that, typically, one component corresponds to one hook function, and the number of target interface functions that a hook function can call is not fixed. For example, when displaying component 1, the number of interface functions that can be called is 2, when displaying component 2, the number of interface functions that can be called is 3, and so on. The specific number depends on the steps that need to be executed when displaying each component.

[0078] As another alternative example, the above-described processing of the first component resource set through the first hook function calling the first set of interface functions includes:

[0079] When the first set of component resources includes N component resources with hierarchical relationship, the N component resources are assigned to the input parameters of a set of interface functions through a set of KVC statements in the first hook function, and the set of interface functions is run to obtain the processing results of the N component resources, where N is a positive integer greater than or equal to 2, and the set of interface functions is the interface functions in the first set of interface functions used to process the N component resources.

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

[0081] Example 1

[0082] If the target page includes component 1, which comprises two component resources with a hierarchical relationship, then a set of KVC statements hooked by the first hook function assigns the two component resources to the input parameters in the first set of interface functions. For example, ... Figure 6 As shown, assume 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 position, style and other attributes of component 1.

[0083] Then, using the KVC statements L = kvc_setvalue(Res_Z1) and Res_1 = kvc_setvalue(Res_Z1), component resource 1 is assigned to the input parameters Res_1 and L in the first interface function API_dec(Res_1 = xx, L); using the KVC statements Res_2 = kvc_setvalue(Res_Z1) and Path = kvc_setvalue(Res_Z1), component resource 2 is assigned to the input parameters Res_2 and Path in the second interface function API_disp(Res_2 = xx, Path = xxx), and the first and second interface functions are run to obtain the processing results of the two component resources.

[0084] Based on 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 according to attributes such as font size 4 and display position in the middle of the page.

[0085] Using the above method, the first hook function calls the first group of KVC statements, assigns N component resources to the input parameters of a group of interface functions, runs the first group of interface functions, obtains the processing results of the N component resources, and then displays the first component on the target page based on the processing results of the N component resources.

[0086] Following the same principle, if the target page includes both component 1 and component 2 to be loaded, component 2 can be displayed in, but is not limited to, the following ways:

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

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

[0089] Example 2

[0090] Component 1 is loaded in the manner described in Embodiment 1 above, and component 2 is loaded in accordance with the following steps:

[0091] S11, Obtain the second component resource set of the second component Z2 sent by the server;

[0092] The second component resource set includes component resource 3 and component resource 4.

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

[0094] S13, using the KVC statements L = kvc_setvalue(Res_Z2) and Res_3 = kvc_setvalue(Res_Z2), component resource 3 is assigned to the input parameters Res_3 and L in the third interface function API_dec(Res_3 = xx, L); using the KVC statements Res_4 = kvc_setvalue(Res_Z2) and Path = kvc_setvalue(Res_Z2), component resource 2 is assigned to the input parameters Res_4 and Path in the fourth interface function API_disp(Res_4 = xx, Path = xxx), and the third and fourth interface functions are run to obtain the processing results of the two component resources.

[0095] The second set of interface functions includes the third and fourth interface functions.

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

[0097] In this system, each component corresponds to a hook function, and different components may have the same or different hook functions. For example, Figure 6 The hook function for both component 1 and component 2 shown is hook1, or the hook function for component 1 is hook1 and the hook function for component 2 is hook2, etc.

[0098] For example, the second set of interface functions has some of the same interface functions as the first set of interface functions; or, the second set of interface functions is the same as the first set of interface functions.

[0099] like Figure 6As 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 input parameters Res_1 and Res_3 of the two functions may be the same or different, and 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 input parameters Res_2 and Res_4 may have the same or different values, and the input parameter Path may also have the same or different values.

[0101] As can be seen from the loading processes of Component 1 and Component 2 in the above embodiments, when using the page loading method in this application embodiment to process component resources of different types (different encoding methods), different types of components can share a hook function, and this hook function can directly assign N component resources to the input function in a set of interface functions through KVC statements, thereby avoiding the process of repeatedly building interface functions and constantly searching for the system operation functions required when loading different types of components, thus improving the efficiency of component loading.

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

[0103] Additionally, on the client side, the business call interfaces required by components that use different encoding methods for the page, as specified in the coding protocol, are pre-configured and stored.

[0104] Through the embodiments provided in this application, upon obtaining the first component resource set of the first component sent by the server, the first component resource set is processed by calling a target interface function set pre-set in the client through a first hook function, and the first component is loaded using the interface functions required to display the first component in the target interface function set, thereby displaying the first component on the target page. In other words, for different types of components, the component resource sets of different types of components can be processed by using the interface functions required to display different components in the target interface function set, thereby displaying each component on the target page. This reduces the time spent reconstructing different interface functions for different types of components, improves component loading efficiency, solves the technical problem of low efficiency during page loading, 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 set of interface functions through the first hook function includes:

[0106] If the first component is a component for displaying an image, and the resource set of the first component includes the encoding information of the target image to be displayed, the encoding information of the target image is decoded by calling the image decoding interface function through the first hook function to obtain the target image. The first set of interface functions includes the image decoding interface function. Alternatively...

[0107] If the first component is a component used to display images, and the resource set of the first component includes the encoding information of a set of images to be displayed, the image decoding interface function is called through the first hook function to decode the encoding information of a set of images in sequence to obtain a set of images.

[0108] As in Embodiment 1 above, assuming the first component is a component for displaying images, the first hook function hook1 calls the image decoding interface function API_dec(Res_1=xx,L) and the second interface function API_disp(Res_2=xx,Path=xxx) to decode the encoded information in the target image and obtain the target image.

[0109] According to the above method, when the first component is a component for displaying images and the resource set of the first component includes the encoding information of a group of images to be displayed, for example, when the first component is a component for displaying a carousel, the first hook function hoo1 calls the image decoding interface function to decode the encoding information of a group of images in the carousel in turn to obtain a group of images in the carousel.

[0110] It should be noted that the component resources in the above embodiments include, but are not limited to, the component configuration information, such as the number of images, description tags and carousel interval, internal coordinates, etc. contained in the carousel; or the corresponding cluster (a collection of controls split according to the fine granularity of the page, and one component corresponds to one cluster), which usually includes tags, buttons, images, input boxes, progress bars, etc.

[0111] Obviously, the first component mentioned above, which is used to display images, is only an example and is not limited to it. For example, it could also be a component used to display text, a component used for page navigation, a component used to display a search box, etc.

[0112] Based on the analysis of the above embodiments, it can be seen that for components with different encoding methods, their system operation functions are replaced with hook functions to form a coding protocol, which is provided to the interface (interface function) for business operations. Then, KVC statements are used to assign values ​​to the input variables of the interface function.

[0113] For example, for swiping screens, live short videos, trailers, or advertising videos, the underlying decoders are different, thus forming their own decoder call interfaces in the coding protocol, which are pre-stored on the client.

[0114] For the carousel component on the page, the component ID is sent to the server, 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 the resources, the coding protocol includes the business calling interfaces required by components with different page encodings, all of which are stored on the client.

[0115] As an optional implementation, the above-mentioned acquisition of the first component resource set of the first component sent by the server includes:

[0116] Receive the 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;

[0117] Obtain the first component resource set from the extensible fields in the header of the target protocol message.

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

[0119] The Message Encoding (ME) field in the message header is optional and indicates the encoding type in the message. The first byte of ME is used as the index for the message body data. Each segment of message data is divided into 8 equal parts according to the binary length to correspond to each bit of the first byte of ME. The tail of the segmented message body data is pointed to the head of the next segment by a pointer. Therefore, a segment of the message body can be reused during the assembly of component data.

[0120] In other words, by utilizing the extensible fields in the STEP protocol header, different types of component resource sets can be transmitted, avoiding the need to use different types of transport protocols to transmit different types of component data. This ensures the security of diverse component data transmission while improving the transmission efficiency of diverse component data transmission.

[0121] In this embodiment, component data is transmitted in the form of a protocol header using the STEP protocol; each sub-component data transmission begins with a standard message header. The message header specifies data fields such as message type, length, destination, sequence number, start point, and time, and no session-level encryption is used for transmission. Due to the diversity of client (initiator) components, different components may require different data sizes, reception start and end times, sequence numbers, etc. Therefore, each type of component is loaded on demand, and a message sending and receiving session is established with the server (receiver).

[0122] In addition, when the client initiates a loading action, the page sends a Logon message, which includes the component ID, data serialization method, device ID, cipher suite, and authorization function. The server-side has a similarly implemented authorization function, allowing users to choose any encryption algorithm from the cipher suite. Each component on the page establishes a session. The message header in the session contains the domain fields SenderCompID and TargetCompID, representing the sender and receiver codes. This code is generally an encoded string. In diverse components, the server determines the component ID, then uses SenderCompID to determine the server's extension number for delivery. The target terminal resolves TargetCompID to the corresponding device ID for reception. The MsgSeqNum field is the message sequence number. In the event of packet loss or timeout, the client sends back the MsgSeqNum value to determine the next data packet for the component.

[0123] After receiving a message, the client opens a receiving context of the corresponding size according to the component ID of the sent data, processes the segmented data during transmission, reassembles the binary data according to the pointers to the message segments 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 the binary data into an object that can be processed by the client during runtime.

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

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

[0126] The serialized data is deserialized to obtain the first component resource set.

[0127] After the server sends the 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 server typically use similar KVC operations to serialize the data, specifically as follows: Figure 8 As shown, it includes:

[0128] S802 receives binary data sent by the server;

[0129] The server sends the first component resource set to the client by first using KVC encoding to serialize the resources in the first component resource set to obtain serialized binary data, and then sending the binary data to the client.

[0130] S804 performs deserialization based on cluster information;

[0131] Obtain information about a single cluster and parse it to obtain cluster attribute field information for each component.

[0132] In this context, a cluster can be understood, but is not limited to, as a collection of pages after fine-grained decomposition, with one component corresponding to one cluster.

[0133] S806, override the property set and get methods to implement the setting and getting of property values;

[0134] It should be noted that KVC provides a mechanism for indirectly accessing object properties. Its main function is to set property values ​​(assigned through dot syntax, across levels) and retrieve property values.

[0135] S808 uses runtime mechanisms to obtain Ivars in an object;

[0136] Runtime, or runtime mechanism, refers to the mechanisms that occur during runtime, primarily the message mechanism. In C, the function call is determined at compile time.

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

[0138] Ivars is an array (also known as member variables), where each element is a pointer to an Ivar (variable information).

[0139] S810: Traverse the properties based on the pointers represented by each element in Ivar to obtain the property name and type;

[0140] Initialize the cluster object and use the runtime mechanism to obtain the Ivars in the object, which are pointers to member variables. Since most cluster objects are custom objects, it is necessary to traverse the properties based on the pointers to obtain the property names and types.

[0141] S812 executes the KVC setter method call based on the deserialized data to generate 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 by the first key-value encoding (KVC) statement in the first hook function, and the first interface function is run to obtain the processing result of the first component resource so as to display the first member on the target page, wherein one cluster corresponds to one component.

[0143] After generating a single cluster, components are constructed and assembled according to the relationships in the client configuration layer. For example, based on 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] By using the above method, the client and server use similar KVC operations to serialize the data, which reduces the need to adapt to various serialization methods at the business layer and improves the rendering efficiency of diverse components by traversing and assigning values ​​to custom cluster objects.

[0145] As can be seen from the analysis of the above embodiments, in the page loading method of this application embodiment, the server generates a general configuration layer through KVC, maps the entry points of data persistence methods such as database, archive, and key-value pairs for storing page controls using the configuration layer, and uses the smallest unit of each type of storage as a cluster; transmits the encrypted number of the component in the form of a protocol header through the STEP protocol, generates a routing layer at the receiving end of the client, and accesses the cluster in the KVC manner, thereby realizing the diversification of page controls during the reading and writing of component data and improving the page loading efficiency.

[0146] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0147] According to another aspect of the embodiments of this application, as follows is also provided Figure 9 A page loading device is shown, the device comprising:

[0148] The 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 the target page to be loaded on the client.

[0149] The first acquisition unit 904 is used to acquire the first component resource set of the first component sent by the 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, so as to display the first component on the target page on the client. The first interface function set includes the interface functions required to display the first component from 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. The first hook function is a function pre-set in the client.

[0151] Optionally, the above-mentioned device further includes:

[0152] The replacement unit is used to replace the function triggered when the first component is displayed in the client with the first hook function when the client starts up or after the client starts up. The first system operation function is the operation function in the operating system where the client is located. The first system operation function is set to prohibit calling the interface functions in the target interface function set, and the first hook function is set to allow calling the interface functions 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 encoding (KVC) statement in the first hook function, and run the first interface function to obtain the processing result of the first component resource. Here, the first component resource is the component resource in the first component resource set, and the first interface function is the interface function in the first interface function set used to process the first component resource.

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

[0156] The second processing module is used to assign the N component resources to the input parameters of 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 with hierarchical relationship, and run the set of interface functions to obtain the processing results of the N component resources. Here, N is a positive integer greater than or equal to 2, and the set of interface functions is the interface functions in the first set of interface functions used to process the N component resources.

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

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

[0159] The fourth processing module is used to decode the encoding information of the target image by calling the image decoding interface function through the first hook function, when the first component is a component for displaying an image and the resource set of the first component includes the encoding information of the target image to be displayed, thereby obtaining the target image. The first interface function set includes the image decoding interface function.

[0160] If the first component is a component used to display images, and the resource set of the first component includes the encoding information of a set of images to be displayed, the image decoding interface function is called through the first hook function to decode the encoding information of a set of images in sequence to obtain a set of images.

[0161] Optionally, the above-mentioned device further includes:

[0162] The second processing unit is used to set each interface function in the target interface function set to be allowed to be called when the client starts or after the client starts.

[0163] Optionally, the above-mentioned device further includes:

[0164] The second acquisition unit is used to acquire the second component resource set of the second component sent by the server when the page loading request also includes the 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 using 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, so as to display the second component on the target page on the client. 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 set of interface functions may have some of the same interface functions as the first set of interface functions; or, the second set of interface functions may be the same as the first set of interface functions.

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

[0168] The receiving module is used to receive the 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;

[0169] The first acquisition module is used to obtain the first component resource set from the extensible fields in the protocol header of the target protocol message.

[0170] Optionally, the above-mentioned device further includes:

[0171] The third acquisition unit is used to obtain the first hook function and the target interface function set from the client's installation file during client installation; or

[0172] After the client starts, it retrieves the first hook function and the set of target interface functions from the server.

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

[0174] The 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 resource set of the first component;

[0175] The fifth processing module is used to deserialize the serialized data to obtain the first component resource set.

[0176] By applying the aforementioned device to a first component resource set received from a server, the first component resource set is processed by calling a pre-set set of target interface functions in the client via a first hook function. The first component is then loaded using the interface functions required for displaying the first component from the target interface function set, thereby displaying the first component on the target page. In other words, for different types of components, the component resource sets of different types can be processed using the interface functions required for displaying different components from the target interface function set, thus displaying each component on the target page. This reduces the time spent rebuilding different interface functions for different types of components, improves component loading efficiency, solves the technical problem of low efficiency during page loading, and achieves the technical effect of improving page loading efficiency.

[0177] It should be noted that the embodiments of the page loading device described here can refer to the embodiments of the page loading method described above, and will not be repeated here.

[0178] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described page loading method is also provided. This electronic device may be... Figure 10 The terminal device shown is illustrated in this embodiment, which uses this electronic device as an example of a backend device. Figure 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 of any of the above method embodiments via the computer program.

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

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

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

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

[0183] S3, 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. The first interface function set includes the interface functions required to display the first component from 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 components in the target component set are components formed using different encoding methods. The first hook function is a function pre-set in the client.

[0184] Alternatively, as those skilled in the art will understand, Figure 10 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other target terminals. Figure 10 This does not limit the structure of the aforementioned electronic devices or electronic equipment. For example, electronic devices or electronic equipment may also include components that are more... Figure 10 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 10 The different configurations shown.

[0185] 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 apparatus in this embodiment. The processor 1004 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002, thereby implementing the page loading method described above. The memory 1002 may include high-speed random access memory, and may also include 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 memory remotely located relative to the processor 1004, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 1002 may be used, but is not limited to, to store page loading requests, the identifier of the first component, and the resource set of the first component, etc. As an example, such as Figure 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. Furthermore, it may include, but is not limited to, other module units in the page loading device, which will not be elaborated upon in this example.

[0186] Optionally, the transmission device 1006 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1006 includes a Network Interface Controller (NIC), which can be connected to other network devices and routers via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 1006 is a Radio Frequency (RF) module, used for wireless communication with the Internet.

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

[0188] In other embodiments, the target terminal or server can be a node in a distributed system, which can be a blockchain system. This blockchain system is formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer (P2P) network, and any type of computing device, such as a server or terminal, can become a node in the blockchain system by joining this peer-to-peer network.

[0189] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the page loading method provided in various optional implementations of the server verification processing described above, wherein the computer program is configured to execute the steps in any of the above method embodiments at runtime.

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

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

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

[0193] S3, 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. The first interface function set includes the interface functions required to display the first component from 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 components in the target component set are components formed using different encoding methods. The first hook function is a function pre-set in the client.

[0194] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the target terminal. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0195] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0196] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods of the various embodiments of this application.

[0197] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0198] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or the indirect coupling or communication connection of units or modules may be electrical or other forms.

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

[0200] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0201] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A page loading method, characterized in that, include: Send a page load request to the server, wherein the page load request includes an identifier of a first component on the target page to be loaded on the client; Obtain the first component resource set of the first component sent by the server; The first hook function calls the first set of interface functions to process the first component resource set in order to display the first component on the target page on the client. The first set of interface functions includes the interface functions required to display the first component from the target set of interface functions pre-set in the client. The target set of interface functions includes the interface functions required to display each component in the target set of components. At least some of the components in the target set of components are components formed using different encoding methods. The first hook function is a function pre-set in the client. The method further includes: when the client starts or after the client starts, replacing the function triggered when the first component is displayed in the client from the first system operation function with 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 the interface functions in the target interface function set, and the first hook function is set to allow calling the interface functions in the target interface function set.

2. The method according to claim 1, characterized in that, The step of processing the first component resource set by calling the first set of interface functions through the first hook function includes: The first component resource is assigned to the input parameter in the first interface function by the first key-value encoding (KVC) statement in the first hook function, and the first interface function is run to obtain the processing result of the first component resource. Here, 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 used to process the first component resource.

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

4. The method according to claim 1, characterized in that, The step of processing the first component resource set by calling the first set of interface functions through the first hook function includes: When the first component is a component for displaying an image, and the resource set of the first component includes the encoding information of the target image to be displayed, the encoding information of the target image is decoded by calling the image decoding interface function through the first hook function to obtain the target image, wherein the first interface function set includes the image decoding interface function; or When the first component is a component for displaying images, and the resource set of the first component includes the encoding information of a set of images to be displayed, the image decoding interface function is called through the first hook function to decode the encoding information of the set of images in sequence, thereby obtaining the set of images.

5. The method according to claim 1, characterized in that, The method further includes: When the client starts or after the client starts, each interface function in the target interface function set is set to be allowed to be called.

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

7. The method according to claim 6, characterized in that, The second set of interface functions has some of the same interface functions as the first set of interface functions; or, the second set of interface functions is the same as the first set of interface functions.

8. The method according to any one of claims 1 to 7, characterized in that, The step of obtaining the first component resource set of the first component sent by the server includes: The server receives a target protocol message sent to the client, wherein the extensible field in the protocol header of the target protocol message carries the first component resource set; Obtain the first component resource set from the extensible fields in the protocol header of the target protocol message.

9. The method according to any one of claims 1 to 7, characterized in that, The method further includes: The first hook function and the target interface function set are obtained from the client's installation file during client installation; or After the client starts, it obtains the first hook function and the target interface function set from the server.

10. The method according to any one of claims 1 to 7, characterized in that, The step of obtaining the first component resource set of the first component sent by the server includes: Obtain the serialized data sent by the server, wherein the serialized data is data obtained by performing a serialization operation on the first component resource set; The serialized data is deserialized to obtain the first component resource set.

11. A page loading device, characterized in that, include: The first sending unit is used to send a page loading request to the server, wherein the page loading request includes an identifier of a first component on the target page to be loaded on the client; The first acquisition unit is used to acquire the first component resource set of the first component sent by the server; A first processing unit is configured to process the first component resource set by calling a first set of interface functions through a first hook function, so as to display the first component on the target page on the client. The first set of interface functions includes interface functions required to display the first component from a target set of interface functions pre-set in the client. The target set of interface functions includes interface functions required to display each component in the target component set. At least some components in the target component set are components formed using different encoding methods. The first hook function is a function pre-set in the client. The device is further configured to replace the function triggered when the first component is displayed in the client with the first hook function when the client starts up or after the client starts up, 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.

12. 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 computer at runtime as described in any one of claims 1 to 10.

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

14. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 10 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