A cache method and device of a single-page multi-column interactive component

By receiving and managing parameters of interactive events, a component caching method for multi-column layouts on tablet computers was implemented, solving the problem of not being able to update displayed content in existing technologies. This enabled interaction and partial content replacement in multi-column layouts, meeting the interaction needs of tablet computers.

CN119668753BActive Publication Date: 2025-12-09AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411741662.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-12-09
Estimated Expiration
2044-11-29

Smart Images

  • Figure CN119668753B_ABST
    Figure CN119668753B_ABST
Patent Text Reader

Abstract

The application discloses a single-page multi-column interactive component caching method and device, which comprises the following steps: receiving a first interactive parameter of an interactive event, and judging whether the type of the first interactive parameter is a preset type; if yes, marking a jump component name corresponding to the first interactive parameter as a target, and obtaining an index of the target in a component record array; when the index is a preset threshold, placing the target at the last component in the component record array, and detecting whether the interactive event receives a second interactive parameter; if yes, setting a preset parameter as the second interactive parameter, and executing a first operation process; when the index is not the preset threshold, judging whether the target and a value corresponding to the last component in the component record array are consistent; if consistent, setting an update identifier corresponding to the interactive event as true, and executing a second operation process. Thus, the interactive jump demand of any mobile terminal can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a caching method and apparatus for a single-page multi-column interactive component. Background Technology

[0002] With the continuous development of information technology, it has penetrated deeply into our daily lives. The widespread adoption of the internet and mobile devices has not only enriched people's lives but also provided greater convenience. Mobile devices, such as mobile phones and tablets, have become an indispensable part of modern life. Among these devices, tablets, due to their larger screens, are particularly suitable for handling tasks such as applications and approvals. Furthermore, with the increasing popularity of landscape mode on tablets, user interface (UI) design tends to adopt multi-column layouts to fully utilize screen space and better suit the usage habits of mobile devices: the page does not refresh when navigating forward and remains unchanged when navigating backward. Therefore, each column layout on a tablet needs to maintain this characteristic to facilitate interaction between them.

[0003] In existing technologies, guard functions provided by VueRouter are mainly used to record relevant information when navigating between routes or pages. However, guard functions are only suitable for mobile devices or single-page displays of a single component. For tablet devices with multi-column layouts, it is necessary to update the display content of a certain column without changing the route, and also to cache the component. Therefore, guard functions cannot meet the interactive navigation requirements of tablet devices. Summary of the Invention

[0004] In view of the shortcomings of the prior art, this application provides a caching method and apparatus for single-page multi-column interactive components to solve the problem that the prior art cannot meet the interactive navigation requirements of tablet computers (Pads).

[0005] To achieve the above objectives, this application provides the following technical solution:

[0006] The first aspect of this application provides a caching method for a single-page, multi-column interactive component, including:

[0007] Receive the first interaction parameter of the interaction event, and determine whether the type of the first interaction parameter is a preset type;

[0008] If the type of the first interaction parameter is determined to be a preset type, then the jump component name corresponding to the first interaction parameter is marked as the target, and the index of the target in the component record array is obtained;

[0009] when the index is a preset threshold value, placing the target at the last one in the component record array, and detecting whether the interaction event receives a second interaction parameter;

[0010] if the interaction event receives the second interaction parameter, setting a preset parameter as the second interaction parameter, and executing a first operation process;

[0011] when the index is not the preset threshold value, judging whether the target is consistent with a value corresponding to the last component in the component record array;

[0012] if the target is consistent with the value corresponding to the last component in the component record array, setting an update identifier corresponding to the interaction event as true, and executing a second operation process;

[0013] wherein the first operation process comprises:

[0014] updating the parameter record object based on the preset parameter;

[0015] when the updating is successful, judging whether the target has been globally registered;

[0016] if the target has been globally registered, setting a value corresponding to a dynamic component of the interaction event as the target according to the update identifier corresponding to the interaction event;

[0017] the second operation process comprises:

[0018] deleting record information after the index from the component record array;

[0019] detecting whether the update identifier corresponding to the interaction event is true after being updated as an update identifier corresponding to a target interaction event;

[0020] if the update identifier corresponding to the interaction event is true after being updated as the update identifier corresponding to the target interaction event, setting an object attribute corresponding to the preset parameter as true, and executing the first operation process;

[0021] if the update identifier corresponding to the interaction event is not true after being updated as the update identifier corresponding to the target interaction event, searching for related information corresponding to the target from the parameter record object;

[0022] setting a preset parameter as the related information, and executing the first operation process.

[0023] Optionally, in the single-page multi-column interaction component caching method, after judging whether the first interaction parameter is a preset type, the method further comprises:

[0024] If the type of the first interaction parameter is a non-pre-set type, the interactive event is subjected to a fallback jump processing, and it is determined whether the length of the component record array is greater than a pre-set threshold value;

[0025] If the length of the component record array is greater than the pre-set threshold value, the value corresponding to the second-to-last component in the component record array is assigned to the jump component name corresponding to the first interaction parameter;

[0026] If the length of the component record array is not greater than the pre-set threshold value, a pre-set component name is added to the first position in the component record array, and the pre-set component name is assigned to the jump component name corresponding to the first interaction parameter.

[0027] Optionally, in the single-page multi-column interactive component caching method described above, after detecting whether the interactive event receives a second interaction parameter, the method further includes:

[0028] If the interactive event does not receive a second interaction parameter, a pre-set parameter is set to an empty object, and the first operation process is executed.

[0029] Optionally, in the single-page multi-column interactive component caching method described above, after determining whether the target is consistent with the value corresponding to the last component in the component record array, the method further includes:

[0030] If the target is not consistent with the value corresponding to the last component in the component record array, it is detected whether the interactive event receives a second interaction parameter;

[0031] If the interactive event does not receive a second interaction parameter, the relevant information corresponding to the target is searched from the parameter record object, and the record information after the index in the component record array is deleted;

[0032] A pre-set parameter is set to the relevant information, and the first operation process is executed;

[0033] If the interactive event receives a second interaction parameter, it is determined whether the value corresponding to a first target parameter in the second interaction parameter is true;

[0034] If the value corresponding to the first target parameter in the second interaction parameter is true, the update identifier corresponding to the interactive event is set to true, and the second operation process is executed;

[0035] If the value corresponding to the first target parameter in the second interaction parameter is not true, it is determined whether the value corresponding to a second target parameter in the second interaction parameter is true;

[0036] If a value corresponding to a second target parameter in the second interaction parameter is true, an update identifier corresponding to the interaction event is updated to an update identifier corresponding to a target interaction event;

[0037] If the value corresponding to the second target parameter in the second interaction parameter is not true, the second operation process is executed.

