A web worker-based intelligent scheduling method, system, device and medium

By predicting user request trends using decision tree algorithms and shared scheduling models, and combining transfer learning techniques to optimize web worker resource allocation, the problems of insufficient web worker quantity and improper scheduling were solved, thereby improving response speed and user experience.

CN118820633BActive Publication Date: 2026-06-23GUANGZHOU SANQI DREAM NETWORK TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU SANQI DREAM NETWORK TECH CO LTD
Filing Date
2024-06-25
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

In existing technologies, insufficient numbers of web workers or improper scheduling can lead to slow page loading and delayed interactive responses, affecting user experience and website performance.

Method used

A request content trend model is established using a decision tree algorithm. The number and type of web workers are pre-configured through a shared scheduling model. Transfer learning technology is used to generate pre-configuration schemes for different business domains and dynamically adjust resource allocation.

Benefits of technology

It improves the response speed of user requests, enhances user experience and website performance, adapts to changes in different business areas, and enables efficient processing of cross-domain tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118820633B_ABST
    Figure CN118820633B_ABST
Patent Text Reader

Abstract

The application is suitable for the field of information technology, and provides an intelligent scheduling method, system, device and medium based on web workers, wherein the method comprises the following steps: obtaining historical user request data, performing data analysis on the historical user request data by using a decision tree algorithm, and establishing a request content trend model; a shared scheduling model is established, which is used for sharing web worker configuration schemes between different request contents; a web worker pre-configuration scheme is obtained through the shared scheduling model according to the request content trend model; and a pre-training model is established by using a transfer learning technology, which is used for generating web worker pre-configuration schemes in different business fields. The application has strong adaptability and expansibility, can adapt to changing business requirements, and can quickly respond to user requests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of information technology, and in particular relates to an intelligent scheduling method, system equipment and medium based on web workers. Background Technology

[0002] In the development of the web, the introduction of web workers has greatly improved browser page performance and user experience. Web workers provide a way to perform background tasks in web applications without interfering with the main thread. This allows developers to create smoother user interfaces, even when performing complex calculations, without causing page lag.

[0003] Web workers are widely used in scenarios such as data processing, file operations, and real-time content updates. For example, during a promotional period, an e-commerce website experiences a surge in user traffic. In such situations, web workers must process complex computational or data processing tasks in parallel in the background to avoid blocking the main thread and UI rendering. If the number of web workers is insufficient or their scheduling is improper, it can lead to slow page loading, delayed interactive responses, and other problems, thereby impacting user experience and the website's business performance.

[0004] Therefore, the problem of how to intelligently predict and adjust the resource allocation strategy of web workers to ensure that user requests are responded to quickly needs to be solved. Summary of the Invention

[0005] This application provides an intelligent scheduling method, system, device, and medium based on web workers, which can solve the problem of how to intelligently predict and adjust the resource allocation strategy of web workers.

[0006] In a first aspect, embodiments of this application provide an intelligent scheduling method based on web workers, comprising:

[0007] Historical user request data is obtained, and a decision tree algorithm is used to analyze the historical user request data to establish a request content trend model.

[0008] A shared scheduling model is established, which is used to share the webworker configuration scheme among different request contents. The webworker configuration scheme includes the number of webworkers to be configured for different request contents and the type of webworkers.

[0009] Based on the requested content trend model, a pre-configuration scheme for web workers is obtained through the shared scheduling model. The pre-configuration scheme for web workers is a pre-determined configuration scheme for web workers.

[0010] A pre-trained model is established using transfer learning technology. This pre-trained model is used to generate pre-configuration schemes for web workers in different business domains.

[0011] Furthermore, the step of acquiring historical user request data and using a decision tree algorithm to analyze the historical user request data and establish a request content trend model includes:

[0012] Based on user behavior, historical user request data is obtained using event tracking technology. The user request data includes user ID, request time, request content, operating system, browser, and user attributes.

[0013] The historical user request data is classified according to the request content and request time to obtain a user request dataset based on the request content and request time.

[0014] Based on the user request dataset, a request content trend model is established using the decision tree algorithm, with operating system, browser and user attributes as feature variables.

[0015] Based on the requested content trend model, the user's request trend is predicted at a preset time, where the request trend is the probability of the user requesting different content.

[0016] Furthermore, the establishment of a shared scheduling model, which is used to share web worker configuration schemes across different request contents, includes:

[0017] Collect different request content and obtain request datasets with various request contents;

[0018] Based on the relevant attribute information of the request dataset, the characteristics of different request contents are obtained through data analysis. The relevant attribute information includes request volume, request frequency and request parameters, and request time.

[0019] Based on the characteristics of different request content and business rules, determine the type of webworkers required to process different request content;

[0020] Based on the request frequency and request parameters, determine the number of different web worker types when processing different request content;

[0021] Based on the types of web workers required for different request content and the number required for different types of web workers, a shared scheduling model is established. The shared scheduling model includes web worker configuration schemes for different request content. The web worker configuration schemes include the number of web workers to be configured and the types of web workers. The types of web workers include CPU-intensive, IO-intensive, and hybrid types.

