Worker-based front-end status data processing method, device and medium
By obtaining front-end status data in Redux and using the Worker environment for conditional judgment and processing, the problems of long front-end page response time and low efficiency are solved, and more efficient data processing is achieved.
Patent Information
- Application Number
- CN202510976783.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-16
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-07-16
AI Technical Summary
When processing front-end page data, the existing technology has a large amount of data and calculation, resulting in long response time, page freezes and low efficiency.
By obtaining the front-end state data and its description information in Redux, using the Worker operating environment to create a state management unit, the data volume and complexity are judged. If the conditions are not met, the data is processed in the Worker environment to reduce the main thread load through Redux.
It reduces the response time and freeze rate of the front-end page, and improves the efficiency of front-end status data processing.
Smart Images

Figure CN120492191B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a Worker-based front-end status data processing method, device, and medium. Background Art
[0002] Redux is a library for managing the state and logic of JavaScript applications. Redux can be used to develop predictable, testable, and debuggable applications. Redux can process front-end page data.
[0003] In the process of implementing the present invention, the inventors found that the existing technology has the following defects: At present, due to the large amount of data and computing power of front-end data, it is difficult for Redux to process the front-end page data, which can easily cause long response time and lag of the front-end page, and the efficiency is relatively low. Summary of the Invention
[0004] The present invention provides a Worker-based front-end status data processing method, device, and medium to reduce the front-end page response time and the number of front-end page freezes, thereby improving the efficiency of front-end status data processing.
[0005] According to one aspect of the present invention, a front-end status data processing method based on Worker is provided, wherein the method is executed by a front-end status data processing controller and includes:
[0006] In Redux, get the current pending front-end state data and the front-end state data description information corresponding to the current pending front-end state data;
[0007] The front-end state data description information includes the front-end state data volume and the front-end state data processing complexity; the front-end state data processing controller interacts with Redux for data; the front-end state data processing controller interacts with the Worker runtime environment for data;
[0008] Through the pre-set data volume analysis and judgment method, conditional judgment is performed on the front-end state data volume and the front-end state data processing complexity to obtain the conditional judgment result;
[0009] If the conditional judgment result is that the conditional judgment is not satisfied, a Worker state management unit is created in the Worker running environment. Through the pre-set data type logic processing method, the Worker state management unit is instructed to process the current front-end state data to be processed, obtain the current front-end state data processing result and provide feedback.
[0010] According to another aspect of the present invention, a front-end state data processing device based on Worker is provided, wherein the front-end state data processing controller is executed and includes:
[0011] The module for obtaining the current pending front-end state data and the front-end state data description information is used to obtain the current pending front-end state data and the front-end state data description information corresponding to the current pending front-end state data in Redux;
[0012] The front-end state data description information includes the front-end state data volume and the front-end state data processing complexity; the front-end state data processing controller interacts with Redux for data; the front-end state data processing controller interacts with the Worker runtime environment for data;
[0013] The conditional judgment result determination module is used to perform conditional judgment on the front-end state data volume and the front-end state data processing complexity through a pre-set data volume analysis and judgment method to obtain the conditional judgment result;
[0014] The current front-end status data processing result determination and feedback module is used to create a Worker status management unit in the Worker running environment if the condition judgment result is that the condition judgment is not satisfied. Through the pre-set data type logic processing method, it is instructed that the Worker status management unit processes the current front-end status data to be processed, obtains the current front-end status data processing result and provides feedback.
[0015] According to another aspect of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the Worker-based front-end status data processing method according to any embodiment of the present invention is implemented.
[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the Worker-based front-end status data processing method described in any embodiment of the present invention when executed.
[0017] The technical solution of the embodiment of the present invention is to obtain the current front-end state data to be processed and the front-end state data description information corresponding to the current front-end state data to be processed in Redux through a module for obtaining the current front-end state data to be processed and the front-end state data description information corresponding to the current front-end state data to be processed; a conditional judgment result determination module is used to perform conditional judgment on the front-end state data volume and the front-end state data processing complexity respectively through a pre-set data volume analysis and judgment method to obtain a conditional judgment result; and a current front-end state data processing result determination and feedback module is used to create a Worker state management unit in the Worker running environment if the conditional judgment result is that the conditional judgment does not meet the result, and to instruct the Worker state management unit to process the current front-end state data to be processed through a pre-set data type logic processing method to obtain the current front-end state data processing result and provide feedback. This solves the problems that easily cause long front-end page response time and jamming, as well as relatively low efficiency, reduces the front-end page response time and the number of front-end page jams, and improves the efficiency of front-end state data processing.
[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 This is a flowchart of a Worker-based front-end status data processing method according to the first embodiment of the present invention;
[0021] Figure 2 This is a detailed flow chart of a Worker-based front-end status data processing method according to the second embodiment of the present invention;
[0022] Figure 3 2 is a schematic structural diagram of a front-end status data processing device based on Worker according to Embodiment 3 of the present invention;
[0023] Figure 4 It is a structural diagram of an electronic device provided according to the fourth embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "target", "current", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] Example 1
[0027] Figure 1 A flowchart of a Worker-based front-end status data processing method is provided for the first embodiment of the present invention. This embodiment is applicable to situations where front-end status data is processed through Worker or Redux. The method can be executed by a Worker-based front-end status data processing device, specifically, by a front-end status data processing controller. The Worker-based front-end status data processing device can be implemented in the form of hardware and / or software.
[0028] Correspondingly, such as Figure 1 As shown, the method includes:
[0029] S110. In Redux, obtain the current front-end state data to be processed and the front-end state data description information corresponding to the current front-end state data to be processed.
[0030] Among them, the front-end state data description information includes the front-end state data volume and the front-end state data processing complexity; the front-end state data processing controller interacts with Redux for data; the front-end state data processing controller interacts with the Worker operating environment for data.
[0031] The front-end state data description information may be information attributes describing the front-end state data in different dimensions, specifically, the amount of the front-end state data, or the time and space complexity required for processing the front-end state data.
[0032] In this embodiment, Redux is generally used to process the front-end status data. However, for front-end status data with large data volume or high complexity, processing through Redux is likely to result in high processing time cost and low efficiency, as well as page freezes, which will lead to a poor user experience.
[0033] Furthermore, by building a front-end status data processing controller, it is possible to interact with Redux data as well as the Worker runtime environment. This allows the front-end status data processing controller to process the data in real time according to the specific circumstances of the front-end status data and perform appropriate processing.
[0034] S120 , using a pre-set data volume analysis and judgment method, conditional judgments are performed on the front-end state data volume and the front-end state data processing complexity to obtain conditional judgment results.
[0035] The data volume analysis and determination method may be the result of determining the data volume and complexity. The front-end state data volume may be a parameter describing the data volume of the front-end state data. The front-end state data processing complexity may describe the time and space complexity of the front-end state data. The condition determination result may include a condition satisfaction result and a condition failure result.
[0036] Optionally, the front-end status data volume and the front-end status data processing complexity are conditionally judged respectively by a pre-set data volume analysis and judgment method to obtain a conditional judgment result, including: obtaining a pre-set data volume size threshold, a calculation time complexity threshold and a calculation space complexity threshold; wherein, the front-end status data processing complexity includes the time required for data processing and the space required for data processing; through the pre-set data volume analysis and judgment method, it is judged whether the front-end status data volume is less than or equal to the data volume size threshold; if so, it is judged whether the time required for data processing meets the requirements of the calculation time complexity threshold, and whether the space required for data processing meets the requirements of the calculation space complexity threshold. If both are met, the conditional judgment result is determined to be a conditional judgment satisfaction result; if the front-end status data volume is greater than the data volume size threshold, or the time required for data processing does not meet the requirements of the calculation time complexity threshold, or the space required for data processing does not meet the requirements of the calculation space complexity threshold, then the conditional judgment result is determined to be a conditional judgment non-satisfaction result.
[0037] In this embodiment, for example, it is assumed that the data size threshold is , the computation time complexity threshold is , and the computational space complexity threshold is ; The amount of front-end state data is The time required for data processing is , and the space required for data processing is .
[0038] Further, judge and If the size relationship between , it means that the current front-end state data volume is relatively large, which is not suitable for front-end data processing operations through Redux, that is, the result of the conditional judgment is determined to be the result of the conditional judgment not being satisfied. , then we need to continue to see if both and If it is satisfied, the conditional judgment result can be determined as the conditional judgment satisfaction result, and the front-end data processing operation can be performed through Redux.
[0039] In addition, if but , or if but ,or and The above three situations are not suitable for front-end data processing through Redux, which means that the conditional judgment result can be determined as the conditional judgment not being satisfied.
[0040] Optionally, after performing conditional judgment on the front-end status data volume and the front-end status data processing complexity respectively through the pre-set data volume analysis and judgment method and obtaining the conditional judgment result, it also includes: if the conditional judgment result is a conditional judgment satisfaction result, instructing the main thread of Redux to process the current front-end status data to obtain the current front-end status data processing result, and performing front-end page display processing on the current front-end status data processing result through the Redux front-end page.
[0041] Specifically, if , and satisfy and , it means that the conditional judgment result is the conditional judgment satisfaction result, which can then indicate that the current front-end state data to be processed should be processed through the main thread of Redux. The front-end state data that meets the conditions can be directly processed and fed back through the main thread of Redux, which can improve the convenience and efficiency of processing the front-end state data.
[0042] S130. If the result of the conditional judgment is that the conditional judgment is not satisfied, a Worker state management unit is created in the Worker running environment. Through a pre-set data type logic processing method, the Worker state management unit is instructed to process the current front-end state data to be processed, obtain the current front-end state data processing result and provide feedback.
[0043] The Worker state management unit may be a state management unit set in the Worker runtime environment and include multiple sub-thread units. When the Worker state management unit processes front-end data, a suitable target sub-thread unit may be selected based on the load of each sub-thread unit.
[0044] Among them, the data type logic processing method can be a method that can process different types of front-end status data through different logic operations.
[0045] Optionally, the preset data type logic processing method is used to instruct the Worker state management unit to process the current front-end state data to be processed, obtain the current front-end state data processing result and provide feedback, including: obtaining the current front-end state data type corresponding to the current front-end state data to be processed; matching the current front-end state data type with the historical front-end state data type in the data type logic processing database through the preset data type logic processing method to obtain a type matching result; if the type matching result is a successful type matching result, obtaining the target processing operation logic, and instructing the target sub-thread unit in the Worker state management unit to process the current front-end state data to be processed according to the target processing operation logic, obtain the current front-end state data processing result and provide feedback.
[0046] In this embodiment, it is necessary to pre-build a data type logic processing database, which can match corresponding historical processing operation logic according to different types of historical front-end state data types.
[0047] Specifically, in this embodiment, the current front-end state data type can be obtained, and then a matching operation can be performed with the historical front-end state data type in the data type logic processing database. There are cases where the matching is successful and cases where the matching is unsuccessful.
[0048] In detail, assuming that the type matching result is a successful type matching result, it means that there is a processing operation logic that matches the data type in the data type logic processing database. Therefore, the target processing operation logic can be determined, and then the current front-end status data to be processed can be processed according to the target processing operation logic. The current front-end status data processing result can be obtained and feedback can be provided.
[0049] Optionally, obtaining the current front-end state data processing result and providing feedback includes: instructing the Worker state management unit to send the obtained current front-end state data processing result to the main thread of Redux; instructing the main thread of Redux to perform front-end page display processing on the current front-end state data processing result through the Redux front-end page.
[0050] Continuing with the previous example, after obtaining the current front-end state data processing result, since it is processed in the Worker state management unit, the front-end state data processing controller is used to instruct the obtained current front-end state data processing result to be sent to the main thread of Redux.
[0051] Furthermore, after the main thread of Redux receives the current front-end state data processing result, the current front-end state data processing result can be displayed on the front-end page through the Redux front-end page.
[0052] Optionally, after the current front-end state data type is matched with the historical front-end state data type in the data type logic processing database through the pre-set data type logic processing method to obtain a type matching result, it also includes: if the type matching result is an unsuccessful type matching result, the current front-end state data to be processed and the current front-end state data type are fed back to the user; the user's front-end state data completion instruction is received in real time, and the current processing operation logic corresponding to the current front-end state data to be processed is obtained; according to the current front-end state data type and the current processing operation logic, the data type logic processing database is optimized and adjusted to obtain the optimized and adjusted data type logic processing database.
[0053] Continuing with the previous example, if the type matching result is an unsuccessful type matching result, it means that there is no processing operation logic matching the data type in the data type logic processing database, so it needs to be processed by professionals. Specifically, the current front-end state data to be processed and the current front-end state data type are fed back to the user, and the front-end state data can be obtained. After the professional processes the current processing operation logic that can be matched and the processing is completed, a user front-end state data completion instruction can be issued.
[0054] Furthermore, after the front-end status data processing controller receives the user's front-end status data completion instruction, it adds the current front-end status data type and the current processing operation logic to the data type logic processing database to implement optimization and adjustment operations on the data type logic processing database. This can enrich the data type logic processing database, increase the diversity of the data type logic processing database, and facilitate the processing operations of different types of front-end status data.
[0055] The technical solution of the embodiment of the present invention is to obtain the current front-end state data to be processed and the front-end state data description information corresponding to the current front-end state data to be processed in Redux through a module for obtaining the current front-end state data to be processed and the front-end state data description information corresponding to the current front-end state data to be processed; a conditional judgment result determination module is used to perform conditional judgment on the front-end state data volume and the front-end state data processing complexity respectively through a pre-set data volume analysis and judgment method to obtain a conditional judgment result; and a current front-end state data processing result determination and feedback module is used to create a Worker state management unit in the Worker running environment if the conditional judgment result is that the conditional judgment does not meet the result, and to instruct the Worker state management unit to process the current front-end state data to be processed through a pre-set data type logic processing method to obtain the current front-end state data processing result and provide feedback. This solves the problems that easily cause long front-end page response time and jamming, as well as relatively low efficiency, reduces the front-end page response time and the number of front-end page jams, and improves the efficiency of front-end state data processing.
[0056] Example 2
[0057] Figure 2 This is a detailed flow chart of a Worker-based front-end status data processing method provided according to the second embodiment of the present invention. This embodiment is optimized based on the above embodiments. In this embodiment, before obtaining the current front-end status data to be processed and the front-end status data description information corresponding to the current front-end status data to be processed in Redux, it also includes the storage construction of the data type logic processing database.
[0058] S210: Acquire each historical front-end status data, and acquire the historical front-end status data type and historical processing operation logic corresponding to each historical front-end status data.
[0059] The historical front-end state data type may be a specific type that describes the historical front-end state data, and the historical processing operation logic may be a specific processing operation logic corresponding to processing different data types.
[0060] S220. According to a pre-set clustering method, with each historical front-end status data type as the cluster center, the number of historical processing operation logics corresponding to each historical front-end status data in each historical front-end status data type is counted respectively, and the historical processing operation logic corresponding to each historical front-end status data type is determined.
[0061] For example, assuming that the historical front-end status data types include 3 (which may be historical front-end status data type 1, historical front-end status data type 2, and historical front-end status data type 3 respectively), clustering processing can be performed according to different data types. Each type includes a different number of historical front-end status data, and the historical processing operation logic corresponding to each historical front-end status data may be the same or different.
[0062] Specifically, assume that historical front-end status data type 1 includes 50 historical front-end status data. Of these, 48 historical front-end status data correspond to historical processing operation logic 1; 1 historical front-end status data corresponds to historical processing operation logic 10; and 1 historical front-end status data corresponds to historical processing operation logic 3. Therefore, by counting the number of historical processing operation logics corresponding to each historical front-end status data, it can be determined that the historical processing operation logic corresponding to historical front-end status data type 1 is historical processing operation logic 1.
[0063] Correspondingly, through the above method, the historical processing operation logic corresponding to the historical front-end status data type 2 and the historical front-end status data type 3 can be obtained respectively.
[0064] S230: Jointly store each pair of historical front-end state data types and historical processing operation logic in a data type logic processing database corresponding to the Worker state management unit.
[0065] In this embodiment, it is necessary to jointly store the historical front-end status data type and the historical processing operation logic to complete the construction of the data type logic processing database, which can be used for subsequent processing of different types of front-end status data obtained.
[0066] S240. In Redux, obtain the current front-end state data to be processed and the front-end state data description information corresponding to the current front-end state data to be processed.
[0067] S250: Perform conditional judgment on the front-end status data volume and the front-end status data processing complexity respectively through a preset data volume analysis and judgment method to obtain a conditional judgment result.
[0068] S260. If the result of the conditional judgment is that the conditional judgment is not satisfied, a Worker state management unit is created in the Worker running environment. Through a pre-set data type logic processing method, the Worker state management unit is instructed to process the current front-end state data to be processed, obtain the current front-end state data processing result and provide feedback.
[0069] The technical solution of the embodiment of the present invention, through the construction of a data type logic processing database, can be used to process different types of front-end status data according to different processing operation logic in the Worker state management unit, thereby improving the convenience, accuracy and processing efficiency of front-end data processing, and further reducing the front-end page response time and the number of front-end page freezes, thereby improving user experience and reducing time costs.
[0070] Example 3
[0071] Figure 3 This is a structural diagram of a Worker-based front-end status data processing device provided in the third embodiment of the present invention. The Worker-based front-end status data processing device provided in this embodiment can be implemented through software and / or hardware, and can be configured in a terminal device or server to implement a Worker-based front-end status data processing method in the embodiment of the present invention. Figure 3 As shown, the device includes: a module 310 for acquiring current front-end state data to be processed and front-end state data description information, a module 320 for determining conditional judgment results, and a module 330 for determining and feeding back current front-end state data processing results.
[0072] Among them, the current front-end state data to be processed and the front-end state data description information acquisition module 310 is used to obtain the current front-end state data to be processed and the front-end state data description information corresponding to the current front-end state data to be processed in Redux;
[0073] The front-end state data description information includes the front-end state data volume and the front-end state data processing complexity; the front-end state data processing controller interacts with Redux for data; the front-end state data processing controller interacts with the Worker runtime environment for data;
[0074] The conditional judgment result determination module 320 is used to perform conditional judgment on the front-end state data volume and the front-end state data processing complexity by using a preset data volume analysis and judgment method to obtain a conditional judgment result;
[0075] The current front-end status data processing result determination and feedback module 330 is used to create a Worker status management unit in the Worker running environment if the condition judgment result is that the condition judgment is not satisfied. Through the pre-set data type logic processing method, it instructs the Worker status management unit to process the current front-end status data to be processed, obtain the current front-end status data processing result and provide feedback.
[0076] The technical solution of the embodiment of the present invention is to obtain the current front-end state data to be processed and the front-end state data description information corresponding to the current front-end state data to be processed in Redux through a module for obtaining the current front-end state data to be processed and the front-end state data description information corresponding to the current front-end state data to be processed; a conditional judgment result determination module is used to perform conditional judgment on the front-end state data volume and the front-end state data processing complexity respectively through a pre-set data volume analysis and judgment method to obtain a conditional judgment result; and a current front-end state data processing result determination and feedback module is used to create a Worker state management unit in the Worker running environment if the conditional judgment result is that the conditional judgment does not meet the result, and to instruct the Worker state management unit to process the current front-end state data to be processed through a pre-set data type logic processing method to obtain the current front-end state data processing result and provide feedback. This solves the problems that easily cause long front-end page response time and jamming, as well as relatively low efficiency, reduces the front-end page response time and the number of front-end page jams, and improves the efficiency of front-end state data processing.
[0077] On the basis of the above embodiments, it also includes a condition judgment satisfaction result determination module, which can be specifically used to: perform conditional judgment on the front-end status data volume and the front-end status data processing complexity respectively through the pre-set data volume analysis and judgment method, and after obtaining the conditional judgment result, if the conditional judgment result is a conditional judgment satisfaction result, instruct the main thread of Redux to process the current front-end status data to obtain the current front-end status data processing result, and perform front-end page display processing on the current front-end status data processing result through the Redux front-end page.
[0078] Based on the above embodiments, the conditional judgment result determination module 320 can be specifically used to: obtain a pre-set data volume size threshold, a calculation time complexity threshold and a calculation space complexity threshold; wherein, the front-end status data processing complexity includes the time required for data processing and the space required for data processing; through a pre-set data volume analysis and judgment method, determine whether the front-end status data volume is less than or equal to the data volume size threshold; if so, determine whether the time required for data processing meets the requirements of the calculation time complexity threshold, and whether the space required for data processing meets the requirements of the calculation space complexity threshold. If both are met, determine that the conditional judgment result is a conditional judgment satisfaction result; if the front-end status data volume is greater than the data volume size threshold, or the time required for data processing does not meet the requirements of the calculation time complexity threshold, or the space required for data processing does not meet the requirements of the calculation space complexity threshold, then determine that the conditional judgment result is a conditional judgment non-satisfaction result.
[0079] On the basis of the above embodiments, it also includes a data type logic processing database storage module, which can be specifically used to: before obtaining the current front-end state data to be processed and the front-end state data description information corresponding to the current front-end state data to be processed in Redux, obtain each historical front-end state data, and obtain the historical front-end state data type and historical processing operation logic corresponding to each historical front-end state data; according to a preset clustering method, with each historical front-end state data type as the cluster center, count the number of historical processing operation logics corresponding to each historical front-end state data in each historical front-end state data type, and determine the historical processing operation logic corresponding to each historical front-end state data type; jointly store each pair of historical front-end state data type and historical processing operation logic in the data type logic processing database corresponding to the Worker state management unit.
[0080] Based on the above embodiments, the current front-end state data processing result determination and feedback module 330 may specifically include: a current front-end state data type acquisition unit, used to obtain the current front-end state data type corresponding to the current front-end state data to be processed; a type matching result determination unit, used to match the current front-end state data type with the historical front-end state data type in the data type logic processing database through a preset data type logic processing method to obtain a type matching result; a type matching success result determination unit, used to obtain the target processing operation logic if the type matching result is a type matching success result, and instruct the target sub-thread unit in the Worker state management unit to process the current front-end state data to be processed according to the target processing operation logic, obtain the current front-end state data processing result and provide feedback.
[0081] Based on the above embodiments, the current front-end state data processing result determination and feedback module 330 can also be specifically used to: instruct the Worker state management unit to send the obtained current front-end state data processing result to the main thread of Redux; instruct the main thread of Redux to perform front-end page display processing on the current front-end state data processing result through the Redux front-end page.
[0082] On the basis of the above embodiments, it also includes a type matching unsuccessful result determination unit, which can be specifically used to: match the current front-end state data type with the historical front-end state data type in the data type logic processing database through the pre-set data type logic processing method, and after obtaining the type matching result, if the type matching result is a type matching unsuccessful result, then feed back the current front-end state data to be processed and the current front-end state data type to the user; receive the user's front-end state data completion instruction in real time, and obtain the current processing operation logic corresponding to the current front-end state data to be processed; according to the current front-end state data type and the current processing operation logic, optimize and adjust the data type logic processing database to obtain the optimized and adjusted data type logic processing database.
[0083] The Worker-based front-end status data processing device provided in an embodiment of the present invention can execute the Worker-based front-end status data processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0084] Example 4
[0085] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement the fourth embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0086] like Figure 4As shown, electronic device 10 includes at least one processor 11 and memory, such as read-only memory (ROM) 12 and random access memory (RAM) 13, communicatively connected to at least one processor 11. The memory stores computer programs executable by the at least one processor. Processor 11 can perform various appropriate actions and processes based on the computer programs stored in ROM 12 or loaded from storage unit 18 into RAM 13. RAM 13 can also store various programs and data required for the operation of electronic device 10. Processor 11, ROM 12, and RAM 13 are interconnected via bus 14. An input / output (I / O) interface 15 is also connected to bus 14.
[0087] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0088] Processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any other suitable processors, controllers, microcontrollers, etc. Processor 11 executes the various methods and processes described above, such as the Worker-based front-end status data processing method.
[0089] In some embodiments, the Worker-based front-end state data processing method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the Worker-based front-end state data processing method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the Worker-based front-end state data processing method by any other appropriate means (for example, by means of firmware).
[0090] The method includes: in Redux, obtaining the current front-end state data to be processed and the front-end state data description information corresponding to the current front-end state data to be processed; wherein, the front-end state data description information includes the front-end state data volume and the front-end state data processing complexity; the front-end state data processing controller interacts with Redux for data; the front-end state data processing controller interacts with the Worker operating environment for data; through a pre-set data volume analysis and judgment method, conditional judgments are performed on the front-end state data volume and the front-end state data processing complexity respectively to obtain a conditional judgment result; if the conditional judgment result is that the conditional judgment result is not satisfied, then in the Worker operating environment, a Worker state management unit is created, and through a pre-set data type logic processing method, the Worker state management unit is instructed to process the current front-end state data to be processed to obtain the current front-end state data processing result and provide feedback.
[0091] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0092] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0093] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or apparatus. A computer-readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0094] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device that has: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0095] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0096] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0097] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0098] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
[0099] Example 5
[0100] Embodiment 5 of the present invention also provides a computer-readable storage medium, wherein the computer-readable instructions are used to execute a Worker-based front-end status data processing method when executed by a computer processor, the method comprising: in Redux, obtaining the current front-end status data to be processed, and the front-end status data description information corresponding to the current front-end status data to be processed; wherein the front-end status data description information includes the front-end status data volume and the front-end status data processing complexity; the front-end status data processing controller interacts with Redux for data; the front-end status data processing controller interacts with the Worker operating environment for data; through a pre-set data volume analysis and judgment method, conditional judgments are performed on the front-end status data volume and the front-end status data processing complexity respectively to obtain a conditional judgment result; if the conditional judgment result is that the conditional judgment result is not satisfied, then in the Worker operating environment, a Worker state management unit is created, and through a pre-set data type logic processing method, the Worker state management unit is instructed to process the current front-end status data to be processed, obtain the current front-end status data processing result and provide feedback.
[0101] Of course, the computer-readable storage medium provided in an embodiment of the present invention has computer-executable instructions that are not limited to the method operations described above, and can also execute related operations in the Worker-based front-end status data processing provided in any embodiment of the present invention.
[0102] Through the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented with the help of software and necessary general-purpose hardware. Of course, it can also be implemented with hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention, or the part that contributes to the existing technology, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0103] It is worth noting that in the above-mentioned embodiment of Worker-based front-end status data processing, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0104] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A front-end status data processing method based on Worker, characterized in that: Executed by the front-end state data processing controller, including: In Redux, get the current pending front-end state data and the front-end state data description information corresponding to the current pending front-end state data; The front-end state data description information includes the front-end state data volume and the front-end state data processing complexity; the front-end state data processing controller interacts with Redux for data; the front-end state data processing controller interacts with the Worker runtime environment for data; Through the pre-set data volume analysis and judgment method, conditional judgment is performed on the front-end state data volume and the front-end state data processing complexity to obtain the conditional judgment result; If the conditional judgment result is that the conditional judgment result is not satisfied, then in the Worker running environment, a Worker state management unit is created, and the Worker state management unit is instructed to process the current front-end state data to be processed through a pre-set data type logic processing method, obtain the current front-end state data processing result and provide feedback; The method of analyzing and judging the amount of data set in advance is used to perform conditional judgment on the amount of front-end status data and the complexity of front-end status data processing, and obtain the conditional judgment results, including: Obtaining pre-set data size threshold, computation time complexity threshold, and computation space complexity threshold; The front-end state data processing complexity includes the time required for data processing and the space required for data processing; Determine whether the front-end state data volume is less than or equal to the data volume threshold by using a preset data volume analysis and judgment method; If so, determine whether the time required for data processing meets the requirement of the computational time complexity threshold, and whether the space required for data processing meets the requirement of the computational space complexity threshold. If both are satisfied, determine that the conditional judgment result is a conditional judgment satisfaction result. If the amount of front-end state data is greater than the data size threshold, or the time required for data processing does not meet the requirement of the calculation time complexity threshold, or the space required for data processing does not meet the requirement of the calculation space complexity threshold, then determining that the conditional judgment result is a conditional judgment not satisfied result; The method of instructing the Worker state management unit to process the current front-end state data to be processed by the preset data type logic processing method, obtaining the current front-end state data processing result and providing feedback includes: Get the current front-end state data type corresponding to the current front-end state data to be processed; Matching the current front-end state data type with the historical front-end state data type in the data type logic processing database using a preset data type logic processing method to obtain a type matching result; If the type matching result is a successful type matching result, the target processing operation logic is obtained, and the target sub-thread unit in the Worker state management unit is instructed to process the current front-end state data to be processed according to the target processing operation logic, obtain the current front-end state data processing result and provide feedback.
2. The method according to claim 1, characterized in that After performing conditional judgment on the front-end status data volume and the front-end status data processing complexity by the preset data volume analysis and judgment method and obtaining the conditional judgment result, the method further includes: If the conditional judgment result is that the conditional judgment is satisfied, it is instructed to process the current front-end state data to be processed through the main thread of Redux to obtain the current front-end state data processing result, and perform front-end page display processing on the current front-end state data processing result through the Redux front-end page.
3. The method according to claim 1, characterized in that In the Redux, before obtaining the current front-end state data to be processed and the front-end state data description information corresponding to the current front-end state data to be processed, the following is also included: Obtain each historical front-end state data, and obtain the historical front-end state data type and historical processing operation logic corresponding to each historical front-end state data; According to the pre-set clustering method, with each historical front-end state data type as the cluster center, the number of historical processing operation logics corresponding to each historical front-end state data in each historical front-end state data type is counted, and the historical processing operation logic corresponding to each historical front-end state data type is determined; Each pair of historical front-end state data types and historical processing operation logic is jointly stored in the data type logic processing database corresponding to the Worker state management unit.
4. The method according to claim 1, wherein Obtaining the current front-end status data processing result and providing feedback includes: Instruct the Worker state management unit to send the obtained current front-end state data processing result to the main thread of Redux; Instructs the main thread of Redux to display the current front-end state data processing result on the front-end page through the Redux front-end page.
5. The method according to claim 1, wherein After matching the current front-end state data type with the historical front-end state data type in the data type logic processing database using the preset data type logic processing method to obtain a type matching result, the method further includes: If the type matching result is an unsuccessful type matching result, the current front-end state data to be processed and the current front-end state data type are fed back to the user; Receive the user's front-end status data completion instruction in real time and obtain the current processing operation logic corresponding to the current front-end status data to be processed; According to the current front-end state data type and the current processing operation logic, the data type logic processing database is optimized and adjusted to obtain the optimized and adjusted data type logic processing database.
6. A front-end status data processing device based on Worker, characterized in that: Executed by the front-end state data processing controller, including: The module for obtaining the current pending front-end state data and the front-end state data description information is used to obtain the current pending front-end state data and the front-end state data description information corresponding to the current pending front-end state data in Redux; The front-end state data description information includes the front-end state data volume and the front-end state data processing complexity; the front-end state data processing controller interacts with Redux for data; the front-end state data processing controller interacts with the Worker runtime environment for data; The conditional judgment result determination module is used to perform conditional judgment on the front-end state data volume and the front-end state data processing complexity through a pre-set data volume analysis and judgment method to obtain the conditional judgment result; The current front-end state data processing result determination and feedback module is used to create a Worker state management unit in the Worker running environment if the condition judgment result is that the condition judgment is not satisfied, and instruct the Worker state management unit to process the current front-end state data to be processed through a preset data type logic processing method, obtain the current front-end state data processing result, and provide feedback; Wherein, the conditional judgment result determination module is used to: obtain a preset data volume size threshold, a calculation time complexity threshold and a calculation space complexity threshold; wherein, the front-end state data processing complexity includes the time required for data processing and the space required for data processing; through a preset data volume analysis and judgment method, determine whether the front-end state data volume is less than or equal to the data volume size threshold; if so, determine whether the time required for data processing meets the requirements of the calculation time complexity threshold, and whether the space required for data processing meets the requirements of the calculation space complexity threshold. If both are met, determine that the conditional judgment result is a conditional judgment satisfaction result; if the front-end state data volume is greater than the data volume size threshold, or the time required for data processing does not meet the requirements of the calculation time complexity threshold, or the space required for data processing does not meet the requirements of the calculation space complexity threshold, then determine that the conditional judgment result is a conditional judgment dissatisfaction result; The current front-end state data processing result determination and feedback module includes: A current front-end state data type acquisition unit is used to acquire the current front-end state data type corresponding to the current front-end state data to be processed; a type matching result determining unit, configured to match the current front-end state data type with the historical front-end state data type in the data type logic processing database using a preset data type logic processing method to obtain a type matching result; The type matching success result determination unit is used to obtain the target processing operation logic if the type matching result is a type matching success result, and instruct the target sub-thread unit in the Worker state management unit to process the current front-end state data to be processed according to the target processing operation logic, obtain the current front-end state data processing result and provide feedback.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements a Worker-based front-end status data processing method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a Worker-based front-end status data processing method according to any one of claims 1 to 5 when executed.
Citation Information
Patent Citations
Method, apparatus, equipment and readable storage medium for storing data through redux
CN109144503A
Data interaction method, device and system
CN115103002A