[0038] Optionally, in the single-page multi-column interaction component caching method described above, after the update is successful, the method further includes:

[0039] If the target has not been globally registered, the target is asynchronously registered in a global component;

[0040] After the asynchronous global registration component is completed, a value corresponding to a dynamic component of the interaction event is set to the target according to an update identifier corresponding to the interaction event.

[0041] Optionally, in the single-page multi-column interaction component caching method described above, the setting of the value corresponding to the dynamic component of the interaction event to the target according to the update identifier corresponding to the interaction event includes:

[0042] It is determined whether the update identifier is true;

[0043] If the update identifier is true, the target is deleted from the component record array, and a value corresponding to a dynamic component attribute of the interaction event is set to null;

[0044] Based on the set dynamic component attribute, a target function is executed to set a value corresponding to the dynamic component attribute to the target in a registration function;

[0045] If the update identifier is not true, the value corresponding to the dynamic component of the interaction event is set to the target.

[0046] Optionally, in the single-page multi-column interaction component caching method described above, the updating of the parameter record object based on the preset parameter includes:

[0047] When the preset parameter is a null object, the parameter record object is updated to the null object;

[0048] When the preset parameter is related information, the parameter record object is updated to the related information;

[0049] When the preset parameter is the second interaction parameter, the parameter record object is updated to the second interaction parameter.

[0050] The second aspect of the application provides a single-page multi-column interactive component caching device, comprising:

[0051] A type judging unit is configured to receive a first interaction parameter of an interaction event and judge whether the type of the first interaction parameter is a preset type;

[0052] An index obtaining unit is configured to mark a target as the first interaction parameter corresponding jump component name if it is judged that the type of the first interaction parameter is the preset type, and obtain the index of the target in a component record array;

[0053] A parameter detecting unit is configured to place the target at the last one in the component record array when the index is a preset threshold value, and detect whether a second interaction parameter is received by the interaction event;

[0054] A first executing unit is configured to set a preset parameter as the second interaction parameter and execute a first operation process if it is detected that the second interaction parameter is received by the interaction event;

[0055] A numerical value judging unit is configured to judge whether the target and the numerical value corresponding to the last component in the component record array are consistent when the index is a non-preset threshold value;

[0056] A second executing unit is configured to set an update identifier corresponding to the interaction event as true and execute a second operation process if the target and the numerical value corresponding to the last component in the component record array are consistent;

[0057] The first executing unit comprises:

[0058] An object updating unit is configured to update the parameter record object based on the preset parameter;

[0059] A registration judging unit is configured to judge whether the target has been globally registered after the update is successful;

[0060] A numerical value setting unit is configured to set the numerical value corresponding to the dynamic component of the interaction event as the target according to the update identifier corresponding to the interaction event if the target has been globally registered;

[0061] The second executing unit comprises:

[0062] An information deleting unit is configured to delete the record information after the index in the component record array;

[0063] An identifier detecting unit is configured to detect whether the update identifier corresponding to the interaction event is true as the update identifier corresponding to the target interaction event;

[0064] The first setting unit is configured to set an object attribute corresponding to the preset parameter as true and execute the first operation process if an update identifier corresponding to the interaction event is updated as true for an update identifier corresponding to a target interaction event.

[0065] The information searching unit is configured to search for relevant information corresponding to the target from a parameter record object if the update identifier corresponding to the interaction event is updated as not true for the update identifier corresponding to the target interaction event.

[0066] The second setting unit is configured to set a preset parameter as the relevant information and execute the first operation process.

[0067] Optionally, in the single-page multi-column interactive component caching apparatus, the apparatus further includes:

[0068] The processing unit is configured to perform rollback jump processing on the interaction event if the type of the first interaction parameter is not a preset type, and determine whether a length of a component record array is greater than a preset threshold.

[0069] The assignment unit is configured to assign a value corresponding to a penultimate component in the component record array to a jump component name corresponding to the first interaction parameter if the length of the component record array is greater than the preset threshold.

[0070] The adding unit is configured to add a preset component name to a first position in the component record array and assign the preset component name to the jump component name corresponding to the first interaction parameter if the length of the component record array is not greater than the preset threshold.

[0071] Optionally, in the single-page multi-column interactive component caching apparatus, the apparatus further includes:

[0072] The third setting unit is configured to set a preset parameter as an empty object and execute the first operation process if the interaction event does not receive a second interaction parameter.

[0073] Optionally, in the single-page multi-column interactive component caching apparatus, the apparatus further includes:

[0074] The first detection unit is configured to detect whether the interaction event receives a second interaction parameter if the target is inconsistent with a value corresponding to a last component in the component record array.

[0075] The searching unit is configured to search for relevant information corresponding to the target from the parameter record object and delete record information after the index from the component record array if the interaction event does not receive the second interaction parameter.

[0076] A fourth setting unit is configured to set a preset parameter as the related information and execute the first operation process.

[0077] A first judging unit is configured to judge whether a value corresponding to a first target parameter in the second interaction parameter is true if the interaction event receives the second interaction parameter.

[0078] A fifth setting unit is configured to set an update identifier corresponding to the interaction event as true and execute the second operation process if the value corresponding to the first target parameter in the second interaction parameter is true.

[0079] A second judging unit is configured to judge whether a value corresponding to a second target parameter in the second interaction parameter is true if the value corresponding to the first target parameter in the second interaction parameter is not true.

[0080] A first updating unit is configured to update an update identifier corresponding to the interaction event as an update identifier corresponding to a target interaction event if the value corresponding to the second target parameter in the second interaction parameter is true.

[0081] A third executing unit is configured to execute the second operation process if the value corresponding to the second target parameter in the second interaction parameter is not true.

[0082] Optionally, in the cache device of the single-page multi-column interaction component, the cache device further comprises:

[0083] A registering unit is configured to asynchronously globally register the component for the target if the target is not globally registered.

[0084] A sixth setting unit is configured to set a value corresponding to a dynamic component of the interaction event as the target according to an update identifier corresponding to the interaction event after the asynchronous global registration component is completed.

[0085] Optionally, in the cache device of the single-page multi-column interaction component, the value setting unit comprises:

[0086] A second judging unit is configured to judge whether the update identifier is true.

[0087] A deleting unit is configured to delete the target from the component record array and set a value corresponding to a dynamic component attribute of the interaction event as null if the update identifier is true.

[0088] A fourth executing unit is configured to execute a target function based on the set dynamic component attribute to set a value corresponding to the dynamic component attribute as the target in a registration function.

[0089] A seventh setting unit is configured to set a value corresponding to the dynamic component of the interaction event to the target if the update identifier is not true.