[0022] If the requested content is identified, the corresponding web worker configuration scheme is extracted from the shared scheduling model.

[0023] Furthermore, the step of obtaining a pre-configuration scheme for web workers based on the request content trend model and through the shared scheduling model includes:

[0024] Obtain the user's login information, and based on the login information, obtain the user's request trend, where the request trend is the probability of the user requesting different content.

[0025] The probability of requesting different content is compared with the preset request threshold in turn;

[0026] For request content with a request probability higher than the preset request threshold, the web worker configuration scheme for the request content is obtained from the shared scheduling model. A load balancing algorithm is used to obtain the load status of each web worker type. The request content is pre-assigned to the low-load web worker type for processing according to the web worker configuration scheme. The load status includes high load and low load.

[0027] For request content with a request probability lower than the preset request threshold, compare the request probabilities of each request content, obtain the request content with the highest request probability, and obtain the web worker configuration scheme for the request content with the highest request probability from the shared scheduling model.

[0028] Furthermore, after obtaining the webworkers pre-configuration scheme based on the user request trend model and the shared scheduling model, the process includes:

[0029] Obtain the user's current request content and divide the request content into multiple sub-tasks;

[0030] Data dependency analysis and computational complexity analysis are performed on multiple subtasks to obtain the scheduling order and execution method among different subtasks, wherein the execution method includes synchronous execution and asynchronous execution.

[0031] Based on the aforementioned scheduling order and execution method, a web worker scheduling scheme is determined;

[0032] A thread pool management approach is adopted, and instances are created based on the web workers scheduling scheme. The working mode of the instances is dynamically adjusted according to the computational complexity and data dependencies of the subtasks. The working mode includes creating instances, destroying instances, and modifying instance parameters. The instances are used to execute the subtasks.

[0033] Furthermore, the step of dividing the current user request into multiple subtasks, performing data dependency analysis and computational complexity analysis on the multiple subtasks to obtain the scheduling order and execution method among different subtasks, and determining a web worker scheduling scheme based on the scheduling order and the execution method includes:

[0034] Based on the business attributes of the current user request, a task decomposition algorithm is used to divide the user request into multiple sub-tasks;

[0035] By analyzing the business logic relationships between subtasks, a dependency graph of the subtasks is constructed.

[0036] Based on the dependency graph, different subtasks are divided into multiple task groups;

[0037] Execute subtasks in different task groups synchronously, and execute subtasks in the same task group asynchronously according to their dependencies;

[0038] Analyze the computational complexity of each subtask, and calculate the sum of the computational complexities of the subtasks across different task groups;

[0039] Obtain the current device's performance data, and determine the web worker scheduling scheme based on the total computational complexity.

[0040] Furthermore, the method employs transfer learning to establish a pre-trained model, which is used to generate pre-configuration schemes for web workers in different business domains, including:

[0041] Acquire user request data from different business domains, input the user request data from different business domains into a pre-trained word embedding pre-training model for training, and obtain high-dimensional feature vectors;

[0042] The high-dimensional feature vector is processed using a graph neural network, and the dependencies between different business domains are obtained by learning the relationship between nodes and edges.

[0043] An adversarial learning method is used to train user request data between a target business domain and a source business domain to generate a domain knowledge base. The target business domain is a new business domain to be learned, and the source business domain is a business domain that has already been learned. The domain knowledge base includes a request content trend model and a shared scheduling model.

[0044] Using the domain knowledge base, transferable knowledge components are automatically recommended for new business domains, and based on these knowledge components, pre-configured web workers schemes for the new domains are generated.

[0045] Secondly, embodiments of this application provide an intelligent scheduling system based on web workers, comprising:

[0046] First processing module: acquires historical user request data, uses decision tree algorithm to perform data analysis on the historical user request data, and establishes a request content trend model;

[0047] The second processing module establishes a shared scheduling model, which is used to share web worker configuration schemes for different request contents. The web worker configuration scheme includes the number of web workers to be configured for different request contents and the type of web workers.

[0048] The third processing module: Based on the request content trend model, and through the shared scheduling model, obtains a pre-configured web worker scheme, wherein the pre-configured web worker scheme is a pre-determined web worker configuration scheme;

[0049] The fourth processing module employs transfer learning technology to establish a pre-trained model, which is used to generate pre-configuration schemes for web workers in different business domains.

[0050] Thirdly, embodiments of this application provide a terminal device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described intelligent scheduling method based on web workers.

[0051] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned intelligent scheduling method based on web workers.

[0052] The beneficial effects of the embodiments in this application compared with the prior art are:

[0053] This invention discloses an intelligent scheduling method, system device, and medium based on web workers. It employs a decision tree algorithm to predict user demand trends for various content requests on a browser platform. Before a user request, the configuration scheme of web workers is determined, thereby improving the response speed to user requests. Simultaneously, a shared scheduling model is established for different request content, enabling the rapid acquisition of corresponding configuration schemes from the shared scheduling model, further improving user experience and website performance. Furthermore, transfer learning technology is used, allowing this intelligent web worker scheduling method to adapt to different business domains and achieve efficient cross-domain task processing. This gives the invention strong adaptability and scalability, enabling it to adapt to constantly changing business needs. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 This is a flowchart illustrating an intelligent scheduling method based on web workers according to an embodiment of the present invention.

