Execution plan generation method and device based on extension expression
By adopting the execution plan generation method based on extended expressions in the doctor station business system, the problem of difficulty in expanding and customizing the medical order execution rules in the existing technology is solved, and support for complex and special rule scenarios is achieved, providing a convenient Visual configuration method to meet the implementation plan needs across days, months and New Year.
Patent Information
- Application Number
- CN202411378544.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2024-12-27
AI Technical Summary
The existing doctor station business system is difficult to expand, difficult to use, and cannot be customized when handling medical order execution rules, and cannot support complex and special execution rules scenarios, especially when it is necessary to implement plans across days, months, and New Year. need.
Using the execution plan generation method based on extended expressions, the control is set for extended expressions by replacing the cron expression on the interactive interface, obtaining the effective time and generating the extended expression, supporting more complex and special execution rules, and using the effective time Modules, expression modules and plan generation modules generate execution plan time lists to meet the needs of different scenarios.
It realizes flexible configuration of medical order execution rules, supports complex and special execution plan requirements, and conveniently generates execution plans through visual interactive interfaces to meet business needs across days, months, and New Year's Eve, and verify whether the expression meets the execution plan. rule.
Smart Images

Figure CN119207747A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer software technology, and relates to medical order execution planning, and in particular to a method and device for generating an execution plan based on an extended expression. Background Art
[0002] Medical orders are business units that nurses can execute during the medical treatment of patients. They are generally created by doctors in the doctor's station business system. Each medical order may require different execution plans according to the application scenarios of different medical order types (such as temporary medical orders, long-term medical orders, continuous medical orders, text medical orders, etc.) or the actual needs of patients. The doctor's station business system needs to specify the execution rules corresponding to the required execution plans for different medical orders. After receiving the medical order information, the nurse's station business system generates the medical order execution plan information according to the execution rules of the medical order.
[0003] There are generally two processing solutions for the existing doctor station business system: 1. Write code for different types of medical orders to support the execution rules required for medical orders; 2. Use common execution plan expression tools on the market (such as cron expressions) to generate corresponding execution plan information. The first solution will cause the doctor station business system to be unable to efficiently support the expansion of medical order execution rules, while the second solution cannot support various complex and special execution rule scenarios in the medical order business that exceed the common cron expression rules. An example of a typical business application scenario supported by the second solution: 24-hour continuous medical orders based on the patient's oxygen inhalation needs, an execution plan is generated every hour, and the execution rules of traditional cron expressions cannot meet the possible needs of execution plans across days, months, and years.
[0004] Therefore, the doctor station business system needs to create a system based on the requirements of medical order execution rules that can not only support the execution plan rules required by the business, but also support customized rule configuration in a more convenient and intuitive way to meet the requirements of medical order execution rules. Summary of the invention
[0005] In order to solve the above-mentioned deficiencies of the prior art, the present application provides an execution plan generation method and device based on extended expressions, which overcomes the problems of difficult expansion, difficulty in use, non-customization, and lack of support for some complex and special rule scenarios of medical order rules in existing doctor business systems.
[0006] In order to achieve the above object, the present invention adopts the following technologies: The execution plan generation method based on extended expression is applied to the generation of medical order execution plan, including: In response to the setting of the effective time control on the interactive interface, the cron expression setting control displayed on the interactive interface is replaced with the extended expression setting control, and the effective time set in the effective time control is obtained; wherein, when the time in the effective time control is empty, the interactive interface keeps displaying the cron expression setting control without being replaced; the extended expression setting control is used to set the information of the extended expression, and the cron expression setting control is used to set the information of the cron expression; Get the information set in the extended expression setting control / cron expression setting control, and generate an extended expression / cron expression based on the effective time, and display it in the expression generation control of the interactive interface; the effective time is used to simulate the time when the doctor's station business system issues the medical order, and it is filled in the corresponding positions in the extended expression. Specifically, the extended expression setting control / cron expression setting control finally generates the effective time in the expression available in the business system in the form of a placeholder and sets it in each corresponding position in the expression. When the doctor's station business system issues a medical order, the specific planned effective time (usually the time when the medical order is issued) is filled in the placeholder; for example: assuming that the expression obtained according to the expression control is T %s %s / 30 %s&9 %s %s %s %s, the actual time when the medical order is issued is 2024-09-27 10:10:00, the time when the medical order is issued is used as the effective time of the expression, and the actual effective time is filled in the placeholder before obtaining the execution plan to obtain the expression: T 0 10 / 30 10&9 27 09 4 2024; In response to setting a time range setting control on the interactive interface, obtaining a set time range for the execution plan; According to the extended expression / cron expression and the planned start time and planned end time of the time range, a list of execution plan times is generated and displayed on the interactive interface; wherein the range of the generated execution plan time is the time range from the effective time to the expiration time, which intersects with the planned start time to the planned end time, and the expiration time is a preset value later than the effective time or defaults to infinite duration.
[0007] Among them, each extended expression / cron expression set up embodies an extended rule / a regular rule, and the extended rule includes a first rule, a second rule and the regular rule. The first rule refers to generating an execution plan time at each scheduled time interval or when each specified time arrives from the effective time to the planned end time; the second rule refers to generating an execution plan time at each scheduled time interval or when each specified time arrives within the continuous preset time starting from the effective time; the regular rule includes generating an execution plan time at each scheduled time interval or when each specified time arrives from the planned start time to the planned end time.
[0008] An execution plan generation device based on extended expressions is applied to the generation of a medical order execution plan, including: An effective time module, used to replace the cron expression setting control displayed on the interactive interface with the extended expression setting control in response to the setting of the effective time control on the interactive interface, and obtain the effective time set in the effective time control; wherein, when the time in the effective time control is empty, the interactive interface keeps displaying the cron expression setting control without being replaced; the extended expression setting control is used to set the information of the extended expression, and the cron expression setting control is used to set the information of the cron expression; The expression module is used to obtain the information set in the extended expression setting control / cron expression setting control, and generate the extended expression / cron expression according to the effective time, and display it in the expression generation control of the interactive interface; wherein the effective time is filled in the corresponding position in the extended expression in the form of a placeholder; An execution time module, for obtaining the set time range of the execution plan in response to the setting of the time range setting control on the interactive interface; The plan generation module is used to generate a list of execution plan times and display it on the interactive interface based on the extended expression / cron expression and the planned start time and planned end time of the time range; wherein the range of the generated execution plan time is the time range from the effective time to the expiration time, which intersects with the time range from the planned start time to the planned end time, and the expiration time is a preset value later than the effective time or defaults to infinite duration.
[0009] The beneficial effects of the present invention are: It can not only support the normal use of cron expressions, but also support various execution plan requirement scenarios that require extended rules by setting the effective time and generating extended expressions. The processing process is presented through a visual interactive interface, which is convenient for configuring expressions that meet the execution plan rule requirements in a more intuitive and convenient way. It can also return the plan list according to the set time range to further verify whether the expression meets the required execution plan rules. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a flow chart of the execution plan generation method of an embodiment of the present application.
[0011] Figure 2 It is a structural block diagram of the execution plan generation device of an embodiment of the present application.
[0012] Figure 3 It is a state diagram of the interactive interface of an embodiment of the present application. DETAILED DESCRIPTION
[0013] To make the objectives, technical solutions and advantages of the embodiments of the present invention more clear, the implementation modes of the present invention are described in detail below with reference to the accompanying drawings. However, the embodiments described in the present invention are only part of the embodiments of the present invention, rather than all the embodiments.
[0014] In one aspect of the embodiments of the present application, a method for generating an execution plan based on an extended expression is provided, which is applied to the generation of a medical order execution plan, such as Figure 1 The following is a flow chart of the steps: Figure 3 Shown is an example of the interactive interface involved in the method.
[0015] Specifically, the method includes the following steps: S100. In response to setting the effective time control on the interactive interface, the cron expression setting control displayed on the interactive interface is replaced with the extended expression setting control, and the effective time set in the effective time control is obtained; wherein, when the time in the effective time control is empty, it indicates that the effective time is not set, and the interactive interface keeps displaying the cron expression setting control without being replaced. Here, the extended expression setting control is used to set the information of the extended expression, and the cron expression setting control is used to set the information of the cron expression.
[0016] S200. Obtain the information set in the extended expression setting control / cron expression setting control, and generate an extended expression / cron expression based on the effective time, and display it in the expression generation control of the interactive interface; wherein the effective time is filled in the corresponding positions in the extended expression in the form of a placeholder.
[0017] Specifically, the cron expression is a string, including 7 fields, namely, second, minute, hour, day, month, week, and year; and the extended expression includes the extended identifier and the 7 fields set in sequence, and the extended identifier is a number of letters, such as Figure 3 It is shown as T in the figure, which is used to be identified as an extended expression when generating an execution plan. Spaces are used between the extended identifier and the domain, and between domains.
[0018] The domain includes numbers, or numbers and special characters. The special characters in cron expressions include ",","-,","*,"?"," / ", and the special characters in extended expressions include ",","-,","*,"?"," / ", as well as "&".
[0019] Among them, "," represents a list of enumeration values, written as M1,N1, which means it is triggered at M1 time and N1 time. For example, if "10,30" is used in the sub-domain, it means it is triggered at 10 minutes and 30 minutes; "- " represents a range, written as M2-N2, which means it will be triggered between M2 time and N2 time. For example, if "10-30" is used in the sub-domain, it means it will be triggered between the 10th minute and the 30th minute; "* " represents an arbitrary value, which means it will be triggered once for each minimum unit time of the domain corresponding to the *. For example, if '*' is used in the sub-domain, it means it will be triggered once every minute; "?" represents an uncertain arbitrary value, which is only used in the day domain and week domain. The day domain and the week domain will affect each other. For example, if you need to trigger once on the 30th day, you can only use ? in the week domain. If you use * in the week domain, it means that it will be triggered regardless of the day of the week (i.e. every day); " / " means starting from the starting time M3, it will be triggered every N3 time, written as M3 / N3. Use "10 / 3" in the minute domain, which means it will be triggered every 3 minutes starting from 10 minutes; "&" means it will be triggered between M4 time and N4 time, written as M4&N4; where N2 is less than or equal to the maximum value of the corresponding domain, and N4 is not limited by the maximum value of the corresponding domain; for example, if "10&100" is used in the minute domain, it means it will start from 10 minutes and end after 100 minutes. The time unit of the corresponding domain using " / " cannot be greater than the time unit of the corresponding domain using "&". For example, when "&" is used in the minute domain, " / " can only be used in the second domain and minute domain. When "&" and " / " are used in a domain at the same time, "&" comes before " / ". For example, if "10&100 / 3" is used in a domain, it means that the execution starts at 10 minutes and ends after 100 minutes. An execution plan time is generated every 3 minutes before the end. Specifically, the seconds, minutes, hours, days, months, weeks, and years of the effective time are filled in each field of the extended expression with the placeholder %s, such as Figure 3 As shown, an example expression is "T %s %s / 30 %s&9 %s %s %s %s".
[0020] The effective time is used to simulate the time when the doctor's station business system issues the doctor's order. When the doctor's station business system issues the doctor's order, the placeholder is filled with the doctor's order issuance time. For example, if the expression obtained from the expression control is T %s %s / 30%s&9 %s %s %s %s, and the actual doctor's order issuance time is 2024-09-27 10:10:00, the doctor's order issuance time is used as the effective time of the expression. Before obtaining the execution plan, the actual effective time will be filled in the placeholder to obtain the expression: T 010 / 30 10&9 27 09 4 2024.
[0021] S300: In response to the setting of the time range setting control on the interactive interface, the set time range of the execution plan is obtained. Figure 3An example shown is "2024-08-14 00:00:00~2024-08-15 23:59:59".
[0022] S400: Generate a list of execution plan times based on the extended expression / cron expression and the planned start time and planned end time of the time range and display it on the interactive interface, such as Figure 3 As shown, the "Actual Running Time" list is displayed. Specifically, the range of the generated execution plan time is the interval from the effective time to the expiration time, and the time range of the intersection with the interval from the planned start time to the planned end time. The expiration time is a preset value later than the effective time or defaults to infinite duration. In this example, the effective time is "2024-08-14 14:01:39", the time range is "2024-08-14 00:00:00~2024-08-15 23:59:59", and the generated execution plan time is "2024-08-14 14:01:39, 2024-08-1414:31:39, 2024-08-14 15:01:39, ...".
[0023] Specifically, each extended expression / cron expression set up embodies an extended rule / a regular rule, and the extended rule includes a first rule, a second rule and the regular rule. The first rule refers to generating an execution plan time at every scheduled time interval or at the arrival of each specified time from the effective time to the planned end time; the second rule refers to generating an execution plan time at every scheduled time interval or at the arrival of each specified time during the continuous preset time starting from the effective time; the regular rule includes generating an execution plan time at every scheduled time interval or at the arrival of each specified time from the planned start time to the planned end time.
[0024] The above method of this example is particularly suitable for the generation of doctor's order execution plans. Specifically, in the current typical doctor's order execution plan scenario: long-term doctor's orders (such as: generating an execution plan at 8:00, 14:00, and 16:00 every day) or temporary doctor's orders (such as: generating an execution plan at 10:00 on the specified day), the use of existing cron expressions can also meet business needs; but when facing another typical doctor's order execution plan scenario: it takes effect from the time the doctor's order is issued, lasts for a period of time (such as 24 hours), and generates an execution plan at intervals of a specified time (such as 1 hour). The execution plan time range may span days, months, and years, then it is necessary to modify the business code of the business scenario in a targeted manner to generate the corresponding execution plan, then the existing expression method cannot meet it, and if the above method of this example is applied in this scenario, it can be supported conveniently, intuitively, and highly scalable. This is just an example, and the application of the method of this embodiment includes but is not limited to the above-mentioned doctor's order execution plan application scenario.
[0025] Specifically, according to the extended expression / cron expression and the planned start time and the planned end time of the time range, the expression calculation tool is called to generate a list of execution plan times; preferably, in addition to obtaining the list of execution plan times, the expression calculation tool also supports obtaining the next plan time, obtaining the previous plan time, obtaining the next X plan lists, obtaining the first X plan lists, obtaining the Xth plan time in the future, etc.
[0026] Specifically, according to the extended expression / cron expression and the planned start time of the time range, get the next planned time; according to the extended expression / cron expression and the planned end time of the time range, get the previous planned time; according to the extended expression / cron expression and the planned start time of the time range and the planned quantity X, get the list of the next X plans; according to the extended expression / cron expression and the planned end time of the time range and the planned quantity X, get the list of the first X plans; according to the extended expression / cron expression and the planned start time of the time range, get the Xth planned time in the future.
[0027] Another aspect of the present application embodiment provides an execution plan generation device based on an extended expression, which is applied to the generation of a medical order execution plan, such as Figure 2 As shown, it includes an effective time module, an expression module, an execution time module, and a plan generation module.
[0028] The effective time module responds to the setting of the effective time control on the interactive interface, replaces the cron expression setting control displayed on the interactive interface with the extended expression setting control, and obtains the effective time set in the effective time control; wherein, when the time in the effective time control is empty, the interactive interface continues to display the cron expression setting control without being replaced; the extended expression setting control is used to set the information of the extended expression, and the cron expression setting control is used to set the information of the cron expression.
[0029] The expression module obtains the information set in the extended expression setting control / cron expression setting control, and generates an extended expression / cron expression based on the effective time, and displays it in the expression generation control of the interactive interface; among them, the effective time is filled in the corresponding positions in the extended expression in the form of placeholders.
[0030] The execution time module obtains the set time range of the execution plan in response to the setting of the time range setting control on the interactive interface.
[0031] The plan generation module generates a list of execution plan times and displays it on the interactive interface based on the extended expression / cron expression and the planned start time and planned end time of the time range; wherein the range of the generated execution plan time is the time range from the effective time to the expiration time, which intersects with the time range from the planned start time to the planned end time, and the expiration time is a preset value later than the effective time or defaults to infinite duration.
[0032] According to another aspect of the embodiments of the present application, an electronic device is provided, comprising at least one processor and a memory; wherein the memory stores computer execution instructions; the computer execution instructions stored in the memory are executed by the at least one processor, so that the at least one processor executes the execution plan generation method based on the extended expression as described in the previous embodiments.
[0033] In another aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the execution plan generation method based on the extended expression as described in the above embodiments.
[0034] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application.
Claims
1. The execution plan generation method based on extended expression is characterized in that: Applied to the generation of doctor's order execution plan, including the following steps: In response to the setting of the effective time control on the interactive interface, the cron expression setting control displayed on the interactive interface is replaced with the extended expression setting control, and the effective time set in the effective time control is obtained; wherein, when the time in the effective time control is empty, the interactive interface keeps displaying the cron expression setting control without being replaced; the extended expression setting control is used to set the information of the extended expression, and the cron expression setting control is used to set the information of the cron expression; Get the information set in the extended expression setting control / cron expression setting control, and generate an extended expression / cron expression based on the effective time, and display it in the expression generation control of the interactive interface; where the effective time is filled in the corresponding position in the extended expression in the form of a placeholder; In response to setting a time range setting control on the interactive interface, obtaining a set time range for the execution plan; According to the extended expression / cron expression and the planned start time and planned end time of the time range, a list of execution plan times is generated and displayed on the interactive interface; wherein the range of the generated execution plan time is the time range from the effective time to the expiration time, which intersects with the planned start time to the planned end time, and the expiration time is a preset value later than the effective time or defaults to infinite duration.
2. The method for generating an execution plan based on an extended expression according to claim 1, characterized in that: The effective time is used to simulate the time when the doctor's station business system issues the doctor's order. When the doctor's station business system issues the doctor's order, the placeholder is filled with the time when the doctor's order is issued.
3. The method for generating an execution plan based on an extended expression according to claim 1, characterized in that: Each extended expression / cron expression set up each time reflects an extended rule / a regular rule, and the extended rule includes the first rule, the second rule and the regular rule. The first rule refers to generating an execution plan time at each scheduled time interval or at each specified time from the effective time to the planned end time; the second rule refers to generating an execution plan time at each scheduled time interval or at each specified time during the continuous preset time starting from the effective time; the regular rule includes generating an execution plan time at each scheduled time interval or at each specified time from the planned start time to the planned end time.
4. The method for generating an execution plan based on an extended expression according to claim 1, characterized in that: The cron expression is a string including seven fields, namely, second, minute, hour, day, month, week and year. The extended expression includes an extended identifier and the seven fields set in sequence. The extended identifier is a number of letters and is identified as an extended expression when generating the execution plan time. Spaces are used between the extended identifier and the fields, and between the fields.
5. The method for generating an execution plan based on an extended expression according to claim 4, characterized in that: The domain includes numbers, or numbers and special characters. The special characters in cron expressions include ",", "- ", "* ", "?", " / ", and the special characters in extended expressions include ",", "- ", "* ", "?", " / ", and "&"; "," represents a list of enumeration values, written as M1, N1, indicating that the trigger occurs at M1 time and N1 time; "-" represents the range, written as M2-N2, which means it will be triggered between M2 time and N2 time; "*" represents any value, which means that each domain corresponding to the * is triggered once in the minimum unit time; "?" represents an uncertain arbitrary value and is only used in the day and week fields; " / " means starting at the start time M3 and triggering every N3 time, written as M3 / N3; "&" means that the trigger will be triggered between the start time of M4 and the time of N4, written as M4&N4; Among them, the time unit of the corresponding domain using " / " cannot be greater than the time unit of the corresponding domain using "&", N2 is less than or equal to the maximum value of the corresponding domain, and N4 is not limited by the maximum value of the corresponding domain.
6. The method for generating an execution plan based on an extended expression according to claim 5, characterized in that: The seconds, minutes, hours, days, months, weeks, and years of the effective time are filled in each field of the extended expression with the placeholder %s.
7. The method for generating an execution plan based on an extended expression according to claim 1, characterized in that: Based on the extended expression / cron expression and the planned start time and planned end time of the time range, the expression calculation tool is called to generate a list of execution plan times; In addition to generating a list of execution plan times, the expression evaluation tool also supports: Get the next scheduled time based on the extended expression / cron expression and the scheduled start time of the time range; Get the last scheduled time based on the extended expression / cron expression and the scheduled end time of the time range; Get the list of the next X plans based on the extended expression / cron expression, the planned start time of the time range, and the planned quantity X; Get the first X plans list based on the extended expression / cron expression, the plan end time of the time range, and the plan quantity X; Get the Xth scheduled time in the future based on the extended expression / cron expression and the scheduled start time of the time range.
8. An execution plan generation device based on an extended expression, characterized in that: include: An effective time module, used to replace the cron expression setting control displayed on the interactive interface with the extended expression setting control in response to the setting of the effective time control on the interactive interface, and obtain the effective time set in the effective time control; wherein, when the time in the effective time control is empty, the interactive interface keeps displaying the cron expression setting control without being replaced; the extended expression setting control is used to set the information of the extended expression, and the cron expression setting control is used to set the information of the cron expression; The expression module is used to obtain the information set in the extended expression setting control / cron expression setting control, and generate the extended expression / cron expression according to the effective time, and display it in the expression generation control of the interactive interface; wherein the effective time is filled in the corresponding position in the extended expression in the form of a placeholder; An execution time module, for obtaining the set time range of the execution plan in response to the setting of the time range setting control on the interactive interface; The plan generation module is used to generate a list of execution plan times and display it on the interactive interface based on the extended expression / cron expression and the planned start time and planned end time of the time range; wherein the range of the generated execution plan time is the time range from the effective time to the expiration time, which intersects with the time range from the planned start time to the planned end time, and the expiration time is a preset value later than the effective time or defaults to infinite duration.
9. An electronic device comprising at least one processor and a memory; wherein: The memory stores computer-executable instructions; it is characterized in that the computer-executable instructions stored in the memory are executed by the at least one processor, so that the at least one processor executes the execution plan generation method based on extended expressions as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the device where the storage medium is located is controlled to execute the method for generating an execution plan based on an extended expression as described in any one of claims 1 to 7.