[0090] Optionally, in the cache device of the single-page multi-column interactive component, the object updating unit comprises:

[0091] A second updating unit is configured to update the parameter record object to the empty object when the preset parameter is the empty object.

[0092] A third updating unit is configured to update the parameter record object to the related information when the preset parameter is the related information.

[0093] A fourth updating unit is configured to update the parameter record object to the second interaction parameter when the preset parameter is the second interaction parameter.

[0094] The cache method of the single-page multi-column interactive component provided by the present application comprises the following steps: receiving a first interaction parameter of an interaction event, judging whether the type of the first interaction parameter is a preset type, marking a jump component name corresponding to the first interaction parameter as a target if the type of the first interaction parameter is the preset type, obtaining an index of the target in a component record array, placing the target at the last component in the component record array when the index is a preset threshold, detecting whether the interaction event receives a second interaction parameter, setting a preset parameter to the second interaction parameter if the interaction event receives the second interaction parameter, and executing a first operation process, judging whether a value corresponding to the target and a value corresponding to the last component in the component record array are consistent when the index is not the preset threshold, setting an update identifier corresponding to the interaction event to true if the value corresponding to the target and the value corresponding to the last component in the component record array are consistent, and executing a second operation process. Thus, the display components in each column are cached respectively to achieve the effect of forward refreshing and backward non-refreshing, and the interaction between the columns is also supported, thereby meeting the needs of multi-column layout of a page and on-demand replacement of local content. BRIEF DESCRIPTION OF DRAWINGS

[0095] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of the provided drawings.

[0096] Figure 1 A flowchart of the cache method of the single-page multi-column interactive component provided by the present application;

[0097] Figure 2A structural schematic diagram of an interaction process of a cache method of a single-page multi-column interaction component is provided for an embodiment of the present application.

[0098] Figure 3 A flowchart of an interaction method of an interaction event is provided for another embodiment of the present application.

[0099] Figure 4 A flowchart of an execution method of a first operation flow is provided for an embodiment of the present application.

[0100] Figure 5 A flowchart of a global registration method of a component is provided for another embodiment of the present application.

[0101] Figure 6 A flowchart of an interaction method of a single-page multi-column interaction component is provided for another embodiment of the present application.

[0102] Figure 7 A flowchart of an interaction method of a target component is provided for another embodiment of the present application.

[0103] Figure 8 An execution second operation flowchart of a second operation flow is provided for an embodiment of the present application.

[0104] Figure 9 A structural schematic diagram of a cache device of a single-page multi-column interaction component is provided for another embodiment of the present application. DETAILED DESCRIPTION

[0105] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0106] In the present application, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms “include”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement “including a…” does not exclude the presence of another identical element in the process, method, article or device including the element.

[0107] The embodiment of the application provides a single-page multi-column interactive component caching method, as shown in the accompanying drawings, and specifically comprises the following steps: Figure 1

[0108] S101, receive the first interaction parameter of the interaction event, and judge whether the type of the first interaction parameter is a preset type.

[0109] It should be noted that the embodiment of the application is based on the vue framework to achieve the purpose of not refreshing the forward, refresh and back of the mobile terminal, therefore in the vue framework, each column can be regarded as an independent component, and each component is wrapped by KeepAlive to display the component. Then, the dynamic component is used to control the display and hiding of the wrapped component, and the code is as shown below.

[0110] <keep-alive:include="keepComponentList">

[0111] <component:is="currentComp":params="otherParams"@change="func1" / >

[0112] .

[0113] In addition, the columns can be connected through the Event Bus (event bus) in the vue framework, wherein the EventBus is a design pattern for processing events and message transmission in an application, and then a publish-subscribe model is adopted, and when registering each column component, the column name and the component name subscribed by the source need to be indicated. Therefore, the name of each column component needs to be unique in the page. In order to enable the dynamically displayed component to obtain the parameters transmitted by the event, the embodiment of the application utilizes the $attrs attribute provided by Vue, which can receive all parameter information that is not defined in the component props attribute. Therefore, only the parameter information transmitted by the event needs to be placed in an object, and then the object is transmitted when the dynamic component is defined, so that the component displayed by the dynamic component can access the object through $attrs. For example, as shown in the above code, the params parameter is used to receive the parameter information transmitted by the event, and the otherParams parameter received by the params parameter is an object type, and the interaction process of the whole scheme is as shown in the accompanying drawings. Specifically, Figure 2 Figure 2 ​​The change event thrown in the middle refers to the interaction event between columns, which is used to affect the components to be displayed in the column. The event name thrown will be the component name defined when the component is used + Change, so in order to make the component name well recorded so that each column can use it at will, the embodiment of the application also pre-provides a registration rule of the component name, that is, the folder name to which the component belongs in the project is added to the file name of the component to name in the form of camel case. Similarly, as shown in the above code, the change event is also registered in the dynamic component, which is used to respond to the corresponding event thrown by the display component in the column component.

[0114] In addition, in the embodiment of the application, it is also necessary to judge whether the type of the received first interaction parameter is a preset type, that is, a string type, because if the type is not checked in advance, the program may throw an error or return an incorrect result in the subsequent process, so if the type of the first interaction parameter is the preset type, it means that it meets the execution requirements of the subsequent program, so step S102 is executed.

[0115] Alternatively, when the type of the first interaction parameter is not the preset type, the interaction event needs to be rolled back, so that the interaction event can then implement the jump interaction, so after step S101 is executed, another embodiment of the application also provides an interaction method of an interaction event, as shown in Figure 3 The method comprises the following steps:

[0116] S301, if the type of the first interaction parameter is not the preset type, the interaction event is rolled back, and it is judged whether the length of the component record array is greater than a preset threshold.

[0117] It should be noted that in the actual use scenario of the mobile terminal, not every return operation wants to directly return to the operation interface of the last step. For example, after successfully creating an application form, it is desired to directly return to the application list page instead of the last step of the application operation. At this time, if the component name is directly changed to the component corresponding to the application list, the component data corresponding to the application step will be kept by the KeepAlive component all the time, and when the application operation component is entered again, the data will be directly displayed as the last filled content. Therefore, the embodiment of the present application needs to use the include attribute provided by the KeepAlive component to declare the component list that needs to keep the data. For example, according to the code provided in step S101, the keepComponentList attribute transmitted by the include parameter is an array type, which is used to save the browsing record of the current column. When the change event is received, the array content will be changed according to the component name transmitted by the change event. The general logic of the change is as follows: when the change event does not transmit the component name, that is, when the type of the first interaction parameter is not the preset type, it means that the user does not explicitly specify the target component to be jumped or operated, so in this case, the system will "back to the last step", which usually means that it may return to the previous page or restore to the previous state. If it involves multiple layers of nested pages or components, it may also mean returning to the previous interface or a certain historical state. Next, the system will judge the length of the current component record array to know the hierarchical depth of the current component or page, or determine how many components / pages the user has operated, that is, by judging whether the array length is greater than a preset threshold, so if the length of the component record array is greater than the preset threshold, it means that the user or the system has performed multiple switching or jumping between components, and step S302 is executed. If the length of the component record array is not greater than the preset threshold, it means that the user or the system has not performed multiple switching or jumping between components, and step S303 is executed.