[0056] Figure 2 This is a schematic diagram of the structure of an intelligent scheduling system based on web workers provided in an embodiment of the present invention;

[0057] Figure 3 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. Detailed Implementation

[0058] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0059] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0060] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0061] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0062] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0063] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0064] Please see Figure 1 As shown, this invention is an intelligent scheduling method based on web workers, comprising the following steps:

[0065] S100. Obtain historical user request data, and use a decision tree algorithm to perform data analysis on the historical user request data to establish a request content trend model.

[0066] In some embodiments, step S100 above includes:

[0067] Based on user behavior, historical user request data is obtained using event tracking technology. The user request data includes user ID, request time, request content, operating system, browser, and user attributes.

[0068] The historical user request data is classified according to the request content and request time to obtain a user request dataset based on the request content and request time.

[0069] Based on the user request dataset, a request content trend model is established using the decision tree algorithm, with operating system, browser and user attributes as feature variables.

[0070] Based on the requested content trend model, the user's request trend is predicted at a preset time, where the request trend is the probability of the user requesting different content.

[0071] In this embodiment, historical user request data is acquired using tracking technology based on user actions in the browser. This data includes user ID, request time, request content, operating system, browser, and user attributes, thus obtaining user behavior logs. These logs are then cleaned and transformed to remove redundant and abnormal data, and the fields are standardized to obtain structured user request data. User IDs are associated with user attributes, including age, gender, region (e.g., Asia, North America), income (high, middle, low), education level (PhD, Master's, Bachelor's, High School), and occupation (IT, Education, Business, etc.), enriching the dimensions of the request data. Furthermore, distributed storage technologies such as HDFS are used to persistently store the massive amounts of user request data, and a data warehouse is established using tools like Hive to facilitate subsequent analysis and querying, resulting in manageable and analyzable user request data assets.

[0072] In this embodiment, cluster analysis is used to divide users into different user groups based on user attributes, and the user attribute characteristics of each user group are analyzed, such as age distribution, gender ratio, geographical distribution, income level, education background and occupation distribution.

[0073] In this embodiment, based on the request content contained in the historical user request data of each user group, the request content of each historical user request is identified to obtain the request content corresponding to each historical user request. Based on the request time contained in the historical user request data, the request time of each historical user request is extracted to obtain the request time accurate to the hour. Using the request content and request time, the historical user request data is mapped to a two-dimensional space composed of the request content and request time, obtaining the coordinates of each historical user request data in this two-dimensional space. Based on the two-dimensional coordinates of the historical user request data, a clustering algorithm is used to cluster the data points in the two-dimensional space, with each cluster representing a subset of user request data based on request content and request time. By statistically analyzing all the obtained clusters, the distribution of user requests with different request content at different request times is obtained, identifying high-frequency request content and high-frequency request periods. Based on the analysis results, for different high-frequency request content and high-frequency request periods, corresponding user request records are selected from the original historical user request data to construct corresponding user request data subsets. All obtained user request data subsets are summarized to obtain a complete user request dataset based on request content and request time. Then, the user request dataset is used as the training set, and request content, operating system, browser, and user attributes are used as feature variables, input into the request content trend model. By statistically analyzing the quantity and proportion of each request content, the changing trend of request content over different time periods is obtained. Methods such as moving average and exponential smoothing are used to smooth the time series data of request content, removing noise interference and obtaining the overall trend of request content changes. Based on the historical changing trends of request content, time series prediction models such as ARIMA and Prophet are used to predict the access frequency of each request content in the future, i.e., the access probability of each request content within the prediction period, thus obtaining the development trend of request content.

[0074] S200. Establish a shared scheduling model, which is used to share the webworker configuration scheme between different request contents. The webworker configuration scheme includes the number of webworkers to be configured for different request contents and the type of webworkers.

[0075] In some embodiments, step S200 above includes:

[0076] Collect different request content and obtain request datasets with various request contents;

[0077] Based on the relevant attribute information of the request dataset, the characteristics of different request contents are obtained through data analysis. The relevant attribute information includes request volume, request frequency and request parameters, and request time.

[0078] Based on the characteristics and business rules of different request content, determine the type of web workers required to process different request content;

[0079] Based on the request frequency and request parameters, determine the number of different web worker types when processing different request content;

[0080] Based on the types of web workers required for different request content and the number required for different types of web workers, a shared scheduling model is established. The shared scheduling model includes web worker configuration schemes for different request content. The web worker configuration schemes include the number of web workers to be configured and the types of web workers. The types of web workers include CPU-intensive, IO-intensive, and hybrid types.

[0081] If the requested content is identified, the corresponding web worker configuration scheme is extracted from the shared scheduling model.

