Component acquisition method, device and equipment of batch controller and storage medium
By automatically obtaining the device documents and function identifiers of the batch controller, creating a subroutine call interface, solving the problem of inefficient access to service components in the existing technology, and achieving efficient and reliable access to service components.
Patent Information
- Application Number
- CN202510337766.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-07-18
AI Technical Summary
The process of obtaining service components of the main program in existing batch controllers is cumbersome, resulting in inefficient acquisition and susceptible to manual intervention.
Through automated methods, obtain the device documents of the batch controller, read the industry identity, obtain the function identity list in the target solution, create and store the subroutine call interface, generate the main program service components, and reduce manual intervention.
It improves the acquisition efficiency and reliability of the main program service components in the batch controller, reduces the acquisition time, and avoids the impact of manual intervention.
Smart Images

Figure CN120335884A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of control technologies, and particularly to a method, device, equipment and storage medium for obtaining components of a batch controller. Background Art
[0002] A batch controller is a device or software system that can centrally control and manage multiple objects or tasks. Batch controllers are widely used in scenarios such as industrial automation production lines, agricultural irrigation and breeding, equipment management in commercial places, smart home systems, and equipment regulation in transportation hubs, greatly improving the system operation efficiency and management effectiveness.
[0003] However, the process of obtaining service components of the main program in existing batch controllers is cumbersome, which is not conducive to improving the efficiency of obtaining service components. The reason is that the existing technology mainly uses manual acquisition methods to obtain service components of the main program in batch controllers, and the manual acquisition method consumes a large amount of human and time resources, increasing the acquisition time of service components of the main program in batch controllers and being easily affected by manual intervention. Therefore, it is not conducive to improving the efficiency of obtaining service components. Summary of the Invention
[0004] The present invention provides a method, device, computer equipment and storage medium for obtaining components of a batch controller to solve the technical problem that the process of obtaining service components of the main program in existing batch controllers is cumbersome and not conducive to improving the efficiency of obtaining service components.
[0005] In a first aspect, a method for obtaining components of a batch controller is provided, including:
[0006] Obtain the device document of the batch controller and read the industry identifier in the device document;
[0007] Obtain multiple loading plans corresponding to the industry identifier, obtain a target plan among the multiple loading plans, and obtain the function identifier list in the target plan;
[0008] Read the quantitative control function identifier, anti-overflow protection function identifier, anti-static protection function identifier and permission setting function identifier in the function identifier list;
[0009] Create a first subroutine according to the execution code corresponding to the quantitative control function identifier, create a second subroutine according to the execution code corresponding to the anti-overflow protection function identifier, create a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and create a fourth subroutine according to the execution code corresponding to the permission setting function identifier;
[0010] Create a call interface for the first subroutine, create a call interface for the second subroutine, create a call interface for the third subroutine, and create a call interface for the fourth subroutine;
[0011] Store the call interfaces for the first, second, second, and fourth subroutines in a target file, and package the target file to generate a service component for the main program in the batch controller.
[0012] Further, the steps of obtaining multiple loading plans corresponding to the industry identifier, obtaining a target plan among the multiple loading plans, and obtaining the function identifier list in the target plan include:
[0013] Obtain a query statement carrying the industry identifier, select the query statement carrying the industry identifier as a query request, send the query request to the database, and receive the query result returned by the database according to the query request;
[0014] In the query result, obtain multiple loading plans corresponding to the industry identifier, obtain a target plan among the multiple loading plans, and obtain the function identifier list in the target plan.
[0015] Further, the steps of reading the quantitative control function identifier, overflow protection function identifier, anti-static protection function identifier, and permission setting function identifier in the function identifier list include:
[0016] Obtain the usage frequency corresponding to the function identifier list;
[0017] When the usage frequency is greater than the preset frequency, read the quantitative control function identifier, overflow protection function identifier, anti-static protection function identifier, and permission setting function identifier in the function list.
[0018] Further, the steps of creating a first subroutine according to the execution code corresponding to the quantitative control function identifier, creating a second subroutine according to the execution code corresponding to the overflow protection function identifier, creating a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and creating a fourth subroutine according to the execution code corresponding to the permission setting function identifier include:
[0019] Obtain the execution code corresponding to the quantitative control function identifier, the execution code corresponding to the quantitative control function identifier, the execution code corresponding to the overflow protection function identifier, the execution code corresponding to the anti-static protection function identifier, the execution code corresponding to the report function identifier, and the execution code corresponding to the permission setting function identifier;
[0020] Create a first subroutine according to the execution code corresponding to the quantitative control function identifier, create a second subroutine according to the execution code corresponding to the anti-overflow protection function identifier, create a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and create a fourth subroutine according to the execution code corresponding to the permission setting function identifier.
[0021] Further, creating the call interface corresponding to the first subroutine, creating the call interface corresponding to the second subroutine, creating the call interface corresponding to the third subroutine, and creating the call interface corresponding to the fourth subroutine includes:
[0022] Obtain the call information corresponding to the first subroutine, the call information corresponding to the second subroutine, the call information corresponding to the third subroutine, and the call information corresponding to the fourth subroutine;
[0023] Create the call interface corresponding to the first subroutine according to the call information corresponding to the first subroutine, create the call interface corresponding to the second subroutine according to the call information corresponding to the second subroutine, create the call interface corresponding to the third subroutine according to the call information corresponding to the third subroutine, and create the call interface corresponding to the fourth subroutine according to the call information corresponding to the fourth subroutine.
[0024] Further, storing the call interface corresponding to the first subroutine, the call interface corresponding to the second subroutine, the call interface corresponding to the second subroutine, and the call interface corresponding to the fourth subroutine in a target file, and packing the target file to generate a service component of the main program in the batch controller includes:
[0025] Store the call interface corresponding to the first subroutine, the call interface corresponding to the second subroutine, the call interface corresponding to the second subroutine, and the call interface corresponding to the fourth subroutine in a target file;
[0026] Obtain a packing instruction, execute the packing instruction, and pack the target file to generate a service component of the main program in the batch controller.
[0027] Further, after storing the call interface corresponding to the first subroutine, the call interface corresponding to the second subroutine, the call interface corresponding to the second subroutine, and the call interface corresponding to the fourth subroutine in a target file, and packing the target file to generate a service component of the main program in the batch controller, the component obtaining method includes:
[0028] Store the service component of the main program in a storage area and create an access interface for the storage area.
[0029] In a second aspect, a component obtaining device for a batch controller is provided, including:
[0030] A first acquisition module, configured to acquire a device document of a batch controller and read an industry identifier in the device document;
[0031] A second acquisition module, configured to acquire multiple loading plans corresponding to the industry identifier, and in the multiple loading plans, acquire a target plan and acquire a list of function identifiers in the target plan;
[0032] A reading module, configured to read a quantitative control function identifier, an anti-overflow protection function identifier, an anti-static protection function identifier, and a permission setting function identifier in the list of function identifiers;
[0033] A first creation module, configured to create a first subroutine according to an execution code corresponding to the quantitative control function identifier, create a second subroutine according to an execution code corresponding to the anti-overflow protection function identifier, create a third subroutine according to an execution code corresponding to the anti-static protection function identifier, and create a fourth subroutine according to an execution code corresponding to the permission setting function identifier;
[0034] A second creation module, configured to create a call interface corresponding to the first subroutine, create a call interface corresponding to the second subroutine, create a call interface corresponding to the third subroutine, and create a call interface corresponding to the fourth subroutine;
[0035] A third acquisition module, configured to store the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file, and package the target file to generate a service component of a main program in the batch controller.
[0036] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above component acquisition method are implemented.
[0037] In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above component acquisition method are implemented.
[0038] The present application provides a method, apparatus, computer device, and storage medium for obtaining components of a batch controller, including obtaining the device document of the batch controller and reading the industry identifier in the device document; obtaining multiple loading plans corresponding to the industry identifier, and obtaining a target plan among the multiple loading plans, and then obtaining the function identifier list in the target plan; reading the quantitative control function identifier, overflow protection function identifier, anti-static protection function identifier, and permission setting function identifier in the function identifier list; creating a first subroutine according to the execution code corresponding to the quantitative control function identifier, creating a second subroutine according to the execution code corresponding to the overflow protection function identifier, creating a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and creating a fourth subroutine according to the execution code corresponding to the permission setting function identifier; creating a call interface corresponding to the first subroutine, creating a call interface corresponding to the second subroutine, creating a call interface corresponding to the third subroutine, and creating a call interface corresponding to the fourth subroutine; storing the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file, and packaging the target file to generate a service component of the main program in the batch controller. The beneficial effects are in two aspects. On the one hand, storing the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file and packaging the target file to generate a service component of the main program in the batch controller reduces the acquisition time of the service component of the main program in the batch controller because there is no need for manual acquisition, which is beneficial to improving the acquisition efficiency of the service component of the main program in the batch controller. On the other hand, since it is not affected by manual intervention, it is beneficial to improve the reliability of the service component of the main program in the batch controller. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings without creative efforts.
[0040] Figure 1 It is a schematic diagram of the application environment of the component acquisition method in an embodiment of the present invention;
[0041] Figure 2 It is a flowchart of the component acquisition method provided by an embodiment of the present invention;
[0042] Figure 3 is Figure 2 a flowchart of step S23 in
[0043] Figure 4 is Figure 2 a schematic flow chart of step S25 in
[0044] Figure 5 is Figure 2 a schematic flow chart of step S26 in
[0045] Figure 6 a schematic structural diagram of a component acquisition device in an embodiment of the present invention;
[0046] Figure 7 a schematic structural diagram of a computer device in an embodiment of the present invention. Detailed implementation manners
[0047] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0048] Please refer to Figure 1 , Figure 1 is a schematic application environment diagram of a component acquisition method in an embodiment of the present invention. The component acquisition method provided by the embodiment of the present invention can be applied in an application environment such as Figure 1 . In this environment, the client communicates with the server through a network.
[0049] The server obtains the device document of the batch controller through the client and reads the industry identifier in the device document;
[0050] Obtain multiple loading plans corresponding to the industry identifier. Among the multiple loading plans, obtain the target plan and obtain the function identifier list in the target plan;
[0051] Read the quantitative control function identifier, anti-overflow protection function identifier, anti-static protection function identifier, and permission setting function identifier in the function identifier list;
[0052] Create a first subroutine according to the execution code corresponding to the quantitative control function identifier, create a second subroutine according to the execution code corresponding to the anti-overflow protection function identifier, create a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and create a fourth subroutine according to the execution code corresponding to the permission setting function identifier;
[0053] Create a call interface corresponding to the first subroutine, create a call interface corresponding to the second subroutine, create a call interface corresponding to the third subroutine, and create a call interface corresponding to the fourth subroutine;
[0054] Store the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file, and package the target file to generate a service component of the main program in the batch controller.
[0055] In the solution implemented by the above component acquisition method, device, equipment, and medium, the beneficial effects are in two aspects. On the one hand, store the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file, and package the target file to generate a service component of the main program in the batch controller. Since there is no need to manually obtain the service component of the main program in the batch controller, the acquisition time of the service component of the main program in the batch controller is reduced, which is beneficial to improving the acquisition efficiency of the service component of the main program in the batch controller. On the other hand, since it will not be affected by manual intervention, it is beneficial to improve the reliability of the service component of the main program in the batch controller.
[0056] Among them, the device running the client is simply referred to as: client device.
[0057] Among them, the device running the server is simply referred to as: server device.
[0058] Among them, the client device includes but is not limited to smart phones, personal computers, vehicle networking terminals, tablet computers, and portable wearable devices.
[0059] Among them, the server device can be implemented by an independent server or a server cluster composed of multiple servers. The present invention will be described in detail through specific embodiments below.
[0060] Please refer to Figure 2 , Figure 2 which is a schematic flow chart of a component acquisition method provided by an embodiment of the present invention, including the following steps:
[0061] S21, obtain the device document of the batch controller, and read the industry identifier in the device document;
[0062] Among them, access the service platform of the batch controller, obtain the device document of the batch controller from the service platform, and read the industry identifier in the device document.
[0063] Among them, the device document includes the technical specifications, operation guide, and industry identifier of the batch controller.
[0064] Among them, the industry identifier is the identifier of the industry. Different industries correspond to different identifiers.
[0065] Among them, the industry identifier includes the petroleum industry identifier and the chemical industry identifier.
[0066] S22. Obtain multiple loading plans corresponding to the industry identifier. Among the multiple loading plans, obtain the target plan and obtain the list of function identifiers in the target plan;
[0067] Among them, the step of obtaining multiple loading plans corresponding to the industry identifier, obtaining the target plan among the multiple loading plans, and obtaining the list of function identifiers in the target plan includes:
[0068] Obtain a query statement carrying the industry identifier, select the query statement carrying the industry identifier as the query request, send the query request to the database, and receive the query result returned by the database according to the query request;
[0069] In the query result, obtain multiple loading plans corresponding to the industry identifier, obtain the target plan among the multiple loading plans, and obtain the list of function identifiers in the target plan.
[0070] Exemplarily, in the query result, the step of obtaining multiple loading plans corresponding to the industry identifier, obtaining the target plan among the multiple loading plans, and obtaining the list of function identifiers in the target plan includes:
[0071] In the query result, obtain multiple loading plans corresponding to the industry identifier, and obtain the loading quantity and loading time corresponding to each loading plan;
[0072] Select the loading plan with the largest ratio of loading quantity to loading time as the target plan, and obtain the list of function identifiers in the target plan.
[0073] For ease of explanation, the following is an example:
[0074] For example, there are loading plan 1, loading plan 2, and loading plan 3;
[0075] The loading quantity corresponding to loading plan 1 is 5 tons, and the loading time corresponding to loading plan 1 is 10 minutes;
[0076] The loading quantity corresponding to loading plan 2 is 6 tons, and the loading time corresponding to loading plan 1 is 15 minutes;
[0077] The loading quantity corresponding to loading plan 3 is 7 tons, and the loading time corresponding to loading plan 1 is 30 minutes.
[0078] The loading plan with the largest ratio of loading quantity to loading time is loading plan 1. Loading plan 1 is used as the target plan, and the list of function identifiers in the target plan is obtained.
[0079] S23. Read the quantitative control function identifier, anti-overflow protection function identifier, anti-static protection function identifier, and permission setting function identifier in the list of function identifiers;
[0080] Among them, the quantitative control function is identified by the identifier of the quantitative control function.
[0081] Among them, the quantitative control function of the batch controller refers to precisely controlling the feeding amount of materials in the production process through preset parameters to ensure that each operation can reach the set target value. This function usually monitors the material flow in real time based on sensors and combines a feedback mechanism to automatically adjust the actuator to achieve high-precision quantitative control.
[0082] For ease of explanation, the following is an example:
[0083] During the loading process in an oil depot, when loading starts, the batch controller will precisely measure and control the outflow of oil products. The batch controller will perform real-time calculations and monitoring based on the preset loading amount. When the loaded amount of oil products reaches the set target value, the batch controller will automatically send a signal to control the oil loading system to stop further loading. In this process, through the quantitative control function, the batch controller ensures the accuracy of the loaded oil amount, avoiding waste of oil products and ensuring the loading efficiency.
[0084] Among them, the anti-overflow protection function is identified by the identifier of the anti-overflow protection function.
[0085] The anti-overflow protection function of the batch controller refers to its function of preventing material overflow by triggering a control mechanism automatically when the liquid level of the liquid material reaches the preset safety upper limit through real-time monitoring of the liquid level state.
[0086] For ease of explanation, the following is an example:
[0087] During the loading process in an oil depot, the batch controller is usually equipped with sensors of anti-overflow liquid level switches, which can precisely sense the liquid level of oil in the container. When the liquid level gradually rises and approaches the preset safety threshold, the sensor will send a signal to the batch controller. After receiving the signal, the batch controller will immediately make a judgment according to the preset program logic. Once it confirms the existence of an overflow risk, the sensor will quickly issue a control instruction, such as closing the oil loading valve, thus effectively cutting off the continuous inflow of oil and avoiding the occurrence of oil overflow accidents.
[0088] Among them, the anti-static protection function is identified by the identifier of the anti-static protection function.
[0089] The anti-static protection function of the batch controller refers to its function of protecting the safety of liquid materials during loading by preventing fires, explosions, etc. caused by static electricity discharge through real-time monitoring and control of the generation and accumulation of static charges.
[0090] During the loading process in an oil depot, the anti-static protection function of the batch controller refers to its function of increasing the safety during loading by preventing fires, explosions, etc. caused by static electricity discharge through real-time monitoring and control of the generation and accumulation of static charges.
[0091] For ease of explanation, the following example is given:
[0092] During the process of loading oil into trucks at the oil depot, the batch controller continuously monitors the static electricity levels in the loading system, the tanker trucks, and the surrounding environment. When it detects that the static electricity charge has accumulated to a certain extent, which may pose a safety threat, the batch controller will immediately take corresponding measures, such as automatically starting the static electricity elimination device, or closing the loading valve through the control logic to suspend the loading operation until the static electricity risk is eliminated. This process ensures that the static electricity charge will not discharge due to excessive accumulation, effectively avoiding safety accidents caused by static electricity and guaranteeing the safety of the oil depot loading operation.
[0093] Among them, the permission setting function identifier is the identifier of the permission setting function.
[0094] The permission setting function of the batch controller refers to the function that allows administrators or authorized users to perform fine-grained configuration and management of the operation permissions of the controller according to actual needs.
[0095] For example, it is set that user A can start or stop the loading process, user B can modify the loading parameters, and user C can view the loading records. Through the permission setting function, the batch controller ensures that only authorized personnel can perform critical operations, thus effectively preventing unauthorized operations and guaranteeing the safety and compliance of the loading operation.
[0096] S24, create a first subroutine according to the execution code corresponding to the quantitative control function identifier, create a second subroutine according to the execution code corresponding to the overflow protection function identifier, create a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and create a fourth subroutine according to the execution code corresponding to the permission setting function identifier;
[0097] Among them, the step of creating a first subroutine according to the execution code corresponding to the quantitative control function identifier, creating a second subroutine according to the execution code corresponding to the overflow protection function identifier, creating a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and creating a fourth subroutine according to the execution code corresponding to the permission setting function identifier includes:
[0098] Obtain the execution code corresponding to the quantitative control function identifier, the execution code corresponding to the quantitative control function identifier, the execution code corresponding to the overflow protection function identifier, the execution code corresponding to the anti-static protection function identifier, the execution code corresponding to the report function identifier, and the execution code corresponding to the permission setting function identifier;
[0099] Create a first subroutine according to the execution code corresponding to the quantitative control function identifier, create a second subroutine according to the execution code corresponding to the overflow protection function identifier, create a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and create a fourth subroutine according to the execution code corresponding to the permission setting function identifier.
[0100] Create a first subroutine according to the execution code corresponding to the quantitative control function identifier, create a second subroutine according to the execution code corresponding to the overflow protection function identifier, create a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and create a fourth subroutine according to the execution code corresponding to the permission setting function identifier, which realizes the modular design of the program, enabling the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine to all focus on completing specific tasks or functions. This decomposition method not only makes the code structure more organized and easier for developers to understand and maintain, but also improves flexibility.
[0101] S25, create a call interface corresponding to the first subroutine, create a call interface corresponding to the second subroutine, create a call interface corresponding to the third subroutine, and create a call interface corresponding to the fourth subroutine;
[0102] Create a call interface corresponding to the first subroutine, create a call interface corresponding to the second subroutine, create a call interface corresponding to the third subroutine, and create a call interface corresponding to the fourth subroutine, which reduces the coupling degree between the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine. Therefore, the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine can all be developed, tested, and maintained independently, thus greatly enhancing the stability of the development efficiency of the main program in the batch controller.
[0103] S26, store the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file, and package the target file to generate a service component of the main program in the batch controller.
[0104] As the control center, the main program can dynamically call and execute the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine according to needs through this intermediate layer of the service component, making the main program easier to manage and expand. Since the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine are all independent modules, the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine can be reused in different scenarios. This design method improves the reusability of the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine.
[0105] In addition, this approach enhances the maintainability of the main program. Because when a function needs to be modified or upgraded, only the corresponding subroutine needs to be modified, without changing the main program, thus simplifying the maintenance process of the main program.
[0106] For ease of explanation, the following is an example:
[0107] When the quantitative control function needs to be modified or upgraded, only the first subroutine needs to be operated on. When the quantitative control function needs to be modified or upgraded, only the first subroutine needs to be operated on, without changing the second, third, and fourth subroutines, thus reducing the error risk of the second, third, and fourth subroutines.
[0108] When the anti-overflow protection function needs to be modified or upgraded, only the second subroutine needs to be operated on, without changing the first, third, and fourth subroutines, thus reducing the error risk of the first, third, and fourth subroutines.
[0109] When the anti-static protection function needs to be modified or upgraded, only the third subroutine needs to be operated on, without changing the first, second, and fourth subroutines, thus reducing the error risk of the first, second, and fourth subroutines.
[0110] When the permission setting function needs to be modified or upgraded, only the fourth subroutine needs to be operated on, without changing the first, second, and third subroutines, thus reducing the error risk of the first, second, and third subroutines.
[0111] Among them, after storing the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file, packing the target file to generate the service component of the main program in the batch controller, the component acquisition method includes:
[0112] Store the service component of the main program in the storage area and create an access interface for the storage area.
[0113] When the program needs to be modified, through the access interface, the source code in the service component can be directly accessed to quickly locate the part that needs to be adjusted, without searching in the complex file system.
[0114] In the embodiments of the present invention, the beneficial effects are in two aspects. On the one hand, the call interfaces corresponding to the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine are stored in a target file, and the target file is packaged to generate a service component of the main program in the batch controller. Since there is no need to manually obtain the service component of the main program in the batch controller, the acquisition time of the service component of the main program in the batch controller is reduced, which is beneficial to improving the acquisition efficiency of the service component of the main program in the batch controller. On the other hand, since it will not be affected by manual intervention, it is beneficial to improve the reliability of the service component of the main program in the batch controller.
[0115] Please refer to Figure 3 , Figure 3 is Figure 2 the schematic flowchart of step S23 in
[0116] S31, obtain the usage frequency corresponding to the function identifier list;
[0117] S32, when the usage frequency is greater than the preset frequency, read the quantitative control function identifier, anti-overflow protection function identifier, anti-static protection function identifier, and permission setting function identifier in the function list.
[0118] When the usage frequency is greater than the preset frequency, it indicates that the function identifier list is reasonably designed and practical, meaning that the quantitative control function identifier, anti-overflow protection function identifier, anti-static protection function identifier, and permission setting function identifier in the function identifier list are frequently required by the current user or task.
[0119] In the embodiments of the present invention, when the usage frequency is greater than the preset frequency, read the quantitative control function identifier, anti-overflow protection function identifier, anti-static protection function identifier, and permission setting function identifier in the function list. This on-demand reading method improves the operating efficiency of the system and reduces unnecessary overhead.
[0120] Please refer to Figure 4 , Figure 4 is Figure 2 the schematic flowchart of step S25 in
[0121] S41, obtain the call information corresponding to the first subroutine, the call information corresponding to the second subroutine, the call information corresponding to the third subroutine, and the call information corresponding to the fourth subroutine;
[0122] S42. Create a call interface corresponding to the first subroutine according to the call information corresponding to the first subroutine, create a call interface corresponding to the second subroutine according to the call information corresponding to the second subroutine, create a call interface corresponding to the third subroutine according to the call information corresponding to the third subroutine, and create a call interface corresponding to the fourth subroutine according to the call information corresponding to the fourth subroutine.
[0123] In the embodiment of the present invention, since the coupling degree between the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine is reduced, the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine can all be developed, tested, and maintained independently. Therefore, the stability of the development efficiency of the main program in the batch controller is greatly improved.
[0124] Please refer to Figure 5 , Figure 5 is Figure 2 the schematic flowchart of step S26 in
[0125] S51. Store the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file.
[0126] Exemplarily, storing the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file includes:
[0127] Call the first subroutine according to the call interface corresponding to the first subroutine, record the call result of the first subroutine, and obtain the memory occupied by the first subroutine from the call result of the first subroutine.
[0128] Call the second subroutine according to the call interface corresponding to the second subroutine, record the call result of the second subroutine, and obtain the memory occupied by the second subroutine from the call result of the second subroutine.
[0129] Call the third subroutine according to the call interface corresponding to the third subroutine, record the call result of the third subroutine, and obtain the memory occupied by the third subroutine from the call result of the third subroutine.
[0130] Call the fourth subroutine according to the call interface corresponding to the fourth subroutine, record the call result of the fourth subroutine, and obtain the memory occupied by the fourth subroutine from the call result of the fourth subroutine.
[0131] Add up the memory occupied by the first subroutine, the memory occupied by the second subroutine, the memory occupied by the third subroutine, and the memory occupied by the fourth subroutine to obtain the total occupied memory.
[0132] When the total occupied memory is less than the preset occupied memory, store the call interfaces corresponding to the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine in a target file.
[0133] When the total occupied memory is less than the preset occupied memory, it indicates that the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine meet the expected requirements in terms of memory usage. This can avoid the lag caused by insufficient memory in the batch controller, ensure the scalability and stability of the batch controller, and enable the batch controller to run the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine smoothly.
[0134] S52, obtain a packaging instruction, execute the packaging instruction, and package the target file to generate a service component of the main program in the batch controller.
[0135] In the embodiment of the present invention, obtaining a packaging instruction, executing the packaging instruction, and packaging the target file to generate a service component of the main program in the batch controller. Since there is no need to manually obtain the service component of the main program in the batch controller, the acquisition time of the service component of the main program in the batch controller is reduced, which is beneficial to improving the acquisition efficiency of the service component of the main program in the batch controller.
[0136] Please refer to Figure 6 , Figure 6 is a schematic structural diagram of a component acquisition device in an embodiment of the present invention. As Figure 6 shown, the component acquisition device includes a first acquisition module 101, a second acquisition module 102, a reading module 103, a first creation module 104, a second creation module 105, and a third acquisition module 106. The detailed description of each functional module is as follows:
[0137] The first acquisition module 101 is used to acquire the device document of the batch controller and read the industry identifier in the device document;
[0138] The second acquisition module 102 is used to acquire multiple loading plans corresponding to the industry identifier, obtain a target plan among the multiple loading plans, and obtain a list of function identifiers in the target plan;
[0139] The reading module 103 is used to read the quantitative control function identifier, the anti-overflow protection function identifier, the anti-static protection function identifier, and the permission setting function identifier in the list of function identifiers;
[0140] The first creation module 104 is configured to create a first subroutine according to the execution code corresponding to the quantitative control function identifier, create a second subroutine according to the execution code corresponding to the anti-overflow protection function identifier, create a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and create a fourth subroutine according to the execution code corresponding to the permission setting function identifier;
[0141] The second creation module 105 is configured to create a call interface corresponding to the first subroutine, create a call interface corresponding to the second subroutine, create a call interface corresponding to the third subroutine, and create a call interface corresponding to the fourth subroutine;
[0142] The third acquisition module 106 is configured to store the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file, and package the target file to generate a service component of the main program in the batch controller.
[0143] In the embodiment of the present invention, the beneficial effects are in two aspects. On the one hand, the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine are stored in a target file, and the target file is packaged to generate a service component of the main program in the batch controller. Since there is no need to manually obtain the service component of the main program in the batch controller, the acquisition time of the service component of the main program in the batch controller is reduced, which is beneficial to improving the acquisition efficiency of the service component of the main program in the batch controller. On the other hand, since it is not affected by manual intervention, it is beneficial to improve the reliability of the service component of the main program in the batch controller.
[0144] For the specific limitations of the component acquisition device, reference can be made to the limitations on the component acquisition method in the above text, which will not be elaborated here.
[0145] Each module in the above component acquisition device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above respective modules.
[0146] Please refer to Figure 7 , Figure 7 is a schematic structural diagram of a computer device in an embodiment of the present invention. In one embodiment, a computer device is provided. The computer device is a server device or a client device, and its internal structure diagram can be as Figure 7As shown in the figure. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with external devices. When the computer program is executed by the processor, it can implement the functions or steps of a component acquisition method for a batch controller.
[0147] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor.
[0148] It should be noted that for the functions or steps that can be achieved by the above computer-readable storage medium or computer device, reference can be made to the relevant descriptions in the foregoing method embodiments. To avoid repetition, they will not be described in detail here.
[0149] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU for short), a Graphics Processing Unit (GPU for short), and a Network Processor (NP for short); it may also be a Digital Signal Processor (DSP for short), an Application Specific Integrated Circuit (ASIC for short), a Field-Programmable Gate Array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0150] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure, enabling those skilled in the art to practice them. In this article, each embodiment may focus on the differences from other embodiments, and the same or similar parts between the embodiments may be referred to each other. For the methods disclosed in the embodiments, if they correspond to the method parts disclosed in the embodiments, the relevant parts can be referred to the description of the method parts.
[0151] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner can depend on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the embodiments of the present disclosure.
Claims
1. A method for obtaining components of a batch controller, characterized in that, Including: Obtain the device document of the batch controller and read the industry identifier in the device document; Obtain multiple loading plans corresponding to the industry identifier. Among the multiple loading plans, obtain the target plan and obtain the function identifier list in the target plan; Read the quantitative control function identifier, overflow protection function identifier, anti-static protection function identifier, and permission setting function identifier in the function identifier list; Create a first subroutine according to the execution code corresponding to the quantitative control function identifier, create a second subroutine according to the execution code corresponding to the overflow protection function identifier, create a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and create a fourth subroutine according to the execution code corresponding to the permission setting function identifier; Create a call interface corresponding to the first subroutine, create a call interface corresponding to the second subroutine, create a call interface corresponding to the third subroutine, and create a call interface corresponding to the fourth subroutine; Store the call interfaces corresponding to the first subroutine, the call interface corresponding to the second subroutine, the call interface corresponding to the second subroutine, and the call interface corresponding to the fourth subroutine in a target file, and package the target file to generate a service component of the main program in the batch controller.
2. The component obtaining method according to claim 1, wherein The obtaining of multiple loading plans corresponding to the industry identifier, obtaining the target plan among the multiple loading plans, and obtaining the function identifier list in the target plan include: Obtain a query statement carrying the industry identifier, select the query statement carrying the industry identifier as a query request, send the query request to the database, and receive the query result returned by the database according to the query request; Among the query results, obtain multiple loading plans corresponding to the industry identifier, obtain the target plan among the multiple loading plans, and obtain the function identifier list in the target plan.
3. The component obtaining method according to claim 1, wherein The reading of the quantitative control function identifier, overflow protection function identifier, anti-static protection function identifier, and permission setting function identifier in the function identifier list includes: Obtain the usage frequency corresponding to the function identifier list; When the usage frequency is greater than the preset frequency, read the quantitative control function identifier, overflow protection function identifier, anti-static protection function identifier, and permission setting function identifier in the function list.
4. The component obtaining method according to claim 1, wherein The creating of a first subroutine according to the execution code corresponding to the quantitative control function identifier, creating a second subroutine according to the execution code corresponding to the overflow protection function identifier, creating a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and creating a fourth subroutine according to the execution code corresponding to the permission setting function identifier includes: Obtain the execution code corresponding to the quantitative control function identifier, the execution code corresponding to the quantitative control function identifier, the execution code corresponding to the overflow protection function identifier, the execution code corresponding to the anti-static protection function identifier, the execution code corresponding to the report function identifier, and the execution code corresponding to the permission setting function identifier; Create a first subroutine according to the execution code corresponding to the quantitative control function identifier, create a second subroutine according to the execution code corresponding to the overflow protection function identifier, create a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and create a fourth subroutine according to the execution code corresponding to the permission setting function identifier.
5. The component obtaining method according to claim 1, wherein Creating the call interfaces corresponding to the first subroutine, the second subroutine, the third subroutine, and the fourth subroutine includes: Obtaining the call information corresponding to the first subroutine, the call information corresponding to the second subroutine, the call information corresponding to the third subroutine, and the call information corresponding to the fourth subroutine; Creating the call interface corresponding to the first subroutine according to the call information corresponding to the first subroutine, creating the call interface corresponding to the second subroutine according to the call information corresponding to the second subroutine, creating the call interface corresponding to the third subroutine according to the call information corresponding to the third subroutine, and creating the call interface corresponding to the fourth subroutine according to the call information corresponding to the fourth subroutine.
6. The component obtaining method according to claim 1, characterized in that Storing the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file, and packaging the target file to generate the service component of the main program in the batch controller includes: Storing the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file; Obtaining a packaging instruction, executing the packaging instruction, and packaging the target file to generate the service component of the main program in the batch controller.
7. The component obtaining method according to claim 1, wherein After storing the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file, and packaging the target file to generate the service component of the main program in the batch controller, the component acquisition method includes: Storing the service component of the main program in a storage area and creating an access interface for the storage area.
8. A component acquisition device for a batch controller, characterized in that, Including: A first acquisition module for obtaining the device document of the batch controller and reading the industry identifier in the device document; A second acquisition module for obtaining multiple loading plans corresponding to the industry identifier, obtaining a target plan among the multiple loading plans, and obtaining a list of function identifiers in the target plan; A reading module for reading the quantitative control function identifier, the overflow protection function identifier, the anti-static protection function identifier, and the permission setting function identifier in the list of function identifiers; A first creation module for creating a first subroutine according to the execution code corresponding to the quantitative control function identifier, creating a second subroutine according to the execution code corresponding to the overflow protection function identifier, creating a third subroutine according to the execution code corresponding to the anti-static protection function identifier, and creating a fourth subroutine according to the execution code corresponding to the permission setting function identifier; A second creation module for creating the call interface corresponding to the first subroutine, creating the call interface corresponding to the second subroutine, creating the call interface corresponding to the third subroutine, and creating the call interface corresponding to the fourth subroutine; A third acquisition module, configured to store the call interfaces corresponding to the first subroutine, the second subroutine, the second subroutine, and the fourth subroutine in a target file, and package the target file to generate a service component of the main program in the batch controller.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the component acquisition method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the steps of the component acquisition method according to any one of claims 1 to 7 are implemented.