[0118] S302, assign the value corresponding to the second last component in the component record array to the jump component name corresponding to the first interaction parameter.

[0119] Specifically, when the length of the component record array is greater than the preset threshold, the value corresponding to the second last component in the component record array needs to be assigned to the jump component name corresponding to the first interaction parameter, because the value corresponding to the second last component represents the step that the user just left, which may be the target that the system wants the user to jump to. For example, when filling out a form, the user fills out a series of steps, and if directly jumps to the last step, the context information may be lost.

[0120] S303, add the preset component name to the first position in the component record array, and assign the preset component name to the jump component name corresponding to the first interaction parameter.

[0121] Specifically, when the length of the component record array is not greater than the preset threshold, the preset component name needs to be added to the first position in the component record array, that is, the "empty data" component name is inserted into the first position in the component record array, so as to ensure that the mobile terminal can continue to interact from the correct starting point, and then the "empty data" component name is given to the jump component name corresponding to the first interaction parameter, which means that the system instructs the mobile terminal to jump to the preset starting component next.

[0122] S102, mark the jump component name corresponding to the first interaction parameter as the target, and obtain the index of the target in the component record array.

[0123] It should be noted that when the first interaction parameter is a preset parameter, the jump component name corresponding to the first interaction parameter needs to be marked as the target, so that the system can clearly know the current position of the component of the mobile terminal interaction event, and then the index of the target in the component record array is obtained, and the index is marked, so as to allow the system to accurately find the position of the interaction event.

[0124] S103, when the index is a preset threshold, place the target at the last one in the component record array, and detect whether the interaction event receives a second interaction parameter.

[0125] It should be noted that in order to know whether the interaction event exists in the component record array, the index of the interaction event needs to be obtained again, and it is judged whether the index is a preset threshold. When the index is a preset threshold, it means that the interaction event does not exist in the component record array, so the interaction event needs to be treated as a newly added component, that is, the target is placed at the last one in the component record array, and then it is detected whether the interaction event receives a second interaction parameter. Because the interaction event may contain multiple parameters, which represent different interaction information (for example, the position, time, additional state information, etc. of the click event), if the second parameter is missing, it may mean that the event has not been completely triggered or some expected information has not been transmitted, thereby affecting the subsequent logic processing. Therefore, if the interaction event receives the second interaction parameter, it means that the interaction event has been completely triggered, so step S104 is executed.

[0126] In addition, when the index is not a preset threshold, it means that the interaction event exists in the component record array, so step S105 is executed.

[0127] Optionally, the preset threshold is -1, but it can also be other thresholds, which can be set according to requirements.

[0128] Optionally, after step S103, further comprising:

[0129] If the second interaction parameter is not received by the interaction event, the preset parameter is set as an empty object, and the first operation process is executed.

[0130] It can be understood that when the second interaction parameter is not received by the interaction event, it means that the interaction event is not completely triggered or some expected information is not transmitted, at this time, the preset parameter needs to be set as an empty object, that is, the otherParams in the vue framework is set as an empty object, which ensures that the parameter always has a default value, avoids errors that may occur when no parameter is transmitted, and then the first operation process is executed. The first operation process is steps S401-S403, which will not be described here.

[0131] S104, set the preset parameter to the second interaction parameter, and execute the first operation process.

[0132] It should be noted that when the second interaction parameter is received by the interaction event, the otherParams needs to be set as the second interaction parameter, so that the otherParams can transmit parameters, ensure the interaction of the interaction event, and then execute the subsequent first operation process. The preset parameter is otherParams.

[0133] Optionally, in another embodiment of the present application, another specific implementation of executing the first operation process in step S104 includes the following steps as shown in Figure 4

[0134] S401, update the parameter record object based on the preset parameter.

[0135] It should be noted that the parameter record object is the paramsHistory attribute, which is an object type with the component name as the key value, and is used to record the parameter information transmitted when each component is displayed. Therefore, when the otherParams has a specific parameter value, the value of the paramsHistory attribute needs to be updated, so as to ensure the correctness of the parameters of the component corresponding to the interaction event.

[0136] The otherParams is the preset parameter.

[0137] Optionally, in another embodiment of the present application, another specific implementation of step S401 includes the following steps:

[0138] When the preset parameter is an empty object, the parameter record object is updated as an empty object.

[0139] ​Specifically, when the value corresponding to otherParams is an empty object, the value corresponding to the paramsHistory attribute is updated to be an empty object.

[0140] When the preset parameter is the related information, the parameter record object is updated to be the related information.

[0141] In addition, when the value corresponding to otherParams is the related information in the component record array, the value corresponding to the paramsHistory attribute is updated to be the related information.

[0142] When the preset parameter is the second interaction parameter, the parameter record object is updated to be the second interaction parameter.

[0143] It can be understood that when the value corresponding to otherParams is the second interaction parameter, the value corresponding to the paramsHistory attribute is updated to be the second interaction parameter.

[0144] S402, when the update is successful, it is judged whether the target has been globally registered.

[0145] It should be noted that when the value corresponding to the paramsHistory attribute is updated successfully, it is further judged whether the target has been globally registered, so as to avoid conflicts or unexpected behaviors caused by repeated registration. Therefore, if the target has been globally registered, step S403 is executed.

[0146] Optionally, the target also exists in a situation that has not been globally registered. Therefore, in order to globally register the target in time, after step S402 is executed, another embodiment of the present application further provides a global registration method of a component, as shown in Figure 5 The method comprises the following steps:

[0147] S501, asynchronously globally registering the component for the target.

[0148] When the target has not been globally registered, the engineering of the component can be packaged by using webpack, and the asynchronous registration of the component can be performed by using the method as shown below.

[0149] Vue.component('component name', (resolve) => require(['address of the component vue file in the engineering'], resolve)).

[0150] S502, after the asynchronous global registration of the component is completed, the value corresponding to the dynamic component of the interaction event is set to be the target according to the update identifier corresponding to the interaction event.

[0151] It's important to note that because the component loads asynchronously, the value of the `is` attribute needs to be changed after the component file has finished loading and registering; otherwise, the page will display an error. In this case, the function defined in the following code within the column component can accomplish this.