[0082] In this embodiment, a log collection tool is used to acquire different request content from the browser and related attribute information of the request content. The related attribute information includes request volume, request frequency, request parameters, and request time, resulting in the original request dataset. Based on the request time attribute in the request dataset, the request data is segmented according to the time dimension, and a sliding window approach is used to obtain subsets of request data within different time periods. For each time period subset, statistical analysis methods are used to calculate the quantity and proportion of each request content, obtaining the distribution of different request content and identifying which requests are high-frequency. A clustering algorithm is used to group request parameters, dividing requests into different clusters based on the similarity of request parameters to obtain common features of request parameters and determine parameter patterns for different request content. An association rule mining algorithm is used to discover the association relationships between different request content in the request dataset, obtaining combination patterns of request content and determining the characteristics of requests under different combinations. An anomaly detection algorithm is used to construct multi-dimensional features based on request attribute information, and algorithms such as Isolation Forest are used to identify anomalies in the request data, obtaining the distribution of abnormal requests. By combining the information obtained from the above analysis, such as request distribution, parameter patterns, combination characteristics, and abnormal situations, we can comprehensively characterize the characteristics of different request content and obtain the final request analysis results.

[0083] In this embodiment, based on the URL and request parameters of the request content, expert experience and business rules are used to initially determine the type of the request content, such as query, computation, or update, to obtain a preliminary classification result. Using this preliminary classification result, the computing resources typically required for this type of request content are obtained, such as CPU-intensive or I / O-intensive, to preliminarily determine the web worker types that typically need to be configured for this request content. Based on factors such as the business importance and response time requirements of the request content, business rules are used to adjust the preliminary web worker types to obtain the final web worker types to be allocated. Using runtime data such as the concurrency and request frequency of the request content, the number of different types of web workers is dynamically adjusted to match the real-time load characteristics of the requests, achieving optimal resource utilization and request processing performance. Based on feedback information such as anomalies and error rates during request processing, expert experience is used to dynamically adjust the rules for judging request content and selecting web worker types to adapt to business changes and obtain a continuously optimized request processing strategy.

[0084] Specifically, rule-based classification algorithms, such as decision trees or random forests, are used to categorize request content into query, computation, and update types. For query requests, web workers are typically I / O intensive, with high I / O throughput. For computation requests, web workers are typically CPU intensive, with high CPU performance to handle large amounts of computation. For update requests, web workers are typically hybrid, combining I / O and CPU requirements, necessitating a comprehensive consideration of both I / O and CPU configurations. For example, if the URL of the request content is " / query / user?id=123", parsing the URL reveals the URL path " / query / user" and the request parameter "id=123". Based on expert experience, this is determined to be a query request, requiring a query to retrieve user information with ID 123 from the database. Furthermore, a weighted scoring model is used to assign weights to different request content based on business importance and response time requirements. For instance, an order payment request is weighted at 8, while an ad display request is weighted at 2. The web worker configuration for different request content is dynamically adjusted at different times to achieve differentiated resource allocation. Furthermore, by monitoring metrics such as request concurrency and frequency, time series forecasting algorithms, such as ARIMA or LSTM, are used to predict the request load over a future period. This dynamically adjusts the number of different types of web workers, maintaining resource utilization above 80% and keeping the average request response time below 200ms. Finally, based on feedback data such as anomaly and error rates during request processing, reinforcement learning algorithms, such as Q-learning or DQN, are used to adaptively adjust request classification and web worker selection strategies. This continuous optimization of strategies leads to a sustained improvement in the overall processing performance and stability of the system.

[0085] S300. Based on the requested content trend model, a web worker pre-configuration scheme is obtained through the shared scheduling model. The web worker pre-configuration scheme is a pre-determined web worker configuration scheme.

[0086] In some embodiments, the above steps include:

[0087] Obtain the user's login information, and based on the login information, obtain the user's request trend, where the request trend is the probability of the user requesting different content.

[0088] The probability of requesting different content is compared with the preset request threshold in turn;

[0089] For request content with a request probability higher than the preset request threshold, the web worker configuration scheme for the request content is obtained from the shared scheduling model. A load balancing algorithm is used to obtain the load status of each web worker type. The request content is pre-assigned to the low-load web worker type for processing according to the web worker configuration scheme. The load status includes high load and low load.

[0090] For request content with a request probability lower than the preset request threshold, compare the request probabilities of each request content, obtain the request content with the highest request probability, and obtain the web worker configuration scheme for the request content with the highest request probability from the shared scheduling model.

