Scheduling processing method and device, electronic equipment and storage medium
By analyzing the rule language text, generating the scheduling service mapping relationship and updating the scheduling service strategy, the problem of low efficiency in scheduling policy updates in the existing technology is solved, and fast response and efficient scheduling service strategy updates are achieved.
Patent Information
- Application Number
- CN202411101940.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-12-13
AI Technical Summary
When existing scheduling systems face complex and customized needs, they are difficult to respond quickly and update scheduling strategies, resulting in long development cycles and low efficiency.
By analyzing the rule language text input by the user, a scheduling service mapping relationship is generated based on predetermined lexical rules and grammatical rules, the scheduling service policy is updated, and the scheduling service type matching and priority determination are realized.
You can update the scheduling service strategy without redeveloping the code, reduce manual workload, improve the speed of scheduling service strategy going online, and adapt to complex and customized needs.
Smart Images

Figure CN119127166A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a scheduling processing method, device, electronic device and storage medium. Background Art
[0002] At present, for various systems that need to be scheduled, such as video scheduling systems, common requirements are complex and highly customized, and it is difficult to achieve the goal through mapping-based templates. Whenever new requirements are proposed, it is often necessary to redevelop the code to implement the requirements, and the online cycle is long. Summary of the invention
[0003] The embodiments of the present application provide a scheduling processing method, device, electronic device and storage medium to solve the technical problem of low efficiency in the application of scheduling strategies.
[0004] According to one aspect of an embodiment of the present application, a scheduling processing method is provided, including: in response to detecting a rule language text input by a user, parsing the rule language text based on predetermined lexical rules and predetermined grammatical rules; updating a scheduling service policy based on the parsing result of the rule language text; the scheduling service policy is used to respond to a target request for a scheduling service.
[0005] Further, the parsing of the rule language text based on predetermined lexical rules and predetermined grammatical rules includes: dividing the rule language text into at least one character string based on predetermined lexical rules and at least one identifier in the rule language text; determining at least one scheduling service type and a matching condition corresponding to the scheduling service type based on predetermined grammatical rules, the identifier and the character string; and generating a scheduling service mapping relationship as a parsing result based on the scheduling service type and the corresponding matching condition.
[0006] Further, the predetermined grammar rule is a grammar tree, and determining at least one scheduling service type and a matching condition corresponding to the scheduling service type based on the predetermined grammar rule, the identifier and the character string includes: determining a grammar tree branch that matches the identifier and the character string based on a progressive rule corresponding to the grammar tree; determining at least one scheduling service type and a matching condition corresponding to the scheduling service type based on the grammar tree branch.
[0007] Further, updating the scheduling service policy based on the parsing result of the rule language text includes: adding the scheduling service mapping relationship to the policy content of the scheduling service policy, or determining the scheduling service mapping relationship as a new scheduling service policy.
[0008] Further, after updating the scheduling service policy based on the parsing result of the rule language text, the method also includes: in response to the received target request, obtaining the request characteristics in the target request; determining the scheduling service type that matches the request characteristics based on at least one matching condition in the scheduling service policy; querying the service node that matches the scheduling service type; and responding to the target request based on the service node.
[0009] Further, the determining of the scheduling service type that matches the request feature based on at least one matching condition in the scheduling service policy includes: verifying the request feature specified by the matching condition based on a function in at least one matching condition in the scheduling service policy to obtain an output value; comparing the output value with a target verification value corresponding to the request feature specified in the matching condition to see if they are consistent; if the output value is consistent with the target verification value, determining that the request feature hits the matching condition; and determining that the scheduling service type corresponding to the matching condition is the scheduling service type that matches the request feature.
[0010] Further, determining the scheduling service type that matches the request feature based on at least one matching condition in the scheduling service policy includes: determining the number of matching conditions in the scheduling service policy that the request feature hits; if the request feature hits one matching condition, determining the scheduling service type corresponding to the matching condition that the request feature hits is the scheduling service type that matches the request feature; if the request feature hits multiple matching conditions, determining the scheduling service type with the highest priority among multiple scheduling service types corresponding to the multiple matching conditions that the request feature hits is the scheduling service type that matches the request feature.
[0011] According to another aspect of an embodiment of the present application, a scheduling processing device is also provided, including: a parsing module, used to parse the rule language text based on predetermined lexical rules and predetermined grammatical rules in response to detecting a rule language text input by a user; an updating module, used to update a scheduling service policy based on the parsing result of the rule language text; the scheduling service policy is used to respond to a target request for a scheduling service.
[0012] Furthermore, the parsing module is specifically used to: divide the rule language text into at least one character string based on predetermined lexical rules and at least one identifier in the rule language text; determine at least one scheduling service type and a matching condition corresponding to the scheduling service type based on predetermined grammatical rules, the identifier and the character string; and generate a scheduling service mapping relationship as a parsing result based on the scheduling service type and the corresponding matching condition.
[0013] Furthermore, the predetermined grammar rule is a grammar tree, and the parsing module is specifically used to: determine the grammar tree branch that matches the identifier and the string based on the progressive rule corresponding to the grammar tree; determine at least one scheduling service type and the matching condition corresponding to the scheduling service type based on the grammar tree branch.
[0014] Furthermore, the updating module is specifically used to: add the scheduling service mapping relationship to the policy content of the scheduling service policy, or determine the scheduling service mapping relationship as a new scheduling service policy.
[0015] Furthermore, the device also includes: an execution module, which is used to obtain the request characteristics in the target request in response to receiving the target request after updating the scheduling service policy based on the parsing results of the rule language text; determine the scheduling service type that matches the request characteristics based on at least one matching condition in the scheduling service policy; query the service node corresponding to the scheduling service type that matches the request characteristics; and respond to the target request based on the service node.
[0016] Furthermore, the execution module is specifically used to: verify the request feature specified by the matching condition based on the function in at least one matching condition in the scheduling service policy to obtain an output value; compare the output value with the target verification value corresponding to the request feature specified in the matching condition to see if they are consistent; if the output value is consistent with the target verification value, determine that the request feature hits the matching condition; and determine that the scheduling service type corresponding to the matching condition is the scheduling service type matched by the request feature.
[0017] Furthermore, the execution module is specifically used to: determine the matching conditions that the request feature meets; if the request feature meets only one matching condition, determine the number of matching conditions that the request feature hits in the scheduling service policy; if the request feature hits only one matching condition, determine that the scheduling service type corresponding to the matching condition that the request feature hits is the scheduling service type matched by the request feature; if the request feature hits multiple matching conditions, determine that the one with the highest priority among the multiple scheduling service types corresponding to the multiple matching conditions that the request feature hits is the scheduling service type matched by the request feature.
[0018] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.
[0019] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the program stored in the memory.
[0020] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.
[0021] The embodiments of the present application propose a scheduling processing method, device, electronic device and storage medium. In response to detecting a rule language text input by a user, the rule language text is parsed based on predetermined lexical rules and predetermined grammatical rules; the scheduling service policy is updated based on the parsed result of the rule language text; the scheduling service policy is used to respond to a target request for a scheduling service. In this way, when new requirements arise, the scheduling service policy can be updated by simply modifying the rule language text, without the need to redevelop new code, reducing manual workload and increasing the speed of scheduling service policy launch. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0023] Figure 1 is a hardware structure block diagram of a computer according to an embodiment of the present application;
[0024] Figure 2 is a flowchart of a scheduling processing method according to an embodiment of the present application;
[0025] Figure 3 is a flowchart of a scheduling processing method according to an embodiment of the present application;
[0026] Figure 4 is a structural block diagram of a scheduling processing device according to an embodiment of the present application;
[0027] Figure 5 It is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application 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 data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device comprising 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.
[0030] The method embodiment provided in the first embodiment of the present application can be executed in a mobile phone, a computer, a tablet or a similar computing device. Taking running on a computer as an example, Figure 1 is a hardware structure block diagram of a computer in an embodiment of the present application. Figure 1 As shown, the computer may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the computer may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0031] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a scheduling processing method in an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0032] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0033] In this embodiment, a scheduling processing method is provided. Figure 2 is a flowchart of a scheduling processing method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0034] S10: In response to detecting the rule language text input by the user, parsing the rule language text based on predetermined lexical rules and predetermined grammatical rules.
[0035] In this embodiment, the scheduling processing method can be applied to scheduling systems of various resources, such as a content delivery network (CDN) video scheduling system, etc. The user can be a maintenance personnel or a management personnel, etc. The rule language text can be a text input by the user for adjusting the scheduling service strategy, wherein the text can be in Chinese or other languages, and is used to specify the rules of the scheduling service.
[0036] In one embodiment, the predetermined lexical rule can be used for word segmentation, for example, it can be a lexical table, etc., and the predetermined grammatical rule can be a grammatical tree, etc. For example, the lexical table and the grammatical tree can be defined based on the grammatical rules of lex&yacc. The lexical table can be a lexical table based on regular grammar, etc., and the grammatical tree can be a grammatical spanning tree based on context-free grammar, etc.
[0037] In one embodiment, the parsing result obtained by parsing the rule language text may include a scheduling service mapping relationship between the scheduling service type and the matching condition. For example, it may include one or more scheduling service types and a matching condition corresponding to each scheduling service type.
[0038] In one embodiment, the parsing of the rule language text based on predetermined lexical rules and predetermined grammatical rules may include: dividing the rule language text into at least one string based on predetermined lexical rules and at least one identifier in the rule language text; determining at least one scheduling service type and a matching condition corresponding to the scheduling service type based on predetermined grammatical rules, the identifier and the string; and generating a scheduling service mapping relationship as a parsing result based on the scheduling service type and the corresponding matching condition.
[0039] Here, dividing the rule language text into at least one string based on a predetermined lexical rule and at least one identifier in the rule language text may include: dividing the rule language text into at least one string based on a lexical table and the type of at least one identifier in the rule language text. The identifier may be a grammar rule character (token), which may be used to perform word segmentation, sentence segmentation, line segmentation, etc. on the rule language text. For example, the grammar rule character may include at least one of the following:
[0040] '\n' line break, each line corresponds to 1 target service type, 1 set of conditions, and 1 priority;
[0041] '@' is the symbol used to separate the "target service type" and "condition list" in each line;
[0042] "Symbol used to separate "condition list" and "priority" in each line;
[0043] '&' represents logical AND, that is, the "condition list" is a logical AND connection of the "conditions" in the list;
[0044] '~' indicates logical negation, that is, each "condition" can be logically negated. When the original proposition is False, the "condition" is considered True;
[0045] '=' is a symbol used to separate function name, parameters, and matching values in each condition.
[0046] In one embodiment, the character string may represent at least one phrase or word sequence, and may include, for example, at least one of the following: scheduling service type, function name, parameter, target check value, priority of scheduling service type, and the like.
[0047] In one embodiment, the matching condition may include or specify at least one of the following: a request feature corresponding to the scheduling service type, a function for verifying the request feature, and a target verification value corresponding to the function. The request feature included in the matching condition is one or more request features specified by the matching condition, and the request feature may be a feature determined based on the target request, for example, it may include at least one of the request source Internet Protocol (IP) address, request time, requester identity information, request parameter list, request header information, etc. The request parameter list may include at least one parameter corresponding to the target request, for example, it may include parameters such as the video bit rate, definition, and duration of the request.
[0048] In one embodiment, the request feature may be a request parameter, and the matching condition may include or specify at least one of the following: a request parameter corresponding to the scheduling service type, a function for verifying the request parameter, and a target verification value corresponding to the function.
[0049] In one embodiment, the function is used to verify the request parameters corresponding to the scheduling service type. When the output value of the request parameter verified based on the function is equal to the target verification value in the matching condition, it is determined that the request parameter hits the matching condition. When all request parameters included in the matching condition hit the matching condition, it is determined that the target request hits the matching condition, and the scheduling service type corresponding to the matching condition is determined to be the scheduling service type matched by the target request.
[0050] In one embodiment, the scheduling service strategy may further include: at least one predetermined logical operator and a predetermined function set. The predetermined function set may include at least one function for verifying request parameters, for example, at least one of the following: a string complete matching function, a string prefix matching function, a string inclusion function, a string regular matching function, etc. The predetermined logical operator may include logical AND, logical NOT, and may also include logical OR, logical XOR, etc.
[0051] In this way, you only need to pre-define some functions and logical operators without storing a large amount of code. When the requirements need to be updated, you can enter the required rule language text to implement the requirement update and system launch, thereby improving the launch efficiency.
[0052] In one embodiment, detecting the rule language text input by the user may include detecting the rule language text input by the user within a predetermined time period or within a predetermined period. For example, the predetermined time period may be a fixed time period every day, a fixed time period every week, or a fixed time period every month, etc., and the predetermined period may be a fixed value, or a value determined according to the number of times the rule language text has been input, etc. In this way, the rule language text may be allowed to be updated within a fixed time period or a fixed period, thereby improving the centralization of system update and online launch, and improving service efficiency.
[0053] S20: updating the scheduling service policy based on the parsing result of the rule language text; the scheduling service policy is used to respond to the target request for the scheduling service.
[0054] In this embodiment, updating the scheduling service policy based on the parsing result of the rule language text may include updating the scheduling service policy based on the scheduling service mapping relationship obtained by parsing. For example, it may include adding the scheduling service mapping relationship to the policy content of the scheduling service policy, or determining the scheduling service mapping relationship as a new scheduling service policy. Exemplarily, determining the scheduling service mapping relationship as a new scheduling service policy may include: deleting the original mapping relationship in the scheduling service policy, and re-adding the scheduling service mapping relationship to the policy content of the scheduling service policy.
[0055] In one embodiment, the target request may be used to request a scheduling service, which may be to obtain a target resource, such as downloading a video, etc. Based on the scheduling service policy, the scheduling service type corresponding to the target request may be obtained, and the required service node may be determined based on the scheduling service type. Based on the service node, the target request may be responded to.
[0056] In one embodiment, the scheduling service mapping relationship may include a corresponding relationship between the scheduling service type and the matching condition, and may also include a corresponding relationship between the scheduling service type and the service node. The service node is used for the requester of the target request to obtain the requested resource, and the scheduling service type may correspond to one or more service nodes, and multiple service nodes may be recorded in a node list. For example, for a target request to download a video, the service node may be a download node for downloading the video.
[0057] In this way, for systems with scheduling requirements, when facing various complex and highly customized requirements, the scheduling service strategy can be updated simply by entering new rule language text, without the need to redevelop new code, reducing manual workload and increasing the speed of scheduling service strategy launch.
[0058] In some embodiments, the parsing of the rule language text based on predetermined lexical rules and predetermined grammatical rules includes:
[0059] Based on a predetermined lexical rule and at least one identifier in the rule language text, dividing the rule language text into at least one character string;
[0060] Determine at least one scheduling service type and a matching condition corresponding to the scheduling service type based on a predetermined grammatical rule, the identifier and the character string;
[0061] Based on the scheduling service type and the corresponding matching condition, a scheduling service mapping relationship is generated as a parsing result.
[0062] In one embodiment, the method may further include: determining at least one scheduling service type and a service node corresponding to the scheduling service type based on a predetermined grammatical rule, the identifier and the character string. Here, the service node corresponding to a scheduling service type may be one or more. As a possible implementation, a scheduling service type may correspond to a service node list, and the service node list may include one or more service nodes.
[0063] In one embodiment, generating a scheduling service mapping relationship as a parsing result based on the scheduling service type and the corresponding matching condition may include: generating a scheduling service mapping relationship as a parsing result based on the scheduling service type and the corresponding matching condition and service node.
[0064] In one embodiment, dividing the rule language text into at least one string based on a predetermined lexical rule and at least one identifier in the rule language text may include: dividing the rule language text into at least one string based on a lexical table and the type of at least one identifier in the rule language text. For example, different strings may be divided for different types of identifiers.
[0065] In one embodiment, determining at least one scheduling service type and a matching condition corresponding to the scheduling service type based on a predetermined grammar rule, the identifier and the string may include: determining a syntax tree branch that matches the identifier and the string based on a progressive rule corresponding to the syntax tree; determining at least one scheduling service type and a matching condition corresponding to the scheduling service type based on the syntax tree branch.
[0066] Here, the recursive rule corresponding to the syntax tree may include a shift and / or reduction rule, which may be predefined. For example, the recursive rule may be a dynamic strategy-parsing result-condition list-condition-parameter list, etc.
[0067] In one embodiment, the lexical table rules may be as follows:
[0068] [\n~@&=]
[0069] return token
[0070] [^~\n@&=]+
[0071] return type<string>
[0072] EOF
[0073] return EOF
[0074] In one embodiment, the syntax tree rules may be as follows:
[0075] Parsing result|line'\n'Parsing result
[0076] |line EOF
[0077] line|target service type '@' condition list" priority
[0078] Condition List | Condition
[0079] |Condition list '&' condition
[0080] Condition | Function name' = 'Parameter list' = 'Match value
[0081] |'~'Function name'='Parameter list'='Match value
[0082] parameter list | parameter
[0083] |Parameter list '=' parameter
[0084] In this way, the rule language text is divided and parsed based on the predetermined lexical table and syntax tree to obtain the scheduling service strategy indicated by the text. The scheduling strategy corresponding to the new demand can be accurately updated to the scheduling system to achieve rapid launch.
[0085] In some embodiments, the parsing result is a scheduling service mapping relationship, and step S20 may include:
[0086] The scheduling service mapping relationship is added to the policy content of the scheduling service policy, or the scheduling service mapping relationship is determined as a new scheduling service policy.
[0087] In one embodiment, determining the scheduling service mapping relationship as a new scheduling service policy may include: deleting the original mapping relationship in the scheduling service policy, and adding the scheduling service mapping relationship to the policy content of the scheduling service policy.
[0088] In one embodiment, the scheduling service mapping relationship may include a first mapping relationship between the scheduling service type and the matching condition, and a second mapping relationship between the scheduling service type and the service node.
[0089] In one embodiment, the scheduling service mapping relationship may only include a first mapping relationship between a scheduling service type and a matching condition. At this time, using the scheduling service mapping relationship as a scheduling service strategy may include: obtaining a second mapping relationship between a scheduling service type and a service node; and using the scheduling service mapping relationship and the second mapping relationship as a scheduling service strategy.
[0090] In this way, the scheduling service mapping relationship is used as a new scheduling service strategy to quickly update the requirements and achieve accurate response to the target request.
[0091] In this embodiment, a scheduling processing method is provided. Figure 3 is a flowchart of a scheduling processing method according to an embodiment of the present application, such as Figure 3 As shown, the process includes the following steps:
[0092] S11: in response to detecting a rule language text input by a user, parsing the rule language text based on a predetermined lexical rule and a predetermined grammatical rule;
[0093] S21: updating a scheduling service policy based on the parsing result of the rule language text; the scheduling service policy is used to respond to a target request for a scheduling service;
[0094] S31: in response to receiving the target request, obtaining a request feature in the target request;
[0095] S41: Determine a scheduling service type that matches the request feature based on at least one matching condition in the scheduling service policy;
[0096] S51: Query the service node corresponding to the scheduling service type;
[0097] S61: Respond to the target request based on the service node.
[0098] In this embodiment, the specific implementation and related embodiments of steps S11 and S21 may refer to the specific implementation and related embodiments of the aforementioned steps S10 and S20, which will not be described in detail here.
[0099] In one embodiment, the target request can be used to request to obtain the target resource, such as requesting to download a video. The request features in the target request may include but are not limited to at least one of the following: request source IP address, request time, requester identity information, request parameters, request header information, etc. Among them, the request source IP address can be used to determine the regional characteristics and operator characteristics of the request; the request parameters can be recorded in the request parameter list, and can be used to determine the bit rate and definition of the video that the requester wants to download. The request header information can be used to determine information such as the client device type.
[0100] In one embodiment, the matching conditions may include features corresponding to the scheduling service type, such as the required target IP address, target time, target identity information, target parameters, etc. Based on the comparison of the features, it can be determined whether the request features meet the matching conditions.
[0101] Further, the matching condition may include at least one of the following: a request feature corresponding to the scheduling service type, a function for verifying the request feature, and a target verification value corresponding to the function.
[0102] In one embodiment, step S41 may include: determining whether the request feature hits at least one matching condition in the scheduling service policy; determining that the scheduling service type corresponding to the target matching condition hit by the request feature is the scheduling service type matched by the request feature.
[0103] In one embodiment, the request feature includes a request parameter. Determining the matching condition that the request feature hits may include: determining the matching condition that the request parameter hits based on a function corresponding to the parameter in the matching condition and a target check value.
[0104] Here, the request parameter hits the matching condition, which may include: the output value of the request parameter when verified by the function in the matching condition is consistent with the target verification value in the matching condition. Here, the request feature may be a request parameter, the matching condition may include or specify one or more request parameters, and the matching condition may also include or specify a function for verification and a corresponding target verification value for each request parameter.
[0105] In one embodiment, the request feature hits the matching condition, which may also include: the feature in the request feature other than the request parameter is consistent with the feature in the matching condition.
[0106] In one embodiment, step S41 may include: verifying the request feature specified by the matching condition based on a function in at least one matching condition in the scheduling service policy to obtain an output value; comparing the output value with a target verification value corresponding to the request feature specified in the matching condition to see if they are consistent; if the output value is consistent with the target verification value, determining that the request feature hits the matching condition; and determining that the scheduling service type corresponding to the matching condition is the scheduling service type matched by the request feature.
[0107] In one embodiment, step S41 may include: determining the number of matching conditions in the scheduling service policy hit by the request feature; if the request feature hits one matching condition, determining that the scheduling service type corresponding to the matching condition hit by the request feature is the scheduling service type matched by the request feature; if the request feature hits multiple matching conditions, determining that the scheduling service type with the highest priority among the multiple scheduling service types corresponding to the multiple matching conditions hit by the request feature is the scheduling service type matched by the request feature.
[0108] In one embodiment, determining the matching condition for the request feature hit may include: determining the matching condition for the request parameter hit. The request parameter may be recorded in a request parameter list, and the matching condition may include the request parameter corresponding to the scheduling service type, a function for verifying the request parameter, and a target verification value corresponding to the function.
[0109] Here, determining whether the request parameters meet the matching conditions may include: verifying the request parameters based on the function corresponding to the request parameters in the matching conditions; determining whether the output value of verifying the request parameters is consistent with the target verification value corresponding to the function in the matching conditions; if they are consistent, the request parameters meet the matching conditions.
[0110] In one embodiment, since the matching condition may not include all request parameters in the request feature, the matching condition that the request feature meets may mean that there are no request parameters in the request feature that do not meet the matching condition, or that all request parameters in the request feature meet the matching condition.
[0111] In one embodiment, the priority order of multiple scheduling service types may be recorded in the scheduling service policy, for example, the scheduling service mapping relationship may carry the priority order. Exemplarily, each scheduling service type in the mapping relationship may carry an identifier indicating the priority of the type.
[0112] In this way, when the request characteristics of the target request meet multiple matching conditions, the most suitable scheduling service type can be quickly determined based on the priority order, thereby improving the efficiency and adaptability of the request response.
[0113] In one embodiment, step S51 includes: querying the service node corresponding to the scheduling service type matched by the request feature. For example, the service node corresponding to the scheduling service type matched by the request feature can be queried in the scheduling service policy. The scheduling service policy can include a second mapping relationship between the scheduling service type and the service node, and the service node corresponding to the scheduling service type matched by the request feature is queried based on the second mapping relationship.
[0114] In one embodiment, responding to the target request based on the service node may include: acquiring resources corresponding to the target request based on the service node; and feeding back the resources to the requester of the target request.
[0115] In one embodiment, based on the service node responding to the target request, the method may further include: feeding back the service node to the requester of the target request.
[0116] In one embodiment, responding to the target request based on the service node may include: if there are multiple service nodes, determining a target node from the multiple service nodes, and responding to the target request based on the target node.
[0117] In this way, after parsing the rule text to update the scheduling service policy, the corresponding scheduling service type can be quickly checked and matched for the request, so as to quickly provide resource nodes and respond to the target request more accurately.
[0118] As a possible implementation, a scheduling processing method is provided, which specifically includes the following steps:
[0119] The common judgment conditions of the CDN video scheduling system, although relatively complex overall, can be divided into two parts from the perspective of mathematical logic.
[0120] The first is basic functions, such as "string complete matching function", "string prefix matching function", "string inclusion function", etc. The characteristics of this part are not easy to express with logic, but the overall number is limited. They can be predefined and called by function name.
[0121] The second is logical operations, such as logical AND, logical NOT, and XOR operations. In this part, we only need to define "logical AND" and "logical NOT" to achieve logical completeness. "Logical OR" and "logical XOR" can both be expressed using the first two.
[0122] The combination of the above two parts means that only a small number of function tables need to be predefined in the system, and complex rules can be implemented in real time by writing rule languages and using "predefined functions" + "logical connections".
[0123] Specific implementation steps:
[0124] 1) Main logical architecture of CDN video scheduling system
[0125] The CDN video scheduling system as a whole receives HTTP requests from clients and returns the appropriate download address based on the information in the request. The process can be roughly summarized into two steps: one is request classification, and the other is to assign different download node groups to each category.
[0126] Part I:
[0127] 1. Organize the request information, for example, the request source IP, request feature list, and request header information.
[0128] 2. Overall request features and confirm the dispatch service type. For example, based on the source IP, confirm the regional features and operator features of the request; based on the parameter list, confirm the bitrate and clarity of the video that the client wants to download; based on the request header information, extract features such as User-Agent and client device type. A specific set of request features uniquely corresponds to a dispatch service type.
[0129] Part II:
[0130] 1. For different request characteristics, the corresponding download node list has been pre-configured.
[0131] 2. For each request, the system will query the corresponding download node list based on the request features sorted out in the first part, and perform subsequent screening. Reusing the above example, for users of "Beijing-China Unicom-1080P-Browser" or "Zhejiang-China Telecom-720P-TV Screen Casting", the corresponding download node list will be queried from the pre-configured list, and the appropriate part will be selected and responded to the requester.
[0132] Here are some explanations of the above terms:
[0133] CDN video scheduling system: When users need to download videos, they request this system and obtain the download node, which is referred to as the "system" in the following.
[0134] Scheduling service type: an intermediate concept that connects "request features" and "download node list" to facilitate operation and maintenance personnel to configure the node list. For example, the "Beijing-China Unicom-1080P-browser" in the above text corresponds to a scheduling service type. As long as the download node list corresponding to this scheduling service type is pre-configured, all requests matching the corresponding features received by CDN video scheduling will be processed according to the mapping order of "request features" -> "scheduling service type" -> "download node list".
[0135] 2) The main structure of the syntax escaper
[0136] The syntax escaper corresponds to step 2 of the first part of the "system", which is to determine the request characteristics based on the request information.
[0137] 1. Overall framework
[0138] Predefined sections:
[0139] Function mapping table: The mapping from function name (string) to function needs to be pre-defined. Modifying this table requires upgrading the system. For example, this table contains such a mapping, the key is arg, and the value is a function. Among them, the function accepts 1 parameter, called key, and the function returns a string. The function's function is to determine the value corresponding to the parameter key in the http request URL parameter list, and return an empty string if it does not exist.
[0140] Application process: The application of parsed rules to requests can be divided into three layers.
[0141] The first layer is the "condition". According to the function name in the "condition", the corresponding function is found from the predefined function mapping table. After obtaining the function's return value, a string match is performed with the target value in the "condition". If the match is successful, the "condition" is considered to be True.
[0142] The second layer is the scheduling service type. If each "condition" in the first layer is True, the scheduling service type is considered to be matched successfully.
[0143] The third layer is the finalized scheduling service type. Among all the scheduling service types that are successfully matched in the second layer, the one with the highest priority is taken as the finalized scheduling service type of the client's http request.
[0144] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0145] In this embodiment, a scheduling processing device is also provided to implement the above-mentioned embodiments and preferred implementation modes, which have been described and will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0146] Figure 4 is a structural block diagram of a scheduling processing device according to an embodiment of the present application, such as Figure 4 As shown, the device includes: a parsing module 100 and an updating module 200, wherein the parsing module 100 is used to parse the rule language text based on predetermined lexical rules and predetermined grammatical rules in response to detecting the rule language text input by the user; the updating module 200 is used to update the scheduling service policy based on the parsing result of the rule language text; the scheduling service policy is used to respond to the target request for the scheduling service.
[0147] Furthermore, the parsing module 100 is specifically used to: divide the rule language text into at least one string based on predetermined lexical rules and at least one identifier in the rule language text; determine at least one scheduling service type and a matching condition corresponding to the scheduling service type based on predetermined grammatical rules, the identifier and the string; and generate a scheduling service mapping relationship as a parsing result based on the scheduling service type and the corresponding matching condition.
[0148] Furthermore, the predetermined grammar rule is a grammar tree, and the parsing module 100 is specifically used to: determine the grammar tree branch that matches the identifier and the string based on the progressive rule corresponding to the grammar tree; determine at least one scheduling service type and the matching condition corresponding to the scheduling service type based on the grammar tree branch.
[0149] Furthermore, the updating module 200 is specifically used to: add the scheduling service mapping relationship to the policy content of the scheduling service policy, or determine the scheduling service mapping relationship as a new scheduling service policy.
[0150] Furthermore, the device also includes: an execution module, which is used to obtain the request characteristics in the target request in response to receiving the target request after updating the scheduling service policy based on the parsing results of the rule language text; determine the scheduling service type that matches the request characteristics based on at least one matching condition in the scheduling service policy; query the service node corresponding to the scheduling service type that matches the request characteristics; and respond to the target request based on the service node.
[0151] Furthermore, the execution module is specifically used to: verify the request feature specified by the matching condition based on the function in at least one matching condition in the scheduling service policy to obtain an output value; compare the output value with the target verification value corresponding to the request feature specified in the matching condition to see if they are consistent; if the output value is consistent with the target verification value, determine that the request feature hits the matching condition; and determine that the scheduling service type corresponding to the matching condition is the scheduling service type matched by the request feature.
[0152] Furthermore, the execution module is specifically used to: determine the matching conditions that the request feature meets; if the request feature meets only one matching condition, determine the number of matching conditions that the request feature hits in the scheduling service policy; if the request feature hits only one matching condition, determine that the scheduling service type corresponding to the matching condition that the request feature hits is the scheduling service type matched by the request feature; if the request feature hits multiple matching conditions, determine that the one with the highest priority among the multiple scheduling service types corresponding to the multiple matching conditions that the request feature hits is the scheduling service type matched by the request feature.
[0153] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0154] The embodiment of the present application also provides an electronic device, Figure 5 is a structural diagram of an electronic device according to an embodiment of the present application, such as Figure 5 As shown, it includes a processor 41, a communication interface 42, a memory 43 and a communication bus 44, wherein the processor 41, the communication interface 42 and the memory 43 communicate with each other through the communication bus 44, and the memory 43 is used to store computer programs; the processor 41 is used to execute the program stored in the memory 43 to implement the following steps: in response to detecting a rule language text input by a user, parsing the rule language text based on predetermined lexical rules and predetermined grammatical rules; updating the scheduling service policy based on the parsing result of the rule language text; the scheduling service policy is used to respond to a target request for a scheduling service.
[0155] Further, the parsing of the rule language text based on predetermined lexical rules and predetermined grammatical rules includes: dividing the rule language text into at least one character string based on predetermined lexical rules and at least one identifier in the rule language text; determining at least one scheduling service type and a matching condition corresponding to the scheduling service type based on predetermined grammatical rules, the identifier and the character string; and generating a scheduling service mapping relationship as a parsing result based on the scheduling service type and the corresponding matching condition.
[0156] Further, the predetermined grammar rule is a grammar tree, and determining at least one scheduling service type and a matching condition corresponding to the scheduling service type based on the predetermined grammar rule, the identifier and the character string includes: determining a grammar tree branch that matches the identifier and the character string based on a progressive rule corresponding to the grammar tree; determining at least one scheduling service type and a matching condition corresponding to the scheduling service type based on the grammar tree branch.
[0157] Further, updating the scheduling service policy based on the parsing result of the rule language text includes: adding the scheduling service mapping relationship to the policy content of the scheduling service policy, or determining the scheduling service mapping relationship as a new scheduling service policy.
[0158] Further, after updating the scheduling service policy based on the parsing result of the rule language text, the method also includes: in response to the received target request, obtaining the request characteristics in the target request; determining the scheduling service type that matches the request characteristics based on at least one matching condition in the scheduling service policy; querying the service node that matches the scheduling service type; and responding to the target request based on the service node.
[0159] Further, the determining of the scheduling service type that matches the request feature based on at least one matching condition in the scheduling service policy includes: verifying the request feature specified by the matching condition based on a function in at least one matching condition in the scheduling service policy to obtain an output value; comparing the output value with a target verification value corresponding to the request feature specified in the matching condition to see if they are consistent; if the output value is consistent with the target verification value, determining that the request feature hits the matching condition; and determining that the scheduling service type corresponding to the matching condition is the scheduling service type that matches the request feature.
[0160] Further, determining the scheduling service type that matches the request feature based on at least one matching condition in the scheduling service policy includes: determining the number of matching conditions in the scheduling service policy that the request feature hits; if the request feature hits one matching condition, determining the scheduling service type corresponding to the matching condition that the request feature hits is the scheduling service type that matches the request feature; if the request feature hits multiple matching conditions, determining the scheduling service type with the highest priority among multiple scheduling service types corresponding to the multiple matching conditions that the request feature hits is the scheduling service type that matches the request feature.
[0161] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0162] The communication interface is used for communication between the above terminal and other devices.
[0163] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0164] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0165] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is executed on a computer, the computer executes the scheduling processing method described in any one of the above embodiments.
[0166] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the scheduling processing method described in any one of the above embodiments.
[0167] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0168] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
[0169] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A scheduling processing method, characterized in that: include: In response to detecting a rule language text input by a user, parsing the rule language text based on predetermined lexical rules and predetermined grammatical rules; Updating the scheduling service strategy based on the parsing result of the rule language text; The scheduling service policy is used to respond to a target request for a scheduling service.
2. The scheduling processing method according to claim 1, characterized in that: The parsing of the rule language text based on the predetermined lexical rules and the predetermined grammatical rules includes: Based on a predetermined lexical rule and at least one identifier in the rule language text, dividing the rule language text into at least one character string; Determine at least one scheduling service type and a matching condition corresponding to the scheduling service type based on a predetermined grammatical rule, the identifier and the character string; Based on the scheduling service type and the corresponding matching condition, a scheduling service mapping relationship is generated as a parsing result.
3. The scheduling processing method according to claim 2, characterized in that: The predetermined grammatical rule is a grammatical tree, and determining at least one scheduling service type and a matching condition corresponding to the scheduling service type based on the predetermined grammatical rule, the identifier, and the character string includes: Determine the syntax tree branch where the identifier and the string match based on the progressive rule corresponding to the syntax tree; At least one scheduling service type and a matching condition corresponding to the scheduling service type are determined based on the syntax tree branch.
4. The scheduling processing method according to claim 1, characterized in that: The parsing result is a scheduling service mapping relationship, and the updating of the scheduling service strategy based on the parsing result of the rule language text includes: The scheduling service mapping relationship is added to the policy content of the scheduling service policy, or the scheduling service mapping relationship is determined as a new scheduling service policy.
5. The scheduling processing method according to claim 1, characterized in that: After updating the scheduling service strategy based on the parsing result of the rule language text, the method further includes: In response to the received target request, obtaining a request feature in the target request; Determine the scheduling service type that the request feature matches based on at least one matching condition in the scheduling service policy; Querying a service node that matches the scheduling service type; Responding to the target request based on the service node.
6. The scheduling processing method according to claim 5, characterized in that: The determining the scheduling service type matched by the request feature based on at least one matching condition in the scheduling service policy includes: Verify the request feature specified by the matching condition based on a function in at least one matching condition in the scheduling service policy to obtain an output value; Comparing the output value with a target check value corresponding to the request feature specified in the matching condition to see if they are consistent; If the output value is consistent with the target check value, it is determined that the request feature hits the matching condition; Determine that the scheduling service type corresponding to the matching condition is the scheduling service type matched by the request feature.
7. The scheduling processing method according to claim 5, characterized in that: The determining the scheduling service type matched by the request feature based on at least one matching condition in the scheduling service policy includes: Determine the number of matching conditions in the scheduling service policy that the request feature hits; If the request feature hits a matching condition, determining that the scheduling service type corresponding to the matching condition hit by the request feature is the scheduling service type matched by the request feature; If the request feature matches multiple matching conditions, it is determined that the scheduling service type with the highest priority among the multiple scheduling service types corresponding to the multiple matching conditions matched by the request feature is the scheduling service type matched by the request feature.
8. A scheduling processing device, characterized in that: include: A parsing module, configured to parse the rule language text based on predetermined lexical rules and predetermined grammatical rules in response to detecting the rule language text input by the user; An updating module, used for updating the scheduling service strategy based on the parsing result of the rule language text; The scheduling service policy is used to respond to a target request for a scheduling service.
9. An electronic device, characterized in that: The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the scheduling processing method according to any one of claims 1 to 7 when executed by the processor.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the scheduling processing method according to any one of claims 1 to 7 are implemented.