[0152] cycleSearch(){

[0153] window.requestAnimationFrame(()=>{

[0154] if (this.$root.$options.components[component name]) { this.name = component name;} else { this.cycleSearch();}

[0155] })

[0156] }

[0157] The `if` statement utilizes the `$root` object provided by Vue, which is the root object created during project initialization using the `new Vue()` method. All globally registered components are placed in the `components` object of its `$options` property, using the component name as the key. Once an asynchronous component is detected as successfully registered, changing the value of the `is` property will update the content displayed in the current column. Using the `requestAnimationFrame` method provided by the `window` object allows the browser to call it automatically when idle, avoiding the missed pop-ups that can occur with timed tasks specified by the `setTimeout` method.

[0158] It should also be noted that the specific implementation of step S502 can be referred to step S403 in the following method embodiment, and will not be repeated here.

[0159] S403. Based on the update flag corresponding to the interaction event, set the value corresponding to the dynamic component of the interaction event to the target.

[0160] It should be noted that when the target has been registered globally, the is property of the dynamic component can be used to control the visibility of the component. The corresponding property value indicates the name of the component that needs to be displayed. Therefore, the value of the dynamic component corresponding to the interactive event needs to be set to the target in order to display the component corresponding to the interactive event, thereby achieving the effect of refreshing when moving forward and not refreshing when moving backward.

[0161] Alternatively, in another embodiment of this application, another specific implementation of step S403 is as follows: Figure 6 As shown, it includes the following steps:

[0162] S601, determine whether the update identifier is true.

[0163] It should be noted that in order to ensure that only in certain conditions can the component record array be executed delete operation and state update, therefore need to determine the update identifier corresponding to the interaction event is true, if the update identifier is true, it means that the component record array can be processed accordingly, so execute step S602. If the update identifier is true, it means that the component record array cannot be processed accordingly, so execute step S604.

[0164] S602, delete the target from the component record array, and set the value corresponding to the dynamic component attribute of the interaction event to null.

[0165] Specifically, when the update identifier is true, it means that the component record array needs to be deleted at this time, that is, the last component in the component record array, that is, the target, is deleted, and the value corresponding to the dynamic component attribute of the interaction event is set to null, so as to reset the state of the component and ensure that the component is in a clean initial state when it is rendered next time.

[0166] S603, based on the set dynamic component attribute, execute the target function to set the value corresponding to the dynamic component attribute to the target in the registered function.

[0167] It can be understood that after setting the dynamic component attribute, the forceUpdate method provided by Vue needs to be called to force the event already put into the browser microtask queue to be executed immediately (here, the logic in the KeepAlive component source code is involved, which performs dependency registration on the include attribute, and when the value of the include attribute changes, a microtask is inserted into the browser to clean up the cache data of the component not in its corresponding array), thereby clearing the cache data of the component in the KeepAlive component, and then using the requestAnimationFrame method provided by the window object to set the value corresponding to the dynamic component is attribute to the target, setting the name of the current component to the name passed in by the interaction event in the function called by it, and putting the name into the keepComponentList array at the end. At this time, since the KeepAlive component does not store the data of the corresponding component, it will consider that the component is displayed for the first time, and then create an instance corresponding to the component, and complete the refresh operation of the related content.

[0168] S604, set the value corresponding to the dynamic component of the interaction event to the target.

[0169] It can be understood that when the update identifier is not true, the value corresponding to the dynamic component of the interaction event needs to be set as the target, so that the name of the interaction event jump component can be displayed, thereby realizing the needs of multi-column layout of the page and on-demand replacement of local content.

[0170] S105, when the index is not the preset threshold value, judging whether the value corresponding to the last component in the component record array is consistent with the target.

[0171] It should be noted that when the index is not the preset threshold value, it means that the interaction event exists in the component record array, and at this time, it is necessary to further judge whether the value corresponding to the last component in the component record array is consistent with the target, so as to know whether the current interaction event has the same result or state as the previous interaction event. For example, the value of the component represents the state or output of an operation, and if the target value is consistent with the value of the last component, it may indicate that the user's operation has not changed (for example, the operation is repeated or the state is unchanged). Therefore, if the value corresponding to the last component in the component record array is consistent with the target, step S106 is executed.

[0172] Alternatively, the value corresponding to the last component in the component record array can also be inconsistent with the target. Therefore, in order to respond to the interaction of the mobile terminal and avoid affecting the user experience, after step S105 is executed, another embodiment of the present application further provides an interaction method of a target component, as shown in Figure 7 The method comprises the following steps:

[0173] S701, if the value corresponding to the last component in the component record array is inconsistent with the target, detecting whether the second interaction parameter is received by the interaction event.

[0174] Specifically, when the value corresponding to the last component in the component record array is inconsistent with the target, it is further necessary to detect whether the second interaction parameter is received by the interaction event, because the interaction event can contain multiple parameters, which represent different interaction information (for example, the click event can contain position, time, additional state information, etc.), and if the second parameter is missing, it can mean that the event is not completely triggered or some expected information is not transmitted, thereby affecting the subsequent logic processing. Therefore, if the second interaction parameter is received by the interaction event, it means that the interaction event has been completely triggered, and therefore step S704 is executed. If the second interaction parameter is not received by the interaction event, it means that the interaction event has not been completely triggered, and therefore step S702 is executed.

[0175] S702, finding the related information corresponding to the target from the parameter record object, and deleting the record information after the index from the component record array.

[0176] It can be understood that when the interaction event does not receive the second interaction parameter, at this time, the relevant information corresponding to the target in the paramsHistory attribute needs to be used as a reference to realize the interaction of the interaction event. The parameter record object is the paramsHistory attribute.

[0177] S703, set the preset parameter as the relevant information, and execute the first operation process.

[0178] Specifically, the otherParams is set as the relevant information corresponding to the target, and the first operation process is executed, wherein the first operation process is the above steps S401-S403, which will not be repeated here.

[0179] In addition, the preset parameter is otherParams.

[0180] S704, judge whether the value corresponding to the first target parameter in the second interaction parameter is true.

[0181] It should be noted that when the interaction event receives the second interaction parameter, it is necessary to judge whether the value corresponding to the needRefresh in the second interaction parameter is true, because the mobile terminal may want to refresh the data of the component when refreshing the page, so at this time, the value corresponding to the needRefresh is set to true, which means that the mobile terminal wants to refresh the data of the component, so if the value corresponding to the first target parameter in the second interaction parameter is true, it means that the mobile terminal wants to refresh the data of the component, so step S705 is executed. If the value corresponding to the first target parameter in the second interaction parameter is not true, it means that the mobile terminal does not want to refresh the data of the component, that is, the user does not want to refresh the data of the component, so step S706 is executed.