[0091] In this embodiment, based on the username and password entered by the user on the login page, an HTTP POST request is used to submit the login information to the server for verification. The server queries the user information database to obtain the user account information matching the submitted username. The encrypted password for that user account is retrieved from the database, and the submitted password is encrypted using an encryption algorithm. The encrypted password is compared with the password stored in the database to determine if the user's password is correct. If the passwords match, the user is considered to have logged in successfully, and user request data corresponding to that username is obtained. Based on the user attributes in the obtained user request data, the user group to which the user belongs is determined. A user session is created on the server side using a session mechanism, and the user request data and the user's user group information are stored in the session to obtain user session information. A cookie containing the session ID is sent to the browser via an HTTP response to identify the user in subsequent requests. After obtaining the cookie containing the session ID, the browser stores it locally and carries the cookie in every subsequent request. After receiving the browser's request, the server obtains the corresponding user session information through the session ID in the cookie. The system obtains user group information and user request data from user session information. Based on this information, it calculates the probability of each content request made by the user upon entering the browser at the current time. For requests with a probability lower than a preset threshold, such as requests for different functional modules within a browser page, the system prioritizes the request with the highest probability. It pre-determines the required web worker types and the number of web workers needed for each type from a shared scheduling model. For requests with a probability exceeding the preset threshold, such as page loading requests, it does not wait for user requests but uses a load balancing algorithm to pre-allocate requests to lower-loaded web workers according to their current load. Based on this, the browser can respond quickly when a user requests content, thereby improving user experience and website performance.

[0092] In some embodiments, after step S300 described above, the following is included:

[0093] Obtain the user's current request content and divide the request content into multiple sub-tasks;

[0094] Data dependency analysis and computational complexity analysis are performed on multiple subtasks to obtain the scheduling order and execution method among different subtasks, wherein the execution method includes synchronous execution and asynchronous execution.

[0095] Based on the aforementioned scheduling order and execution method, a web worker scheduling scheme is determined;

[0096] A thread pool management approach is adopted, and instances are created based on the web workers scheduling scheme. The working mode of the instances is dynamically adjusted according to the computational complexity and data dependencies of the subtasks. The working mode includes creating instances, destroying instances, and modifying instance parameters. The instances are used to execute the subtasks.

[0097] Specifically, web workers are a valuable resource, but their creation cost is relatively high. When one web worker is destroyed, it may affect the communication between different web workers, as well as the communication between the main thread and other web workers. Therefore, in this embodiment, a thread pool management method is adopted to set up instances on different web workers. By dynamically adjusting the working mode of the instances, the execution of tasks can be realized, while ensuring the stability of communication between web workers.

[0098] In this embodiment, by dividing the request content into multiple subtasks and encapsulating the subtasks into instances, and performing operations such as creation and destruction on the web workers through the instances, different types of subtasks are clustered and assigned to different types of web workers, controlling the resource consumption of each web worker, avoiding a single request occupying too many resources and affecting the processing of other requests, and the resources in the web workers can be released in a timely manner, thereby improving resource utilization, the system's concurrent processing capability, and response speed.

[0099] In some embodiments, dividing the current user request into multiple subtasks, performing data dependency analysis and computational complexity analysis on the multiple subtasks to obtain the scheduling order and execution method among different subtasks, and determining a web worker scheduling scheme based on the scheduling order and the execution method includes:

[0100] Based on the business attributes of the current user request, a task decomposition algorithm is used to divide the user request into multiple sub-tasks;

[0101] By analyzing the business logic relationships between subtasks, a dependency graph of the subtasks is constructed.

[0102] Based on the dependency graph, different subtasks are divided into multiple task groups;

[0103] Execute subtasks in different task groups synchronously, and execute subtasks in the same task group asynchronously according to their dependencies;

[0104] Analyze the computational complexity of each subtask, and calculate the sum of the computational complexities of the subtasks across different task groups;

[0105] Obtain the current device's performance data, and determine the web worker scheduling scheme based on the total computational complexity.

[0106] In this embodiment, based on the business attributes of the current user request, a task decomposition algorithm is used to divide the user request into multiple subtasks, resulting in a subtask set T = {t1, t2, ..., tn}. By analyzing the business logic relationships between subtasks, a directed acyclic graph G = (V, E) is constructed, where V represents a subtask node and E represents the dependency relationship between subtasks, thereby obtaining the topological sorting result of the subtasks and the dependency graph of the subtasks. From the dependency graph, the dependencies between subtasks can be obtained. Based on the dependencies between subtasks, different subtasks are divided into multiple task groups, where subtasks within the same task group have dependencies. Based on the topological sorting result within the same task group, a critical path algorithm is used to calculate the earliest start time and latest end time of each subtask, determine the critical path of the subtask, and obtain the execution order of subtasks within the same task group. By analyzing the business characteristics and resource requirements of the subtasks, heuristic algorithms, such as genetic algorithms or ant colony algorithms, are used to optimize the execution method of subtasks within the same task group, such as synchronous or asynchronous execution, to obtain the optimal task scheduling scheme. Within the same task group, each subtask is executed according to the optimal task scheduling scheme. There are no dependencies between different task groups, so they can be executed independently and in parallel, thereby improving the response speed of requested content.

