Data processing method, device and equipment, computer storage medium and computer program product
By calling callback functions and mapping relationships in the client device to determine the target resource construction artifacts, the problem of users being unable to access the entry point normally after switching platforms is solved, realizing automatic adaptation of the same access entry point and improving the user experience.
Patent Information
- Application Number
- CN202411846025.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-01-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In front-end development, users are unable to access the target entry point normally after switching platforms, affecting the user experience.
By calling a pre-defined callback function in the client device to pass target platform information, and using the mapping relationship between platform information and the identification information of resource construction artifacts, the target resource construction artifacts are determined and access responses are made, thus achieving automatic adaptation of the same access entry point.
It achieves automatic adaptation of resources across different platforms, avoiding the problem of inaccessibility after platform switching and improving user experience.
Smart Images

Figure CN119311338A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a data processing method, apparatus, device, computer storage medium, and computer program product. Background Art
[0002] In the field of browser technology, front-end development and construction refers to packaging the developed code and related resources such as used images into code resources that can be recognized by the browser for use when the page is loaded.
[0003] With the increasing number of platforms, such as different types of devices such as PC, mobile, tablet, TV, or different types of systems such as iOS, Android, etc., in view of the differences between the platforms, in order to better adapt to each platform, each platform is usually adapted during front-end development and construction. For example, in the relevant technology, multiple build projects can be set up, and one build project is used to build resources for one platform; or the resources of each platform can be built uniformly in the same project, and multiple different access entrances can be set for different platforms.
[0004] However, in the above method, for the access portal set for the target platform, it can only support users to access the access portal on the target platform, and when switching platforms, users cannot access the portal normally. For example: when a user gets an access link set for a mobile terminal, an exception will occur if the link is accessed on a PC. Therefore, the above method affects the user experience. Summary of the invention
[0005] In view of this, embodiments of the present application provide a data processing method, apparatus, device, computer storage medium, and computer program product.
[0006] According to a first aspect of an embodiment of the present application, a data processing method is provided, which is applied to a client device, and the method includes: In response to the user's access operation to the target portal, a preset callback function is called, and the target platform information corresponding to the client device is transmitted through the callback function; Determine the target identification information according to the target platform information and the mapping relationship between the platform information and the identification information of the resource construction product, determine the target resource construction product from the multiple resource construction products according to the target identification information, and perform an access response based on the target resource construction product; Among them, the multiple resource construction products are multiple resource data pre-constructed for the same target entrance, and one resource data corresponds to one platform.
[0007] According to a second aspect of an embodiment of the present application, there is provided a data processing device, including: A callback module, used to call a preset callback function in response to a user's access operation to a target portal, and transmit target platform information corresponding to the client device through the callback function; An identification information determination module, used to determine target identification information according to the target platform information and the mapping relationship between the platform information and the identification information of the resource construction product, so as to determine the target resource construction product from multiple resource construction products according to the target identification information, and perform an access response based on the target resource construction product; Among them, the multiple resource construction products are multiple resource data pre-constructed for the same target entrance, and one resource data corresponds to one platform.
[0008] According to the third aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method described in the first aspect.
[0009] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect is implemented.
[0010] The data processing solution provided by the embodiment of the present application is that the client device calls a pre-set callback function in response to the user's access operation to the target entrance, and transmits the target platform information corresponding to the client device through the callback function; the target identification information is determined according to the target platform information, and the mapping relationship between the platform information and the identification information of the resource construction product, so as to determine the target resource construction product from multiple resource construction products according to the target identification information, and perform an access response based on the target resource construction product; wherein the multiple resource construction products are multiple resource data constructed for the same target entrance, and one resource data corresponds to one platform.
[0011] In the above-mentioned embodiments of the present application, no matter what type of platform the client device performing the access operation in the actual application process belongs to, a unified access entrance, that is, the same target entrance, is set; when the user's access operation to the above-mentioned unified entrance is detected, a pre-set callback function will be exposed first, and then the platform information to which the client device belongs (for the convenience of description, in the embodiment of the present application, the platform to which the client device belongs is referred to as the target platform, and then the information of the target platform is referred to as the target platform information) is passed to the client device through the callback function, and then the client device determines the resource construction product identification information corresponding to the target platform from the resource construction product identification information corresponding to different platforms according to the mapping relationship between the platform information and the identification information of the resource construction product: the target identification information; thereafter, the target resource construction product corresponding to the target platform information can be determined based on the target identification information, and then an access response is made according to the product.
[0012] That is: the embodiment of the present application allows users to customize and select resource construction products that match the current platform through hooks at the main entrance, thereby achieving the effect of automatically adapting to the use of resources on different platforms for the same access entrance, avoiding the problem of not being able to access the entrance normally after switching platforms, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0014] Figure 1 A schematic diagram of an exemplary system applicable to the data processing method of an embodiment of the present application; Figure 2 is a flowchart of a data processing method according to an embodiment of the present application; Figure 3 for Figure 2 A schematic diagram of an example scenario in the illustrated embodiment; Figure 4 A schematic diagram of a scenario example of a product construction process in an embodiment of the present application; Figure 5 This is a schematic diagram of a scenario with multiple layers of nested resources; Figure 6 is a structural block diagram of a data processing device according to an embodiment of the present application; Figure 7 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0015] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions 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. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.
[0016] See also Figure 1 , Figure 1 This is a schematic diagram of an exemplary system applicable to the data processing method of the embodiment of the present application. For ease of understanding, first combine Figure 1 The application scenarios of the data processing method provided in the embodiments of the present application are explained.
[0017] like Figure 1 As shown, the system 100 may include a server 102, a communication network 104 and / or one or more client devices (ie, terminal devices) 106. Figure 1 The example in Figure 1 shows multiple client devices.
[0018] The server 102 may be any suitable device for storing programs and / or any other suitable type of content, including but not limited to a distributed storage system device, a server cluster, a computing cloud server cluster, etc. In some embodiments, the server 102 may perform any suitable function.
[0019] In some embodiments, the communication network 104 can be any suitable combination of one or more wired and / or wireless networks. For example, the communication network 104 can include any one or more of the following: the Internet, an intranet, a wide area network (WAN), a local area network (LAN), a wireless network, a digital subscriber line (DSL) network, a frame relay network, an asynchronous transfer mode (ATM) network, a virtual private network (VPN), and / or any other suitable communication network. The client device 106 can be connected to the communication network 104 via one or more communication links (e.g., communication link 112), and the communication network 104 can be linked to the server 102 via one or more communication links (e.g., communication link 114). The communication link can be any communication link suitable for transmitting data between the client device 106 and the server 102, such as a network link, a dial-up link, a wireless link, a hard-wired link, any other suitable communication link, or any suitable combination of such links.
[0020] The client device 106 may include any one or more user devices. In some embodiments, the client device 106 may include any suitable type of device. For example, in some embodiments, the client device 106 may include a mobile phone, a computer, a folding screen, and / or any other suitable type of user device.
[0021] Based on the above system, an embodiment of the present application provides a data processing method, which is described below through specific embodiments.
[0022] Reference Figure 2 , Figure 2 The data processing method provided in the embodiment of the present application can be applied to the client device 106 in the above system. The specific method may include the following steps: Step 202: In response to the user's access operation to the target portal, a preset callback function is called, and the target platform information corresponding to the client device is transmitted through the callback function.
[0023] Specifically, the target entry in this step can be a main interface or entry point for interacting with the user. For example, in a browser, the target entry can be the main interface, login interface, menu options, API interface, access link or other interactive elements that the user sees when entering the browser.
[0024] When the user wants to access the target entrance, the corresponding access operation can be performed on the target entrance. When the client device detects the above access operation, it executes the relevant logic to respond to the user and display the response data. In the embodiment of the present application, the specific content of the access operation is not limited, and the access operation can be customized for each entrance according to the actual situation. For example, the access operation can be a single-click operation, a double-click operation, a drag operation, etc. for the entrance.
[0025] In the embodiment of the present application, when the user's access operation to the target portal is detected, the callback function is first called in the form of a hook to pass the platform information of the platform to which the client device currently used by the user belongs. Specifically, in the embodiment of the present application, there is no limitation on the specific setting method of the callback function, and any callback function that can realize the transmission of the target platform information corresponding to the client device belongs to the protection scope of the present application.
[0026] Exemplarily, when a user is browsing a page through a mobile client device, when the user wants to know the detailed information of a product displayed on the page, the user can click on the target entry of the detail link of the product displayed on the page. When the client device detects the above-mentioned click operation of the user, it is determined that the access operation to the target entry is received. After that, the pre-set callback function can be called to obtain the platform information of the platform to which the client device belongs. In this example, the target platform information finally obtained can be: mobile terminal.
[0027] Step 204, determine the target identification information according to the target platform information and the mapping relationship between the platform information and the identification information of the resource construction product, so as to determine the target resource construction product from multiple resource construction products according to the target identification information, and make an access response based on the target resource construction product.
[0028] Specifically, in the product construction stage, the embodiment of the present application pre-constructs multiple independent resource data corresponding to different platforms for a single entry as a product of resource construction, wherein one type of resource data is used for access response in a client device of one platform type.
[0029] Furthermore, after constructing independent resource data corresponding to different platforms, the embodiment of the present application also allocates unique identification information to each independent resource data (that is, each resource construction product), that is, a unique ID (Identity document) is set for the independent resource data corresponding to each platform, thereby generating a mapping relationship between the platform information and the identification information of the resource construction product.
[0030] In this step, after obtaining the target platform information to which the client device belongs, the target identification information corresponding to the platform to which the client device currently used by the user belongs can be determined based on the above-mentioned mapping relationship, and then the target resource construction product corresponding to the target platform can be determined from multiple resource construction products based on the target identification information, so as to make an access response based on the target resource construction product.
[0031] Specifically, the access response method can be: build a product according to the target resource to render the page, so as to display the page rendering result to the user, and the page rendering result includes the access response data corresponding to the target entry to be accessed.
[0032] As exemplified in the above step 202, when the user clicks on the target entry of the detail link of the product displayed on the page, the client device can finally obtain the target resource construction product corresponding to the target platform of the mobile terminal through the above steps 202 and 204, and then render the page according to the target resource construction product, thereby displaying the access response data containing the above product detail information to the user.
[0033] See also Figure 3 , Figure 3 for Figure 2 A schematic diagram of an example scenario in the embodiment shown. Figure 3 right Figure 2 The illustrated embodiment is explained again: When the user wants to access the target portal, the corresponding access operation can be performed on the target portal; in response to the above access operation, the client device can transmit the target platform information of the target platform to which the client device belongs through a preset callback function. For example, Figure 3 The platforms that may be involved in the scenario shown include: platform 1, platform 2, and platform 3; and then the target identification information of the target resource construction product can be determined according to the mapping relationship between the platform information and the identification information of the resource construction product. For example, Figure 3 In the scenario shown, the identification information of the resource construction product corresponding to platform 1 is ID1, the identification information of the resource construction product corresponding to platform 2 is ID2, and the identification information of the resource construction product corresponding to platform 3 is ID3; after determining the target identification information, the corresponding target resource construction product can be obtained according to the target identification information. For example, Figure 3 In the scenario shown, identification information ID1 corresponds to product 1, identification information ID2 corresponds to product 2, and identification information ID3 corresponds to product 3; after determining the target resource construction product corresponding to the client device, an access response can be made based on the target resource construction product, and the response data can be fed back to the user.
[0034] In the above-mentioned embodiments of the present application, no matter what type of platform the client device performing the access operation in the actual application process belongs to, a unified access entrance, that is, the same target entrance, is set; when the user's access operation to the above-mentioned unified entrance is detected, a pre-set callback function will be exposed first, and then the platform information to which the client device belongs (for the convenience of description, in the embodiment of the present application, the platform to which the client device belongs is referred to as the target platform, and then the information of the target platform is referred to as the target platform information) is passed to the client device through the callback function, and then the client device determines the resource construction product identification information corresponding to the target platform from the resource construction product identification information corresponding to different platforms according to the mapping relationship between the platform information and the identification information of the resource construction product: the target identification information; thereafter, the target resource construction product corresponding to the target platform information can be determined based on the target identification information, and then an access response is made according to the product.
[0035] That is: the embodiment of the present application allows users to customize and select resource construction products that match the current platform through hooks at the main entrance, thereby achieving the effect of automatically adapting to the use of resources on different platforms for the same access entrance, avoiding the problem of not being able to access the entrance normally after switching platforms, and improving the user experience.
[0036] Optionally, in some of the embodiments, determining a target resource construction product from a plurality of resource construction products according to the target identification information, and performing an access response based on the target resource construction product includes: Sending the target identification information to the server device, so that the server device compares the target identification information with identification information of multiple resource construction products, and determines the target resource construction product from the multiple resource construction products; Receive and display the access response data returned by the server device. The access response data is obtained based on the product built by the target resource.
[0037] Specifically, after the client device determines the target identification information, it can send the information to the server device, which then determines the target resource construction product based on the information, and generates access response data based on the determined target resource construction product, and then returns the access response data to the client device, which displays the access response data.
[0038] In the above process, when making an access response, the client device only needs to transmit the target identification information to the server device, and the subsequent access response data generation operation is performed by the server device. Therefore, the computing power requirements of the response process for the client device are reduced, so that the user can still obtain the platform-matching response data on the client device with lower computing power.
[0039] Optionally, in some of the embodiments, the data processing method may further include: For the entry to be built for the product to be built, count the platforms involved in the entry to be built; Get the resources to be packaged corresponding to each platform respectively; Start multiple Webpacks to independently package the resources to be packaged corresponding to each platform, and obtain resource construction products corresponding to different platforms; one Webpack is used to independently package the resources to be packaged corresponding to one platform; According to the platform information corresponding to each platform, identification information is allocated to the resource construction product corresponding to each platform to build a mapping relationship between the platform information and the identification information of the resource construction product.
[0040] Specifically, in the embodiments of the present application, there is no limitation on the types and number of platforms involved in the portal, and the settings and modifications can be customized according to the actual situation. For example, the platforms can be divided according to the terminal type of the client device. In this case, the types of platforms that the portal may involve may include: PC terminal, mobile terminal, TV terminal, etc.; the platforms can also be divided according to the operating system type of the client device. In this case, the types of platforms that the portal may involve may include: Android platform, IOS platform, etc.; further, for the same type of operating system, the platforms can also be divided according to the version of the operating system, etc.
[0041] After counting the platforms involved in the portal to be constructed, the corresponding resources to be packaged can be obtained for each platform. The resources to be packaged are resource data used to generate access response data. Different resource data can be developed and designed for different access portals to respond to different access response data to users. The specific content of the resource data is not limited. For example, in a browser scenario, the resources to be packaged in the embodiment of the present application may include code, pictures, text, hypertext markup language files, etc. developed to implement preset functions.
[0042] In the embodiments of the present application, there are no limitations on the specific settings and allocation principles of the identification information of the resource construction product. Any suitable identification information settings and allocation methods that can distinguish independent resource data corresponding to different platforms are applicable to the solutions of the embodiments of the present application.
[0043] After obtaining the resources to be packaged corresponding to each platform, in the embodiment of the present application, multiple Webpacks are started in parallel, and one Webpack is used to independently package the resources to be packaged for one platform. Through the above resource packaging method, the mutual independence between the final products can be guaranteed. At the same time, since multiple Webpacks perform packaging operations in parallel, the overall efficiency of product construction can also be improved.
[0044] In addition, in the embodiment of the present application, after obtaining the products corresponding to different platforms, unique identification information is also assigned to each product, and a mapping relationship between the platform information and the above identification information is constructed. In this way, when selecting a target resource construction product from multiple resource construction products, the target resource construction product can be conveniently and quickly determined according to the above mapping relationship, thereby improving the overall speed of access response and improving the user's access experience.
[0045] Optionally, in some embodiments, there are multiple entries to be constructed, and resources to be packaged corresponding to each platform are obtained respectively, including: For a single platform, obtain the resources to be packaged corresponding to each entry to be built; Start multiple Webpacks to independently package the resources to be packaged corresponding to each platform, and obtain resource construction products corresponding to different platforms, including: Start multiple Webpacks in parallel, one Webpack for each platform; For a single platform, the Webpack corresponding to the platform is used to package the resources to be packaged corresponding to each entry to be built, so as to obtain resource construction products corresponding to different entries to be built under the platform.
[0046] Specifically, in the product construction process of the above embodiment of the present application, by configuring Webpack for each platform in parallel, multi-entry product construction can be performed in batches for the same platform. That is, for the same platform, after the above construction process of the present application, resource construction products corresponding to different entrances can be constructed in batches, thereby effectively improving the efficiency of product construction.
[0047] For ease of understanding, the above construction process is explained below by way of example: Assume that for a certain product, multiple different access portals are set according to demand, such as: product details link, product purchase link, product evaluation link, and the above link is an access portal. Without considering the diversity of platforms, during the access process, when the user clicks the product details link, the product details page A will be displayed to the user; when the user clicks the product facet link, the product purchase page B will be displayed, and when the user clicks the product evaluation link, the product evaluation page C will be displayed. Therefore, without considering the diversity of platforms, when the number of access portals is 1, it is sufficient to construct one product, and when the number of access portals is 3, correspondingly, it is sufficient to construct 3 products, specifically: a product for generating page A, a product for generating page C, and a product for generating page C.
[0048] When considering the diversity of platforms, it is assumed that there are two types of platforms: Platform 1 and Platform 2. For the same access portal, according to the solution of the embodiment of the present application, one product is generated for each platform, that is, for the same access portal, two products are generated, and when the total number of access portals is 3, a total of 6 products are generated, specifically: for Platform 1, a product for generating a product details page A1, a product for generating a product purchase page B1, and a product for generating a product evaluation page C1; for Platform 2, a product for generating a product details page A2, a product for generating a product purchase page B2, and a product for generating a product evaluation page C2.
[0049] In the related art, for the above construction task, the product construction is performed by page, that is, first, for the product details page, a product for generating product details page A1 is constructed, and a product for generating product details page A2 is constructed; then, the product construction process is repeated, and for the product purchase page, a product for generating product purchase page B1 is constructed, and a product for generating product purchase page B2 is constructed; then, the product construction process is repeated again, and for the product evaluation page, a product for generating product evaluation page C1 is constructed, and a product for generating product evaluation page C2 is constructed. The above construction process requires the product construction process to be repeated three times, so the construction efficiency is low.
[0050] In the above embodiment of the present application, for the above construction task, two Webpacks can be started in parallel, wherein Webpack1 is used to build products for platform 1, specifically: respectively building products for generating product details page A1, products for generating product purchase page B1, and products for generating product evaluation page C1; Webpack2 is used to build products for platform 2, specifically: respectively building products for generating product details page A2, products for generating product purchase page B2, and products for generating product evaluation page C2.
[0051] In comparison, the above construction process of the present application obtains the construction products in two dimensions (platform dimension and entry dimension) through a product construction process. Therefore, through the above embodiments of the present application, the richness of the products obtained by the construction can be improved, and at the same time, the efficiency of product construction can be effectively improved.
[0052] Optionally, in some of the embodiments, respectively obtaining the resources to be packaged corresponding to each platform may also include: The resources to be packaged are developed for each platform respectively, and during the development process, it is determined whether the resources to be packaged are general resources; if the resources to be packaged are general resources, the resources to be packaged are obtained from the developed resources through resource reference.
[0053] Specifically, for multi-platform development, in general, many functions are common in different products corresponding to the same access portal. If resources are developed independently for each platform during the development process, it will affect the development and construction efficiency.
[0054] Taking the above situation into consideration, in the process of resource development and construction, the above-mentioned embodiments of the present application judged the common resources for the resources to be packaged. For the common resources, they were obtained by referencing resources from the developed resources without the need for repeated development. Therefore, while ensuring the integrity of the construction product data, the overall efficiency of resource development and product construction can be effectively improved.
[0055] Specifically, the resource reference method is briefly explained below by way of example: Assume that the platforms involved include platform 1, platform 2, and platform 3. For a certain universal resource, if the development of the universal resource has been completed during the development process of platform 1, then in the development process for platform 2 and platform 3, there is no need to repeat the development of the universal resource, but the universal resource acquisition step can be completed by referencing the universal resource that has been developed in platform 1.
[0056] See also Figure 4 , Figure 4 This is a schematic diagram of a scenario example of the product construction process in the embodiment of this application. Figure 4 A brief description of the above product construction process: At the beginning of the product construction project, for the entry to be built, count and distinguish the platform types that may access the entry in the actual application phase, that is, count and distinguish the platforms involved in the entry. Figure 4 Three platform types are shown as examples: platform 1, platform 2, and platform 3. In the platforms involved in the entry configuration to be built, each platform is assigned a Webpack, and then resources are developed for different platforms. If a common resource is encountered, the common resource can be obtained from the developed resources through resource reference. After the resource development and acquisition are completed, the above-mentioned multiple Webpacks can be used to package the resources in parallel, and finally independent resource construction products corresponding to different platforms are obtained. Figure 4 The following are obtained: the resource construction product corresponding to platform 1, the resource construction product corresponding to platform 2, and the resource construction product corresponding to platform 3. The codes and resources in the above products are all codes or resources corresponding to specific platforms, and there are no useless codes or resources; after the product construction is completed, a unique ID is assigned to each product obtained by the construction.
[0057] Optionally, in some of the embodiments, a plurality of platform-private resources corresponding to different platforms are embedded in the general resource, and the platform-private resources corresponding to different platforms have different resource names; Start multiple Webpacks to independently package the resources to be packaged corresponding to each platform, and obtain resource construction products corresponding to different platforms, including: Start multiple Webpacks in parallel, and configure the target private resource name for each Webpack according to the platform corresponding to each Webpack to determine the target private resource name that each Webpack will package; Through each Webpack, the resources to be packaged corresponding to each platform are packaged independently in parallel; In the process of resource packaging, for common resources, each Webpack selects target private resources from common resources according to their own target private resource names, and packages the resources based on the selected target private resources.
[0058] Specifically, during the product construction process, there may be multiple layers of nested resources. Figure 5 , Figure 5 This is a schematic diagram of a scenario with multi-layer nesting of resources. Figure 5 In the example, a certain general resource contains multiple platform-private resources corresponding to different platforms: private resources corresponding to the PC side, and private resources corresponding to the mobile side. If the complete general resources are packaged during resource packaging for the PC side or the mobile side, the final product will contain useless resources that are not related to this platform. Obviously, this packaging method is inefficient, and because the product contains useless resources, it will result in a large amount of product data, and then in the actual access process, it will waste the resources of the client device and cause a decrease in loading speed, affecting the user experience.
[0059] If you perform platform judgment in common resources and then package them, some useless resources that do not belong to the current platform will still be packaged in, which will also lead to an increase in junk resources and affect performance.
[0060] In response to the above problems, in the above embodiments of the present application, different resource names are set for each platform private resource nested in the general resources. After that, the target private resource name is configured for each Webpack according to the platform corresponding to each Webpack, so as to clarify the target private resource name to be packaged by each Webpack. Through the above process, in the process of resource packaging, for general resources, each Webpack will efficiently and accurately determine the target private resource selection from the general resources according to its own target private resource name, and then perform resource packaging based on the selected target private resource. In the above process of the present application, by configuring the main file name of Webpack, Webpack can quickly select the correct platform private resource from multiple platform private resources nested in the general resources during resource packaging, thereby improving the packaging efficiency, and since the above packaging method can avoid the problem of packaging useless resources, the data volume of the product can be reduced, and then in the subsequent actual access process, the resources of the client device can be saved and the loading speed can be improved, thereby improving the user experience.
[0061] In addition, in the embodiment of the present application, the naming rules for the resource names of the private resources of each platform are not limited and can be customized according to the actual situation. Further, in order to facilitate understanding and subsequent maintenance and upgrade of resources, the platform identification information of the platform corresponding to the private resource can be added to the resource name when naming.
[0062] For example, for Figure 5 , the resource directory to be packaged can be in the following form: -PC ---General Resources -----PC-side private resources (name 1) -----Mobile private resources (name 2) -Mobile ---General Resources -----PC-side private resources (name 1) -----Mobile private resources (name 2) When packaging on the PC side, the main file name of the corresponding Webpack can be configured as "Name 1". When the packaging process traverses to the general resources, the resource file with "Name 1" will be selected for packaging; when packaging on the mobile side, the main file name of the corresponding Webpack can be configured as "Name 2". When the packaging process traverses to the general resources, the resource file with "Name 2" will be selected for packaging.
[0063] Figure 6The data processing device provided by the embodiment of the present application may include: The callback module 602 is used to call a preset callback function in response to the user's access operation to the target portal, and transmit the target platform information corresponding to the client device through the callback function; The identification information determination module 604 is used to determine the target identification information according to the target platform information and the mapping relationship between the platform information and the identification information of the resource construction product, so as to determine the target resource construction product from the multiple resource construction products according to the target identification information, and perform an access response based on the target resource construction product; Among them, multiple resource construction products are multiple resource data pre-constructed for the same target entrance, and one resource data corresponds to one platform.
[0064] Optionally, in some of the embodiments, the identification information determining module 604, when executing the step of determining a target resource construction product from a plurality of resource construction products according to the target identification information, and performing an access response based on the target resource construction product, is specifically used to: Sending the target identification information to the server device, so that the server device compares the target identification information with identification information of multiple resource construction products, and determines the target resource construction product from the multiple resource construction products; Receive and display the access response data returned by the server device. The access response data is obtained based on the product built by the target resource.
[0065] Optionally, in some of the embodiments, the data processing device further comprises: The product construction module is used to count the platforms involved in the to-be-built entry for the product to be built; obtain the to-be-packaged resources corresponding to each platform respectively; start multiple Webpacks to independently package the to-be-packaged resources corresponding to each platform, and obtain resource construction products corresponding to different platforms; among which, one Webpack is used to independently package the to-be-packaged resources corresponding to one platform; according to the platform information corresponding to each platform, identification information is assigned to the resource construction product corresponding to each platform to establish a mapping relationship between the platform information and the identification information of the resource construction product.
[0066] Optionally, in some embodiments, there are multiple entries to be constructed, and when the product construction module executes the step of respectively obtaining the resources to be packaged corresponding to each platform, it is specifically used to: for a single platform, respectively obtain the resources to be packaged corresponding to each entry to be constructed; Correspondingly, when the product construction module starts multiple Webpacks, independently packages the resources to be packaged corresponding to each platform, and obtains the resource construction products corresponding to different platforms, it is specifically used for: Start multiple Webpacks in parallel, one Webpack for each platform; For a single platform, the Webpack corresponding to the platform is used to package the resources to be packaged corresponding to each entry to be built, so as to obtain resource construction products corresponding to different entries to be built under the platform.
[0067] Optionally, in some of the embodiments, when the product construction module executes the step of respectively acquiring the resources to be packaged corresponding to each platform, it is specifically used to: Develop the resources to be packaged for each platform separately, and determine whether the resources to be packaged are common resources during the development process; If the resource to be packaged is a common resource, the resource to be packaged is obtained from the developed resources through resource reference.
[0068] Optionally, in some of the embodiments, a plurality of platform-private resources corresponding to different platforms are embedded in the general resource, and the platform-private resources corresponding to different platforms have different resource names; Correspondingly, when the product construction module starts multiple Webpacks, independently packages the resources to be packaged corresponding to each platform, and obtains the resource construction products corresponding to different platforms, it is specifically used for: Start multiple Webpacks in parallel, and configure the target private resource name for each Webpack according to the platform corresponding to each Webpack to determine the target private resource name that each Webpack will package; Through each Webpack, the resources to be packaged corresponding to each platform are packaged independently in parallel; In the process of resource packaging, for common resources, each Webpack selects target private resources from common resources according to their own target private resource names, and packages the resources based on the selected target private resources.
[0069] The data processing device of this embodiment is used to implement the corresponding data processing method in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here. In addition, the functional implementation of each module in the data processing device of this embodiment can refer to the description of the corresponding part in the above-mentioned method embodiment, which will not be described in detail here.
[0070] Reference Figure 7, shows a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.
[0071] like Figure 7 As shown, the electronic device may include: a processor (processor) 702 , a communication interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .
[0072] in: The processor 702 , the communication interface 704 , and the memory 706 communicate with each other via a communication bus 708 .
[0073] The communication interface 704 is used to communicate with other electronic devices.
[0074] The processor 702 is used to execute the program 710, and specifically can execute the relevant steps in the above data processing method embodiment.
[0075] Specifically, the program 710 may include program codes, which include computer operation instructions.
[0076] The processor 702 may be a CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0077] The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0078] The program 710 may include multiple computer instructions. Specifically, the program 710 may enable the processor 702 to execute operations corresponding to the method described in any of the aforementioned method embodiments through the multiple computer instructions.
[0079] The specific implementation of each step in program 710 can refer to the corresponding description of the corresponding steps and units in the above method embodiment, and has corresponding beneficial effects, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above method embodiment, which will not be repeated here.
[0080] The present application also provides a computer storage medium on which a computer program is stored, and when the program is executed by a processor, the method described in any of the above-mentioned multiple method embodiments is implemented. The computer storage medium includes, but is not limited to: a compact disc read-only memory (CD-ROM), a random access memory (RAM), a floppy disk, a hard disk, or a magneto-optical disk, etc.
[0081] An embodiment of the present application also provides a computer program product, including computer instructions, which instruct a computing device to execute operations corresponding to any one of the above-mentioned multiple method embodiments.
[0082] In addition, it should be noted that the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data used to train the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0083] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0084] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA)). It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component (e.g., a random access memory (RAM), a read-only memory (ROM), a flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor, or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the method shown herein.
[0085] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
[0086] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.
Claims
1. A data processing method, applied to a client device, comprising: In response to the user's access operation to the target portal, a preset callback function is called, and the target platform information corresponding to the client device is transmitted through the callback function; Determine the target identification information according to the target platform information and the mapping relationship between the platform information and the identification information of the resource construction product, determine the target resource construction product from the multiple resource construction products according to the target identification information, and perform an access response based on the target resource construction product; Among them, the multiple resource construction products are multiple resource data pre-constructed for the same target entrance, and one resource data corresponds to one platform.
2. The method according to claim 1, wherein: The step of determining a target resource construction product from a plurality of resource construction products according to the target identification information, and performing an access response based on the target resource construction product includes: Sending the target identification information to the server device, so that the server device compares the target identification information with identification information of multiple resource construction products, and determines the target resource construction product from the multiple resource construction products; Receive and display access response data returned by the server device, wherein the access response data is obtained based on the target resource construction product.
3. The method according to claim 1, wherein: The method further comprises: For the entry to be built for the product to be built, count the platforms involved in the entry to be built; Get the resources to be packaged corresponding to each platform respectively; Start multiple Webpacks to independently package the resources to be packaged corresponding to each platform, and obtain resource construction products corresponding to different platforms; one Webpack is used to independently package the resources to be packaged corresponding to one platform; According to the platform information corresponding to each platform, identification information is allocated to the resource construction product corresponding to each platform to build a mapping relationship between the platform information and the identification information of the resource construction product.
4. The method according to claim 3, wherein: There are multiple entries to be constructed, and obtaining the resources to be packaged corresponding to each platform respectively includes: For a single platform, obtain the resources to be packaged corresponding to each entry to be built; The multiple Webpacks are started to independently package the resources to be packaged corresponding to each platform, and the resource construction products corresponding to different platforms are obtained, including: Start multiple Webpacks in parallel, one Webpack for each platform; For a single platform, the Webpack corresponding to the platform is used to package the resources to be packaged corresponding to each entry to be built, so as to obtain resource construction products corresponding to different entries to be built under the platform.
5. The method according to claim 3, wherein: The step of respectively obtaining the resources to be packaged corresponding to each platform includes: Develop the resources to be packaged for each platform separately, and determine whether the resources to be packaged are common resources during the development process; If the resource to be packaged is a general resource, the resource to be packaged is obtained from the developed resources by resource reference.
6. The method according to claim 5, wherein: The general resource contains multiple platform-private resources corresponding to different platforms, and the platform-private resources corresponding to different platforms have different resource names; The multiple Webpacks are started to independently package the resources to be packaged corresponding to each platform, and the resource construction products corresponding to different platforms are obtained, including: Start multiple Webpacks in parallel, and configure the target private resource name for each Webpack according to the platform corresponding to each Webpack to determine the target private resource name that each Webpack will package; Through each Webpack, the resources to be packaged corresponding to each platform are packaged independently in parallel; In the process of resource packaging, for common resources, each Webpack selects target private resources from the common resources according to the names of their respective target private resources, and performs resource packaging based on the selected target private resources.
7. A data processing device, comprising: A callback module, used to call a preset callback function in response to a user's access operation to a target portal, and transmit target platform information corresponding to the client device through the callback function; An identification information determination module, used to determine target identification information according to the target platform information and the mapping relationship between the platform information and the identification information of the resource construction product, so as to determine the target resource construction product from multiple resource construction products according to the target identification information, and perform an access response based on the target resource construction product; Among them, the multiple resource construction products are multiple resource data pre-constructed for the same target entrance, and one resource data corresponds to one platform.
8. An electronic device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method according to any one of claims 1 to 6.
9. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising computer instructions, wherein the computer instructions instruct a computing device to perform operations corresponding to the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Micro service servitization application system
CN107193546A
Method and device for presenting entry information, medium and program product
CN113709146A
Packing method and device based on front-end item and computer equipment
CN116954695A
Page display method and device and computer storage medium
CN118193100A
Page file construction method and device, page display method and device, equipment and storage medium
CN118210999A