[0182] In addition, the first target parameter is needRefresh.

[0183] S705, set the update identifier corresponding to the interaction event to true, and execute the second operation process.

[0184] It can be understood that when the value corresponding to the first target parameter in the second interaction parameter is true, the update identifier corresponding to the interaction event needs to be set to true, and the second operation process is executed, so that the component can automatically refresh the data. The second operation process is the following steps S801-S805, which will not be repeated here.

[0185] S706, judge whether the value corresponding to the second target parameter in the second interaction parameter is true.

[0186] It should be noted that when the value corresponding to the first target parameter in the second interaction parameter is not true, it is necessary to determine whether needclear in the second interaction parameter is true. In order to ensure that the relevant data, state or context information is cleaned or reset in the interaction process, thereby helping to control the life cycle of the data, avoid repeated operations or state interference, and ensure that the system can correctly and efficiently proceed at each interaction stage, if the value corresponding to the second target parameter in the second interaction parameter is true, it indicates that some stored data, state or context information needs to be reset or cleared after the current interaction operation, and therefore step S707 is performed. If the value corresponding to the second target parameter in the second interaction parameter is not true, it indicates that some stored data, state or context information does not need to be reset or cleared after the current interaction operation, and therefore step S708 is performed.

[0187] S707, updating the update identifier corresponding to the interaction event to the update identifier corresponding to the target interaction event.

[0188] It can be understood that when the value corresponding to the second target parameter in the second interaction parameter is true, the update identifier corresponding to the interaction event needs to be updated to the update identifier corresponding to the target interaction event, so that the component corresponding to the current interaction event can be jumped to the component corresponding to the target interaction event, thereby completing the forward refresh. Wherein, the target interaction event refers to a new interaction event.

[0189] S708, performing a second operation process.

[0190] Specifically, when the value corresponding to the second target parameter in the second interaction parameter is not true, some data in the component record array needs to be cleaned or reset related data, and therefore the second operation process is performed. Wherein, the second operation process is steps S801-S805, which will not be repeated here.

[0191] S106, setting the update identifier corresponding to the interaction event to true, and performing a second operation process.

[0192] It should be noted that when the target and the value corresponding to the last component in the component record array are consistent, it indicates that the component record array needs to be cleaned to avoid repeated operations or state interference of the current interaction event, and therefore the update identifier corresponding to the interaction event needs to be set to true first, and then the cleaning process, that is, the second operation process, is performed.

[0193] Alternatively, in another embodiment of the present application, another specific implementation of performing the second operation process in step S106 includes the following steps as shown in Figure 8

[0194] ​S801, delete the record information after the index from the component record array.

[0195] Specifically, after clearing all data after the index in the component record array, the related information in the paramsHistory attribute also needs to be deleted, so that it can be determined that the data stored in the keepComponentList array is the component list that needs to be cached, that is, it can be determined that the target in the component record array is the component list that needs to be cached, thereby realizing the cache processing of each column display component respectively, and achieving the effect of forward refreshing and backward not refreshing.

[0196] S802, detect whether the update identifier corresponding to the interaction event is updated to the update identifier corresponding to the target interaction event is true.

[0197] It should be noted that after deleting the record information after the index in the component record array, it also needs to be noted that in the process of executing the current interaction event, new interaction events may be generated, so it is necessary to detect whether the interaction event needs to be updated or replaced by a new interaction event, and the system will also update the update identifier corresponding to the interaction event to the update identifier corresponding to the target interaction event. At this time, it can be known whether the interaction event needs to be updated or replaced by a new interaction event by detecting whether the update identifier corresponding to the interaction event is updated to the update identifier corresponding to the target interaction event is true. If the update identifier corresponding to the interaction event is updated to the update identifier corresponding to the target interaction event is true, it means that the interaction event needs to be updated or replaced by a new interaction event, so step S803 is executed. If the update identifier corresponding to the interaction event is updated to the update identifier corresponding to the target interaction event is not true, it means that the interaction event does not need to be updated or replaced by a new interaction event, so step S804 is executed.

[0198] S803, set the object attribute corresponding to the preset parameter to true, and execute the first operation process.

[0199] It can be understood that when the update identifier corresponding to the interaction event is updated to the update identifier corresponding to the target interaction event is true, the object attribute corresponding to otherParams is set to true, and the first operation process is executed, thereby completing the jump of the component. The first operation process is steps S401-S403 described above, which will not be described here.

[0200] S804, find the related information corresponding to the target from the parameter record object.

[0201] Specifically, when the update identifier corresponding to the interaction event is updated to false, the target corresponding information in the paramsHistory attribute needs to be used as a reference to achieve the interaction of the interaction event.

[0202] The parameter record object is the paramsHistory attribute.

[0203] S805, set the preset parameter as the related information, and execute the first operation process.

[0204] Specifically, otherParams is set as the target corresponding information, and the first operation process is executed, wherein the first operation process is steps S401-S403, which will not be described here.

[0205] The preset parameter is otherParams.

[0206] The application provides a single-page multi-column interaction component caching method, which receives a first interaction parameter of an interaction event, judges whether the type of the first interaction parameter is a preset type, if the type of the first interaction parameter is the preset type, marks a jump component name corresponding to the first interaction parameter as a target, obtains an index of the target in a component record array, when the index is a preset threshold, places the target at the last one in the component record array, detects whether the interaction event receives a second interaction parameter, if the interaction event receives the second interaction parameter, sets a preset parameter as the second interaction parameter, and executes a first operation process, when the index is not the preset threshold, judges whether the target and the value corresponding to the last component in the component record array are consistent, if the target and the value corresponding to the last component in the component record array are consistent, sets an update identifier corresponding to the interaction event as true, and executes a second operation process. Thus, each column display component is cached to achieve the effect of forward refreshing and backward non-refreshing, and mutual interaction between columns is supported, thereby realizing the needs of page multi-column layout and local content on-demand replacement.

[0207] Another embodiment of the application provides a single-page multi-column interaction component caching device, as shown in Figure 9 The device comprises the following units:

[0208] The type judging unit 901 is configured to receive a first interaction parameter of an interaction event, and judge whether the type of the first interaction parameter is a preset type.

[0209] The index obtaining unit 902 is configured to, if it is judged that the type of the first interaction parameter is the preset type, mark a jump component name corresponding to the first interaction parameter as a target, and obtain an index of the target in a component record array.

[0210] The parameter detection unit 903 is configured to place the target at the last component in the component record array when the index is the preset threshold value, and detect whether the interaction event receives the second interaction parameter.