[0107] In this embodiment, Big O notation is used to analyze the computational complexity of each subtask, obtaining the computational complexity function of each subtask. The addition rule is used to sum the computational complexity functions of subtasks within the same task group to obtain the total computational complexity function. Based on the magnitude of the total computational complexity function, the execution type of each task group is determined. Execution types include computationally intensive, I / O intensive, and hybrid. Specifically, if the magnitude of the total computational complexity function is high, such as O(n^2) or higher, then the task group is computationally intensive. If the magnitude of the total computational complexity function is low, such as O(1) or O(logn), and the subtasks mainly involve I / O operations, then the task group is I / O intensive. If the magnitude of the total computational complexity function is moderate, such as O(n), and the tasks involve both computational operations and some I / O operations, then the task group is hybrid. Computationally intensive task groups are assigned to CPU-intensive web worker types, I / O-intensive task groups are assigned to I / O-intensive web worker types, and mixed task groups are assigned to mixed web worker types. For computationally intensive task groups, the shortest job first algorithm is used, for I / O-intensive task groups, the first-come-first-served algorithm is used, and for mixed task groups, a multi-level feedback queue algorithm is used.

[0108] In this embodiment, a real-time data monitoring system is used to dynamically acquire current browser device performance data, such as CPU utilization and memory utilization. Based on the CPU utilization and the number of subtasks in the computationally intensive task group, the number of CPU-intensive web workers is determined. The shortest job first (SFB) algorithm is used to sequentially allocate the subtasks in the task group to each web worker. Simultaneously, corresponding instances are created within each web worker, encapsulating each subtask within an instance. This facilitates the creation and destruction of subtasks, ensuring timely resource release within the web workers, improving resource utilization, and ultimately resulting in smoother browser operation and significantly enhanced browser page performance and user experience. Similarly, based on the memory utilization and the number of subtasks in the I / O-intensive task group, the number of I / O-intensive web workers is determined. The first-come, first-served (FFS) algorithm is used to sequentially allocate the subtasks in the task group to each web worker. Simultaneously, corresponding instances are created within each web worker, encapsulating each subtask within an instance. This facilitates the creation and destruction of subtasks.

[0109] S400. Employ transfer learning technology to establish a pre-trained model, which is used to generate pre-configuration schemes for web workers in different business domains.

[0110] In some embodiments, step S400 above includes:

[0111] Acquire user request data from different business domains, embed the user request data from different business domains into a pre-trained model using pre-trained words, and obtain high-dimensional feature vectors;

[0112] The high-dimensional feature vector is processed using a graph neural network, and the dependencies between different business domains are obtained by learning the relationship between nodes and edges.

[0113] An adversarial learning method is used to train user request data between a target business domain and a source business domain to generate a domain knowledge base. The target business domain is a new business domain to be learned, and the source business domain is a business domain that has already been learned. The domain knowledge base includes a request content trend model and a shared scheduling model.

[0114] Using the domain knowledge base, transferable knowledge components are automatically recommended for new business domains, and based on these knowledge components, pre-configured web workers schemes for the new domains are generated.

[0115] In this embodiment, user request data from different business domains is acquired using data acquisition techniques. Through data cleaning and preprocessing, a high-quality user request dataset is obtained. A pre-trained word embedding model, such as Word2Vec or GloVe, is used to vectorize the user request data from different business domains. Through vector space mapping, high-dimensional feature vectors are obtained to represent the user request features of different domains. Based on these high-dimensional feature vectors, a graph neural network model is constructed. By defining the relationships between nodes and edges, and using algorithms such as graph convolution, the dependencies between different business domains are learned, obtaining inter-domain relational feature representations. An adversarial learning method is employed, using user request data from the target business domain as input to the generator and user request data from the source business domain as input to the discriminator. Through game-theoretic learning between the generator and discriminator, common feature representations between the two domains are obtained, forming cross-domain knowledge transfer capabilities. Based on the cross-domain feature representations obtained through adversarial learning, knowledge distillation techniques are used to compress and optimize the knowledge components of the source domain, obtaining transferable knowledge components suitable for the target domain, forming a domain knowledge base. For new business domains, knowledge components related to the new domain are obtained by querying the domain knowledge base and using methods such as similarity calculation. Based on the applicability and transferability of these knowledge components, an optimal recommended list of knowledge components is determined, enabling automatic cross-domain knowledge transfer and reuse. Employing online learning and incremental learning technologies, the domain knowledge base is continuously optimized and updated based on user requests and feedback from the new business domain. Through continuous accumulation and learning, a more comprehensive and accurate cross-domain knowledge transfer capability is acquired, providing a more intelligent and efficient knowledge component recommendation service for the new business domain. This allows the intelligent scheduling method for web workers to adapt to different business domains, achieving efficient processing of cross-domain tasks and improving the method's practicality.

[0116] Specifically, for example, 1 million user request data points are collected from different business domains such as e-commerce platforms, social platforms, and real-time data analysis platforms. Pre-trained word embedding models like Word2Vec are used to transform the text data into 300-dimensional high-dimensional feature vectors. These high-dimensional feature vectors are then used to construct a graph neural network with 1000 nodes and 10,000 edges. Nodes represent user requests from different business domains, and edges represent the correlations between them. A graph convolutional neural network is used to aggregate node features and learn the dependencies between different business domains. Assuming the social platform is the target domain and the e-commerce platform is the source domain, a generative adversarial network is used to train the user request data on them, generating a domain knowledge base containing 5000 triples (entity, relation, entity). When a new user request appears on the social platform, through entity linking and relation reasoning techniques in the knowledge base, functional components related to the pre-configured web workers scheme in the e-commerce platform are automatically recommended, such as shared scheduling models and request content trend models. This achieves cross-domain knowledge transfer, enabling the pre-configured web workers scheme from the e-commerce platform to the social platform.