[0211] The first execution unit 904 is configured to set the preset parameter as the second interaction parameter and execute the first operation process if the interaction event receives the second interaction parameter.

[0212] The numerical value judgment unit 905 is configured to judge whether the target and the numerical value corresponding to the last component in the component record array are consistent when the index is not the preset threshold value.

[0213] The second execution unit 906 is configured to set the update identifier corresponding to the interaction event as true and execute the second operation process if the target and the numerical value corresponding to the last component in the component record array are consistent.

[0214] The first execution unit 904 includes:

[0215] The object updating unit is configured to update the parameter record object based on the preset parameter.

[0216] The registration judgment unit is configured to judge whether the target has been globally registered after the update is successful.

[0217] The numerical value setting unit is configured to set the numerical value corresponding to the dynamic component of the interaction event as the target according to the update identifier corresponding to the interaction event if the target has been globally registered.

[0218] The second execution unit 906 includes:

[0219] The information deleting unit is configured to delete the record information after the index in the component record array.

[0220] The identifier detection unit is configured to detect whether the update identifier corresponding to the interaction event is true.

[0221] The first setting unit is configured to set the preset parameter as true and execute the first operation process if the update identifier corresponding to the interaction event is true.

[0222] The information finding unit is configured to find the related information corresponding to the target from the parameter record object if the update identifier corresponding to the interaction event is not true.

[0223] The second setting unit is configured to set the preset parameter as the related information and execute the first operation process.

[0224] It should be noted that the specific working process of the above-mentioned units in the embodiments of the present application can correspondingly refer to steps S101-S106 in the above-mentioned method embodiments, which will not be described here again.

[0225] Optionally, another embodiment of the present application provides a single-page multi-column interactive component caching device, further comprising:

[0226] The processing unit is configured to, if the type of the first interaction parameter is a non-pre-set type, perform a fallback jump processing on the interaction event, and determine whether the length of the component record array is greater than a pre-set threshold.

[0227] The assignment unit is configured to, if the length of the component record array is greater than the pre-set threshold, assign a value corresponding to a second-to-last component in the component record array to a jump component name corresponding to the first interaction parameter.

[0228] The adding unit is configured to, if the length of the component record array is not greater than the pre-set threshold, add a pre-set component name to a first position in the component record array, and assign the pre-set component name to the jump component name corresponding to the first interaction parameter.

[0229] Optionally, another embodiment of the present application provides a single-page multi-column interactive component caching device, further comprising:

[0230] The third setting unit is configured to, if the interaction event does not receive the second interaction parameter, set a pre-set parameter as an empty object, and execute a first operation process.

[0231] Optionally, another embodiment of the present application provides a single-page multi-column interactive component caching device, further comprising:

[0232] The first detection unit is configured to, if the target is inconsistent with a value corresponding to a last component in the component record array, detect whether the interaction event receives the second interaction parameter.

[0233] The finding unit is configured to, if the interaction event does not receive the second interaction parameter, find related information corresponding to the target from a parameter record object, and delete record information after an index from the component record array.

[0234] The fourth setting unit is configured to set the pre-set parameter as the related information, and execute the first operation process.

[0235] The first judgment unit is configured to, if the interaction event receives the second interaction parameter, determine whether a value corresponding to a first target parameter in the second interaction parameter is true.

[0236] The fifth setting unit is configured to, if the value corresponding to the first target parameter in the second interaction parameter is true, set an update identifier corresponding to the interaction event as true, and execute a second operation process.

[0237] The second judging unit is configured to judge whether the value corresponding to the second target parameter in the second interaction parameter is true if the value corresponding to the first target parameter in the second interaction parameter is not true.

[0238] The first updating unit is configured to update the update identifier corresponding to the interaction event to the update identifier corresponding to the target interaction event if the value corresponding to the second target parameter in the second interaction parameter is true.

[0239] The third executing unit is configured to execute the second operation flow if the value corresponding to the second target parameter in the second interaction parameter is not true.

[0240] Optionally, another embodiment of the single-page multi-column interaction component caching device provided by the present application further comprises:

[0241] The registering unit is configured to asynchronously globally register the component for the target if the target is not globally registered.

[0242] The sixth setting unit is configured to set the value corresponding to the dynamic component of the interaction event to the target according to the update identifier corresponding to the interaction event after the asynchronous global registration component is completed.

[0243] Optionally, another embodiment of the single-page multi-column interaction component caching device provided by the present application further comprises a value setting unit, which comprises:

[0244] The second judging unit is configured to judge whether the update identifier is true.

[0245] The deleting unit is configured to delete the target from the component record array and set the value corresponding to the dynamic component attribute of the interaction event to null if the update identifier is true.

[0246] The fourth executing unit is configured to execute the target function based on the set dynamic component attribute to set the value corresponding to the dynamic component attribute to the target in the registration function.

[0247] The seventh setting unit is configured to set the value corresponding to the dynamic component of the interaction event to the target if the update identifier is not true.

[0248] Optionally, another embodiment of the single-page multi-column interaction component caching device provided by the present application further comprises an object updating unit, which comprises:

[0249] The second updating unit is configured to update the parameter record object to the null object when the preset parameter is the null object.

[0250] The third updating unit is configured to update the parameter record object to the related information when the preset parameter is the related information.

[0251] The fourth updating unit is configured to update the parameter record object to the second interaction parameter when the preset parameter is the second interaction parameter.

[0252] It should be noted that the specific working process of each unit provided by the above embodiments of the present application can correspondingly refer to the corresponding steps in the above method embodiments, which will not be described here.

[0253] It should be further noted that the cache device of the single-page multi-column interaction component provided by the embodiments of the present application has the technical effects of any one of the above embodiments, and the embodiments of the present application will not be described here.

[0254] The skilled person can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general terms. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0255] The above description of the disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to the embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for caching a single-page multi-column interactive component, the method comprising: The application relates to a method for processing an interaction event, which comprises the following steps: receiving a first interaction parameter of an interaction event, and judging whether the type of the first interaction parameter is a preset type; if the type of the first interaction parameter is the preset type, marking a jump component name corresponding to the first interaction parameter as a target, and obtaining the index of the target in a component record array; when the index is a preset threshold value, placing the target at the last position in the component record array, and detecting whether the interaction event receives a second interaction parameter; if the interaction event receives the second interaction parameter, setting a preset parameter as the second interaction parameter, and executing a first operation process; when the index is not the preset threshold value, judging whether the target is consistent with the value corresponding to the last component in the component record array; if the target is consistent with the value corresponding to the last component in the component record array, setting the update identifier corresponding to the interaction event as true, and executing a second operation process; the first operation process comprises the following steps: updating a parameter record object based on the preset parameter; after successful updating, judging whether the target has been globally registered; if the target has been globally registered, setting the value corresponding to the dynamic component of the interaction event as the target according to the update identifier corresponding to the interaction event; the second operation process comprises the following steps: deleting the record information after the index in the component record array; detecting and updating the update identifier corresponding to the interaction event as the update identifier corresponding to the target interaction event; if the update identifier corresponding to the interaction event is updated as the update identifier true corresponding to the target interaction event, setting the object attribute corresponding to the preset parameter as true, and executing the first operation process; if the update identifier corresponding to the interaction event is not updated as the update identifier true corresponding to the target interaction event, searching the target corresponding related information from a parameter record object; setting a preset parameter as the related information, and executing the first operation process.