[0117] Please see Figure 2 As shown, the present invention also provides an intelligent scheduling system based on web workers, the system comprising:

[0118] First processing module 201: Acquires historical user request data, uses a decision tree algorithm to perform data analysis on the historical user request data, and establishes a request content trend model;

[0119] Second processing module 202: Establish a shared scheduling model, which is used to share web worker configuration schemes between different request contents. The web worker configuration scheme includes the number of web workers to be configured for different request contents and the type of web workers.

[0120] The third processing module 203: Based on the request content trend model, it obtains a pre-configuration scheme for web workers through the shared scheduling model. The pre-configuration scheme for web workers is a pre-determined configuration scheme for web workers.

[0121] Fourth processing module 204: Employs transfer learning technology to establish a pre-trained model, which is used to generate pre-configuration schemes for web workers in different business domains.

[0122] It is understandable that, such as Figure 1The content of the web worker-based intelligent scheduling method embodiments shown is applicable to the web worker-based intelligent scheduling system embodiments. The specific functions implemented in the web worker-based intelligent scheduling system embodiments are the same as those shown below. Figure 1 The implementation of the intelligent scheduling method based on web workers shown is the same, and the beneficial effects achieved are the same as those described above. Figure 1 The beneficial effects achieved by the web workers-based intelligent scheduling method embodiment shown are also the same.

[0123] It should be noted that the information interaction and execution process between the above systems are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.

[0124] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0125] Please see Figure 3 The present invention also provides a computer device 3, including: a memory 302 and a processor 301, and a computer program 303 stored in the memory 302. When the computer program 303 is executed on the processor 301, it implements the intelligent scheduling method based on web workers as described in any of the above methods.

[0126] The computer device 3 may be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device 3 may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will understand that... Figure 3The computer device 3 is merely an example and does not constitute a limitation on the computer device 3. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, etc.

[0127] The processor 301 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0128] In some embodiments, the memory 302 may be an internal storage unit of the computer device 3, such as a hard disk or memory of the computer device 3. In other embodiments, the memory 302 may be an external storage device of the computer device 3, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 3. Furthermore, the memory 302 may include both internal and external storage units of the computer device 3. The memory 302 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 302 can also be used to temporarily store data that has been output or will be output.

[0129] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the intelligent scheduling method based on web workers as described in any of the above methods.

[0130] In this embodiment, if the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0131] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. An intelligent scheduling method based on web workers, characterized in that, include: Historical user request data is obtained, and a decision tree algorithm is used to analyze the historical user request data to establish a request content trend model. A shared scheduling model is established, which is used to share the web worker configuration scheme among different request contents. The web worker configuration scheme includes the number of web workers to be configured for different request contents and the type of web workers. Based on the requested content trend model, a pre-configuration scheme for web workers is obtained through the shared scheduling model. The pre-configuration scheme for web workers is a pre-determined configuration scheme for web workers. A pre-trained model is established using transfer learning technology. This pre-trained model is used to generate pre-configuration schemes for web workers in different business domains. The establishment of a shared scheduling model, used to share web worker configuration schemes across different request content, includes: collecting different request content to obtain request datasets for various request content; based on the relevant attribute information of the request datasets, using data analysis methods to obtain the characteristics of different request content, the relevant attribute information including request volume, request frequency, request parameters, and request time; determining the types of web workers required to process different request content based on the characteristics and business rules of different request content; determining the number of different web worker types when processing different request content based on the request frequency and request parameters; establishing a shared scheduling model based on the required web worker types and the required number of different web worker types, the shared scheduling model including web worker configuration schemes for different request content, the web worker configuration scheme including the number of web workers to be configured and the web worker types, the web worker types including CPU-intensive, IO-intensive, and combined types; if request content is identified, extracting the corresponding web worker configuration scheme from the shared scheduling model; The method employs transfer learning technology to establish a pre-trained model, which is used to generate pre-configuration schemes for web workers in different business domains. This includes: acquiring user request data from different business domains; inputting the user request data from different business domains into a pre-trained word embedding model for training to obtain high-dimensional feature vectors; processing the high-dimensional feature vectors using a graph neural network, and learning the dependencies between different business domains through the relationships between nodes and edges; training the user request data between the target business domain and the source business domain using an adversarial learning method to generate a domain knowledge base, wherein the target business domain is a new business domain to be learned, and the source business domain is a business domain that has already been learned; the domain knowledge base includes a request content trend model and a shared scheduling model; and automatically recommending transferable knowledge components for the new business domain using the domain knowledge base, and generating a pre-configuration scheme for web workers in the new domain based on the knowledge components.