2. The method of claim 1, wherein, after judging whether the type of the first interaction parameter is the preset type, the method further comprises the following steps: if the type of the first interaction parameter is not the preset type, performing a rollback jump processing on the interaction event, and judging whether the length of the component record array is greater than a preset threshold value; if the length of the component record array is greater than the preset threshold value, assigning the value corresponding to the second last component in the component record array to the jump component name corresponding to the first interaction parameter; if the length of the component record array is not greater than the preset threshold value, adding a preset component name to the first position in the component record array, and assigning the preset component name to the jump component name corresponding to the first interaction parameter.

3. The method of claim 1, wherein, after detecting whether the interaction event receives the second interaction parameter, the method further comprises the following steps: if the interaction event does not receive the second interaction parameter, setting a preset parameter as an empty object, and executing the first operation process.

4. The method of claim 1, wherein, after judging whether the target is consistent with the value corresponding to the last component in the component record array, the method further comprises the following steps: If the target is inconsistent with the value corresponding to the last component in the component record array, it is detected whether the interaction event receives a second interaction parameter; If the interaction event does not receive a second interaction parameter, the relevant information corresponding to the target is found from the parameter record object, and the record information after the index in the component record array is deleted; A preset parameter is set as the relevant information, and the first operation process is executed; If the interaction event receives a second interaction parameter, it is judged whether the value corresponding to the first target parameter in the second interaction parameter is true; If the value corresponding to the first target parameter in the second interaction parameter is true, the update identifier corresponding to the interaction event is set to true, and the second operation process is executed; If the value corresponding to the first target parameter in the second interaction parameter is not true, it is judged whether the value corresponding to the second target parameter in the second interaction parameter is true; If the value corresponding to the second target parameter in the second interaction parameter is true, the update identifier corresponding to the interaction event is updated to the update identifier corresponding to the target interaction event; If the value corresponding to the second target parameter in the second interaction parameter is not true, the second operation process is executed.

5. The method of claim 1, wherein, After the update is successful, it is further judged whether the target has been globally registered. If the target has not been globally registered, the target is asynchronously globally registered as a component; After the asynchronous global registration of the component is completed, the value corresponding to the dynamic component of the interaction event is set to the target according to the update identifier corresponding to the interaction event.

6. The method according to claim 1 or 5, characterized in that, The value corresponding to the dynamic component of the interaction event is set to the target according to the update identifier corresponding to the interaction event, including: It is judged whether the update identifier is true; If the update identifier is true, the target is deleted from the component record array, and the value corresponding to the dynamic component attribute of the interaction event is set to null; Based on the set dynamic component attribute, the target function is executed to set the value corresponding to the dynamic component attribute to the target in the registration function; If the update identifier is not true, the value corresponding to the dynamic component of the interaction event is set to the target.

7. The method of claim 1, wherein, The parameter record object is updated based on the preset parameter, including: When the preset parameter is a null object, the parameter record object is updated to the null object; When the preset parameter is relevant information, the parameter record object is updated to the relevant information; When the preset parameter is the second interaction parameter, the parameter record object is updated to the second interaction parameter.

8. A caching device for a single-page multi-column interactive component, characterized in that, It includes: The type judgment unit is used for receiving the first interaction parameter of the interaction event, and judging whether the type of the first interaction parameter is a preset type; The index acquisition unit is used for marking the target as the target if it is judged that the type of the first interaction parameter is the preset type, and acquiring the index of the target in the component record array; The parameter detection unit is configured to place the target at the last position in the component record array when the index is a preset threshold value, and detect whether the interaction event receives a second interaction parameter; The first execution unit is configured to set a preset parameter as the second interaction parameter if the interaction event receives the second interaction parameter, and execute a first operation process; The numerical value judgment unit is configured to judge whether the target is consistent with a numerical value corresponding to a last component in the component record array when the index is not the preset threshold value; The second execution unit is configured to set an update identifier corresponding to the interaction event as true if the target is consistent with the numerical value corresponding to the last component in the component record array, and execute a second operation process; The first execution unit includes: The object update unit is configured to update a parameter record object based on the preset parameter; The registration judgment unit is configured to judge whether the target has been globally registered after the update is successful; The numerical value setting unit is configured to set a numerical value corresponding to a dynamic component of the interaction event as the target according to the update identifier corresponding to the interaction event if the target has been globally registered. The second execution unit includes: The information deletion unit is configured to delete record information after the index from the component record array; The identifier detection unit is configured to detect and update the update identifier corresponding to the interaction event as true for an update identifier corresponding to a target interaction event; The first setting unit is configured to set an object attribute corresponding to the preset parameter as true and execute the first operation process if the update identifier corresponding to the interaction event is updated as the update identifier corresponding to the target interaction event is true; The information search unit is configured to search for related information corresponding to the target from a parameter record object if the update identifier corresponding to the interaction event is updated as the update identifier corresponding to the target interaction event is not true; The second setting unit is configured to set a preset parameter as the related information and execute the first operation process.

9. The apparatus of claim 8, wherein, Further comprising: The processing unit is configured to perform a rollback jump processing on the interaction event if a type of the first interaction parameter is not a preset type, and judge whether a length of the component record array is greater than a preset threshold value; The assignment unit is configured to assign a numerical value corresponding to a second last component in the component record array to a jump component name corresponding to the first interaction parameter if the length of the component record array is greater than the preset threshold value; The adding unit is configured to add a preset component name to a first position in the component record array and assign the preset component name to the jump component name corresponding to the first interaction parameter if the length of the component record array is not greater than the preset threshold value.

10. The apparatus of claim 8, wherein, Further comprising: The third setting unit is configured to set a preset parameter as an empty object and execute the first operation process if the interaction event does not receive a second interaction parameter.

Citation Information

Patent Citations

  • Component rendering method and device, equipment and storage medium

    CN116185409A

  • Low-code platform page component configuration method and device

    CN117742834A