2. The method as described in claim 1, characterized in that, The process of acquiring historical user request data and using a decision tree algorithm to analyze the historical user request data and establish a request content trend model includes: Based on user behavior, historical user request data is obtained using event tracking technology. The user request data includes user ID, request time, request content, operating system, browser, and user attributes. The historical user request data is classified according to the request content and request time to obtain a user request dataset based on the request content and request time. Based on the user request dataset, a request content trend model is established using the decision tree algorithm, with operating system, browser and user attributes as feature variables. Based on the requested content trend model, the user's request trend is predicted at a preset time, where the request trend is the probability of the user requesting different content.

3. The method as described in claim 1, characterized in that, The step of obtaining a pre-configuration scheme for web workers based on the request content trend model and the shared scheduling model includes: Obtain the user's login information, and based on the login information, obtain the user's request trend, where the request trend is the probability of the user requesting different content. The probability of requesting different content is compared with the preset request threshold in turn; For request content with a request probability higher than the preset request threshold, the web worker configuration scheme for the request content is obtained from the shared scheduling model. A load balancing algorithm is used to obtain the load status of each web worker type. The request content is pre-assigned to the low-load web worker type for processing according to the web worker configuration scheme. The load status includes high load and low load. For request content with a request probability lower than the preset request threshold, compare the request probabilities of each request content, obtain the request content with the highest request probability, and obtain the web worker configuration scheme for the request content with the highest request probability from the shared scheduling model.

4. The method as described in claim 1, characterized in that, After obtaining the pre-configuration scheme for web workers based on the request content trend model and the shared scheduling model, the process includes: Obtain the user's current request content and divide the request content into multiple sub-tasks; Data dependency analysis and computational complexity analysis are performed on multiple subtasks to obtain the scheduling order and execution method among different subtasks, wherein the execution method includes synchronous execution and asynchronous execution. Based on the aforementioned scheduling order and execution method, a web worker scheduling scheme is determined; A thread pool management approach is adopted, and instances are created based on the web workers scheduling scheme. The working mode of the instances is dynamically adjusted according to the computational complexity and data dependencies of the subtasks. The working mode includes creating instances, destroying instances, and modifying instance parameters. The instances are used to execute the subtasks.

5. The method as described in claim 4, characterized in that, The step of determining the web worker scheduling scheme based on the scheduling order and the execution method includes: Based on the business attributes of the current user request, a task decomposition algorithm is used to divide the user request into multiple sub-tasks; By analyzing the business logic relationships between subtasks, a dependency graph of the subtasks is constructed. Based on the dependency graph, different subtasks are divided into multiple task groups; Execute subtasks in different task groups synchronously, and execute subtasks in the same task group asynchronously according to their dependencies; Analyze the computational complexity of each subtask, and calculate the sum of the computational complexities of the subtasks across different task groups; Obtain the current device's performance data, and determine the web worker scheduling scheme based on the total computational complexity.

6. An intelligent scheduling system based on web workers, characterized in that, include: First processing module: acquires historical user request data, uses decision tree algorithm to perform data analysis on the historical user request data, and establishes a request content trend model; The second processing module establishes a shared scheduling model, which is used to share web worker configuration schemes for different request contents. The web worker configuration scheme includes the number of web workers to be configured for different request contents and the type of web workers. The third processing module: Based on the request content trend model, and through the shared scheduling model, obtains a pre-configured web worker scheme, wherein the pre-configured web worker scheme is a pre-determined web worker configuration scheme; The fourth processing module employs transfer learning technology to establish a pre-trained model, which is used to generate pre-configuration schemes for web workers in different business domains. The establishment of a shared scheduling model, used to share web worker configuration schemes across different request content, includes: collecting different request content to obtain request datasets for various request content; based on the relevant attribute information of the request datasets, using data analysis methods to obtain the characteristics of different request content, the relevant attribute information including request volume, request frequency, request parameters, and request time; determining the types of web workers required to process different request content based on the characteristics and business rules of different request content; determining the number of different web worker types when processing different request content based on the request frequency and request parameters; establishing a shared scheduling model based on the required web worker types and the required number of different web worker types, the shared scheduling model including web worker configuration schemes for different request content, the web worker configuration scheme including the number of web workers to be configured and the web worker types, the web worker types including CPU-intensive, IO-intensive, and combined types; if request content is identified, extracting the corresponding web worker configuration scheme from the shared scheduling model; The method employs transfer learning technology to establish a pre-trained model, which is used to generate pre-configuration schemes for web workers in different business domains. This includes: acquiring user request data from different business domains; inputting the user request data from different business domains into a pre-trained word embedding model for training to obtain high-dimensional feature vectors; processing the high-dimensional feature vectors using a graph neural network, and learning the dependencies between different business domains through the relationships between nodes and edges; training the user request data between the target business domain and the source business domain using an adversarial learning method to generate a domain knowledge base, wherein the target business domain is a new business domain to be learned, and the source business domain is a business domain that has already been learned; the domain knowledge base includes a request content trend model and a shared scheduling model; and automatically recommending transferable knowledge components for the new business domain using the domain knowledge base, and generating a pre-configuration scheme for web workers in the new domain based on the knowledge components.

7. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 5.