Program development method, computer equipment and computer storage medium

By using framework code and customized code in a unified way, the tasks in software development are divided into services, work and tasks, solving the problem that code is difficult to understand and expand in traditional software development, and achieving more efficient and high-quality software development.

CN119806499APending Publication Date: 2025-04-11WUHAN XINRUI SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411867530.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the traditional software development process, due to the different programming skills and knowledge backgrounds mastered by developers, the code writing methods for the same program functions are different, making the code difficult to be understood by other developers and is not convenient for expansion and modification, which hinders the progress of software development work.

Method used

By using the code structure of framework code and custom code in a unified way, we divide the things to be completed into services, work and tasks, obtain framework code and custom code, create structures of target services, target work and target tasks, and run these structures to achieve specific operations.

Benefits of technology

This method makes the code structure clearer, easy to understand and expand, reduces code maintenance problems caused by different developers and programming methods, and improves the efficiency and quality of software development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806499A_ABST
    Figure CN119806499A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a program development method, computer equipment and a computer storage medium. The framework code is used for defining attributes and methods of services, attributes and methods of works and attributes and methods of tasks, and the customized code is used for setting attribute parameters and method parameters corresponding to target services, target works and target tasks. And creating a structural body of the target service, a structural body of the target work and a structural body of the target task according to the frame code and the customized code, running the structural body of the target service and the structural body of the target work, and running the structural body of the target task to execute corresponding operation based on the method parameters of the target task. According to the technical scheme, the code structures of the frame codes and the customized codes are used in a unified mode to divide items to be completed into services, work and tasks, a user can formulate the corresponding customized codes based on the frame codes according to actual needs so as to run the corresponding items, the user can conveniently expand and use the codes, and the user can conveniently understand the code structures.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of program development, and specifically to a program development method, a computer device, and a computer storage medium. Background Art

[0002] One of the core of programming is to divide the things to be done into multiple steps, complete them step by step, and finally complete a task.

[0003] Software development involves the process of program programming. In the traditional software development process, due to differences in programming skills and knowledge background of developers, different developers use different programming methods to program similar program functions. As a result, the code written by developers may not be easy for other developers to understand and is not easy to expand. In addition, changing the code may also introduce other problems, which hinders the progress of software development. Summary of the invention

[0004] The embodiments of the present application provide a program development method, a computer device, and a computer storage medium, which are used to uniformly use the code structure of framework code and custom code to divide the matters to be completed into services, work, and tasks, thereby facilitating the user's expansion and use of the code, and also facilitating the user's understanding of the code structure, which is conducive to the development of software development work.

[0005] A first aspect of an embodiment of the present application provides a program development method, the method comprising:

[0006] Obtaining a framework code, wherein the framework code is used to define properties and methods of a service, properties and methods of a job, and properties and methods of a task;

[0007] Obtaining a custom code determined based on the framework code, the custom code being used to set attribute parameters and method parameters of a target service, attribute parameters and method parameters of a target work, and attribute parameters and method parameters of a target task; wherein the target work is set by the attribute parameters of the target service, and the target task is set by the attribute parameters of the target work;

[0008] Create a structure of the target service, a structure of the target work, and a structure of the target task according to the framework code and the custom code;

[0009] Running the structure of the target service to run the structure of the target work based on the method parameters of the target service, and running the structure of the target task based on the method parameters of the target work when running the structure of the target work; and,

[0010] When the structure of the target task is run, the operation set by the attribute parameters of the target task is executed based on the method parameters of the target task.

[0011] Optionally, the method parameter of the target service is used to set a control method for the work;

[0012] The structure of running the target service, to run the structure of the target work based on the method parameters of the target service, includes:

[0013] The structure of the target service is run to perform corresponding control operations on the structure of the target work based on the control method set by the method parameters of the target service.

[0014] Optionally, the attribute parameters of the target service include a work queue, and the work queue is used to store the work corresponding to the target service; the target work is one of the work queues;

[0015] The method of the target service includes a work start method, and the method parameter of the work start method is used to indicate the start of the work in the work queue;

[0016] The structure of running the target service performs a corresponding control operation on the structure of the target work based on the control method set by the method parameter of the target service, including:

[0017] Run the structure of the target service to start the structure of the target work in the work queue based on the method parameters of the work start method.

[0018] Optionally, the method parameter of the target service is specifically used to set one or more of adding, deleting and adjusting the execution order of the work;

[0019] The attribute parameters of the target service include a work queue, and the work queue is used to store the work corresponding to the target service;

[0020] The method further comprises:

[0021] Running the structure of the target service to add a new job based on the method parameters of the target service, and adding the new job to the job queue of the target service;

[0022] or,

[0023] Running the structure of the target service to delete the work to be deleted from the work queue based on the deletion work set by the method parameters of the target service;

[0024] or,

[0025] The structure of the target service is run to adjust the execution order of the plurality of tasks in the task queue based on the adjusted execution order set by the method parameter of the target service.

[0026] Optionally, the attribute parameters of the target work include a task queue, and the task queue is used to store tasks corresponding to the target work; the target task is one of the task queues;

[0027] The step of running the target task structure based on the method parameters of the target task when running the target task structure includes:

[0028] When the structure of the target task is run, the structure of each task in the task queue is run in sequence according to the execution order of the multiple tasks in the task queue based on the method parameters of the target task.

[0029] Optionally, the attribute parameters of the target task are also used to set a timeout timer for task execution;

[0030] The method further comprises:

[0031] When running the structure of the target task, the timeout timer set based on the attribute parameters of the target task determines whether the operation of the structure of the target task has timed out, and when the operation of the structure of the target task has timed out, the result of the target task operation timeout is fed back to the target service.

[0032] Optionally, the creating the structure of the target service, the structure of the target work, and the structure of the target task according to the framework code and the custom code includes:

[0033] Calling a service creation interface to create a structure of the target service according to the service attributes and methods in the framework code and the attribute parameters and method parameters of the target service in the custom code; and,

[0034] Calling a job creation interface to create a structure of the target job according to the properties and methods of the job in the framework code and the property parameters and method parameters of the target job in the custom code; and,

[0035] The task creation interface is called to create the structure of the target task according to the attributes and methods of the task in the framework code and the attribute parameters and method parameters of the target task in the custom code.

[0036] A second aspect of an embodiment of the present application provides a computer device, the computer device comprising:

[0037] A first acquisition unit is used to acquire a framework code, where the framework code is used to define the attributes and methods of a service, the attributes and methods of a job, and the attributes and methods of a task;

[0038] A second acquisition unit is used to acquire a custom code determined based on the framework code, wherein the custom code is used to set the attribute parameters and method parameters of the target service, the attribute parameters and method parameters of the target work, and the attribute parameters and method parameters of the target task; wherein the target work is set by the attribute parameters of the target service, and the target task is set by the attribute parameters of the target work;

[0039] A creation unit, used for creating a structure of the target service, a structure of the target work and a structure of the target task according to the framework code and the custom code;

[0040] an operating unit, configured to operate the structure of the target service, to operate the structure of the target work based on the method parameters of the target service, and to operate the structure of the target task based on the method parameters of the target work when operating the structure of the target work; and

[0041] The running unit is further configured to execute the operation set by the attribute parameters of the target task based on the method parameters of the target task when running the structure of the target task.

[0042] A third aspect of an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the method of the first aspect when executing the computer program.

[0043] A fourth aspect of an embodiment of the present application provides a computer storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes the method of the first aspect.

[0044] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0045] The framework code is used to define the properties and methods of the service, the properties and methods of the work, and the properties and methods of the task. The custom code is used to set the property parameters and method parameters of the target service, the property parameters and method parameters of the target work, and the property parameters and method parameters of the target task. The structure of the target service, the structure of the target work, and the structure of the target task can be created based on the framework code and the custom code, and the structure of the target service can be run to run the structure of the target work based on the method parameters of the target service, and when running the structure of the target work, the structure of the target task can be run based on the method parameters of the target work, and when running the structure of the target task, the operation set by the property parameters of the target task can be performed based on the method parameters of the target task. Therefore, the code structure that uniformly uses the framework code and the custom code divides the tasks to be completed into services, tasks, and tasks. Users can formulate corresponding custom codes based on the framework code according to actual needs to run corresponding tasks, which facilitates the user's expansion and use of the code, and also facilitates the user's understanding of the code structure, which is conducive to the development of software development. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 A flowchart of a program development method in an embodiment of the present application;

[0047] Figure 2 An exemplary property and method diagram of a service defined by the framework code in an embodiment of the present application;

[0048] Figure 3 In the embodiments of this application, based on Figure 2 The service structure created by the framework code of the service and its corresponding custom code;

[0049] Figure 4 An exemplary property and method diagram of a job defined by the framework code in an embodiment of the present application;

[0050] Figure 5 In the embodiments of this application, based on Figure 4 The structure of the work created by the skeleton code of the work shown and its corresponding custom code;

[0051] Figure 6 An exemplary property and method diagram of a task (Mission) defined by the framework code in an embodiment of the present application;

[0052] Figure 7 In the embodiments of this application, based on Figure 6 The framework code of the task shown and the structure of the task created by its corresponding custom code;

[0053] Figure 8Some exemplary creation interface diagrams for creating structures corresponding to target services, target tasks and target tasks in the embodiments of the present application;

[0054] Fig. 9 This is a schematic diagram of the structure of a computer device in an embodiment of the present application;

[0055] Fig.10 This is another structural diagram of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

[0056] The embodiments of the present application provide a program development method, a computer device, and a computer storage medium, which are used to uniformly use the code structure of framework code and custom code to divide the matters to be completed into services, work, and tasks, thereby facilitating the user's expansion and use of the code, and also facilitating the user's understanding of the code structure, which is conducive to the development of software development work.

[0057] The following describes the program development method in the embodiment of the present application:

[0058] See also Figure 1 In the embodiment of the present application, one embodiment of the program development method includes:

[0059] 101. Obtain a framework code, where the framework code is used to define properties and methods of a service, properties and methods of a job, and properties and methods of a task;

[0060] The method of this embodiment can be applied to a computer device, which can be a server, terminal, or other computer device capable of performing data processing. When the computer device is a terminal, it can be a terminal device such as a personal computer (PC) or a desktop computer; when the computer device is a server, it can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud databases, cloud computing, and big data and artificial intelligence platforms.

[0061] The computer device may obtain a framework code, which is used to define the attributes and methods of a service, the attributes and methods of a job, and the attributes and methods of a mission. Specifically, the types of the above attributes may be defined, and the types of the above methods may be defined. Among them, an attribute refers to a feature or state of an object, and a method refers to a behavior or operation of an object.

[0062] For example, the attributes of a service can be defined to include the attributes corresponding to the static data and dynamic data of the service. The static data can characterize the characteristics of the service. The attributes corresponding to the static data can be the service name, the work included in the service, or the final execution result of the service, etc., which are attributes characterizing the characteristics of the service. The attributes corresponding to the dynamic data can be the status of the service (such as idle, paused, running, etc.), the identifier of the work currently being executed in the service, the time when the service was created, the time limit for the execution of the service, etc., which are attributes characterizing the status of the service.

[0063] The methods that can be defined for a service include methods for controlling the work of the service, methods for calling the service, and other methods related to the behavior or operation of the service.

[0064] Similarly, the attributes of a job can be attributes that characterize the characteristics or status of the job, such as the job name, the tasks included in the job, etc. The methods of a job can be methods related to the behavior or operation of the job, such as the calling method of the job.

[0065] The attributes of a task can be attributes that characterize the characteristics or status of the task, such as the task name, task-related matters, etc. The method of a task can be a method related to the behavior or operation of the task, such as the method of calling the task.

[0066] 102. Obtain a custom code determined based on the framework code, wherein the custom code is used to set attribute parameters and method parameters of a target service, attribute parameters and method parameters of a target job, and attribute parameters and method parameters of a target task;

[0067] When the framework code defines the properties and methods of services, jobs and tasks, users can customize the specific parameters of the properties and methods of the above objects based on the framework code to customize specific services and specific jobs, as well as specific tasks. Therefore, the computer device can obtain the customized code determined based on the framework code, and the customized code is used to set the property parameters and method parameters of the target service, the property parameters and method parameters of the target job, and the property parameters and method parameters of the target task. The specific service content, work content and specific task content can be determined by combining the framework code and the customized code.

[0068] For example, the framework code defines the attribute "Service Name", and the custom code sets the attribute parameter corresponding to this attribute to "Remote StartAC charge", which means that the specific service that the user needs to implement is "Remote Start AC Charge". The framework code defines the method "MethodStart (Start a job), and the custom code sets the method parameter corresponding to this method to "Service_Method_start()", which means that the user needs to start a job.

[0069] Therefore, the attribute parameters of the target service can set the target work included in the target service, and the attribute parameters of the target work can set the target tasks included in the target work.

[0070] 103. Create a structure of the target service, a structure of the target work, and a structure of the target task according to the framework code and the custom code;

[0071] After obtaining the framework code and custom code, the target service structure, target work structure and target task structure can be created according to the framework code and custom code. As part of the program code, the structure can be executed to implement specific matters of the object. For example, the structure of running the target service can implement the corresponding service matters, such as realizing the above-mentioned remote start of AC charging; the structure of running the target work can execute the corresponding work matters; the structure of running the target task can execute the operation corresponding to the target task.

[0072] 104. Run the structure of the target service to run the structure of the target work based on the method parameters of the target service, and run the structure of the target task based on the method parameters of the target work when running the structure of the target work;

[0073] 105. When running the structure of the target task, execute the operation set by the attribute parameters of the target task based on the method parameters of the target task;

[0074] The computer device can run the structure of the target service. Since the target service is composed of at least one target work, and the target work is composed of at least one target task, the structure of the target work can be run based on the method parameters of the target service, and when running the structure of the target work, the structure of the target task can be run based on the method parameters of the target work.

[0075] When the target task structure is running, it can perform the operations set by the target task attribute parameters based on the target task method parameters. For example, Figure 7A structure of a target task is shown. The target task is to send a CAN signal to the CAN bus. One of its attributes is "U32CanSignalValue", which indicates the value of the signal sent to the CAN bus. Its corresponding attribute parameter is "RemoteAcChargeReq_Start", that is, the operation set by the attribute parameter of the target task is to send the CAN signal with a signal value of "RemoteAcChargeReq_Start" to the CAN bus. Therefore, the above signal value can be sent to the CAN bus based on the method parameters of the target task, thereby executing the operation set by the attribute parameters of the target task.

[0076] When all target tasks of the target work are completed, the target work is also completed accordingly. When all target works of the target service are completed, the target service is also completed accordingly, thereby realizing the service customized by the user.

[0077] In this embodiment, the framework code is used to define the attributes and methods of the service, the attributes and methods of the work, and the attributes and methods of the task, and the custom code is used to set the attribute parameters and method parameters of the target service, the attribute parameters and method parameters of the target work, and the attribute parameters and method parameters of the target task. The structure of the target service, the structure of the target work, and the structure of the target task can be created according to the framework code and the custom code, and the structure of the target service can be run to run the structure of the target work based on the method parameters of the target service, and when running the structure of the target work, the structure of the target task can be run based on the method parameters of the target work, and when running the structure of the target task, the operation set by the attribute parameters of the target task can be performed based on the method parameters of the target task. Therefore, the code structure of the framework code and the custom code is uniformly used to divide the matters to be completed into services, works, and tasks. Users can formulate corresponding custom codes based on the framework code according to actual needs to run corresponding matters, which is convenient for users to expand and use the code, and also convenient for users to understand the code structure, which is conducive to the development of software development.

[0078] based on Figure 1 In an optional implementation of the embodiment shown, the method parameter of the target service is used to set the control method of the work. Therefore, when the structure of the target service is run, the corresponding control operation can be performed on the structure of the target work based on the control method set by the method parameter of the target service.

[0079] Specifically, in one implementation, the control method may be a method for starting a job. The attribute parameters of the target service include a job queue, which is used to store jobs corresponding to the target service, that is, the target job is one of the jobs in the job queue. The method of the target service includes a job start method, and the method parameters of the job start method are used to indicate the start of the job in the job queue.

[0080] Therefore, when running the structure of the target service, the method parameters of the work start method are set to start the operation of the target work. Then, based on the method parameters of the work start method, the structure of the target work in the work queue can be started to run, that is, the structure of the target work is run to complete the operation steps corresponding to the target work.

[0081] For example, Figure 2 The diagram exemplifies the properties and methods of a service defined by a framework code. It can be seen that the service properties defined by the framework code can be divided into properties corresponding to the static data of the service and properties corresponding to the dynamic data of the service. The properties of the static data of the service are mainly used to describe the characteristics of the service, such as the service name, the maximum number of jobs that the service can have, the job queue of the service, and other properties; the properties of the dynamic data of the service are mainly used to describe the status of the service, such as the status of the service, the job index (job identifier) ​​currently executed by the service, the time when the service was created, and other properties.

[0082] The service methods include methods for controlling jobs, such as MethodAddJob (method for adding a job), MethodStart (method for starting a job), and MethodStartNextJob (method for starting the next job), etc. Figure 2 Other control methods for tasks that are not listed may also include, for example, methods for deleting tasks, methods for adjusting the execution order of tasks, and the like.

[0083] Furthermore, based on Figure 2 The framework code of the service shown in the figure formulates the corresponding custom code, that is, determines the attribute parameters and method parameters of the service, so as to combine the framework code and the custom code to obtain the structure of the service. An example of its structure is shown in Figure 3 Therefore, when running Figure 3 As shown in the structure, the structure defines the Job queue and the scheduler (JobScheduler) for the Job, as well as various control methods for the Job. For example, a job in the work queue JobList can be started based on the method parameters of the MethodStart method, or the next job of the current job in the work queue can be started based on the method parameters of the MethodStartNextJob method when the current job is completed.

[0084] Therefore, by applying the work start method and its method parameters, the orderly operation of the structures of multiple tasks in the Service can be achieved, which is conducive to improving the completion efficiency of the Service.

[0085] The above is an application scenario about starting a Job using a service method and its method parameters. In other scenarios, the method parameters of the target service can also be used to set one or more of adding, deleting, and adjusting the execution order of jobs. When running the structure of the target service, the new job can be added to the job queue of the target service based on the addition of the new job set by the method parameters of the target service; or, the job to be deleted can be deleted from the job queue based on the deletion of the job set by the method parameters of the target service; or, the execution order between multiple jobs in the job queue can be adjusted based on the adjustment of the execution order set by the method parameters of the target service.

[0086] For example, when running a service structure, a new job can be added to the JobList based on the MethodAddJob method and its method parameters. Alternatively, a job in the JobList can be deleted based on the Delete method and its method parameters. Alternatively, the execution order of multiple methods in the JobList can be adjusted based on the Execution Order Adjustment method and its method parameters.

[0087] Therefore, through control methods such as adding, deleting, and adjusting the execution order of work, the work queue of the service can be adjusted, which is convenient for users to arbitrarily adjust the work items of the service according to actual business needs, which is conducive to users' code expansion. Moreover, users only need to change the method parameters corresponding to the above control methods and do not need to change the framework code, which can avoid large-scale code changes and the introduction of other problems, thereby solving the problems of code being difficult to expand, code changes easily introducing problems, and code structure being difficult to understand due to factors such as different developers and different programming methods.

[0088] based on Figure 1 In an optional implementation of the illustrated embodiment, when running the structure of the target work, the structure of each task in the task queue can be run in sequence according to the execution order of multiple tasks in the task queue based on the method parameters of the target work.

[0089] For example, Figure 4 The properties and methods of a job defined by a framework code are shown. Based on the framework code, the corresponding custom code is formulated to obtain the property parameters and method parameters related to the job. Combining the properties and methods of the job and their property parameters and method parameters can create the following Figure 5 The structure of the Job is shown. Figure 6The following shows the properties and methods of a task (Mission) defined by a framework code. Based on the framework code, the corresponding custom code is formulated to obtain the attribute parameters and method parameters related to the Mission. Combining the properties and methods of the Mission and their attribute parameters and method parameters, the following can be created: Figure 7 The structure of Mission shown in the figure. Figure 7 The structure of Mission shown corresponds to Figure 5 The mission with sequence number 0 in the MissionList of the Job structure shown.

[0090] In operation Figure 5 When the Job structure is shown, the structure of each task in the task queue can be run in sequence according to the execution order of multiple tasks in the queue based on the MissionList task queue in the structure, that is, the structure of the task with sequence number 0 in MissionList is run first, for example, run Figure 7 The structure of the Mission shown in the figure is executed first, and then the structure of the task with sequence number 1 in MissionList is executed, and finally the structure of the task with sequence number 2 in MissionList is executed. When the structures of the above multiple tasks are executed in sequence, the task is completed. Figure 5 The job set by the Job structure shown.

[0091] Therefore, by running the structure pair of each task in turn according to the execution order of multiple tasks in the task queue, the orderly operation of the structures of multiple tasks in MissionList can be achieved, which is conducive to improving the efficiency of work completion.

[0092] based on Figure 1 In the illustrated embodiment, in an optional implementation, it is also possible to monitor whether the task execution has timed out based on the attribute parameters of the target work. Specifically, the attribute parameters of the target work are also used to set a timeout timer for task execution. When running the structure of the target work, it is possible to determine whether the operation of the structure of the target task has timed out based on the timeout timer set by the attribute parameters of the target work, and when the operation of the structure of the target task times out, the result of the target task operation timeout is fed back to the target service, so that the target service determines the corresponding processing measures for the task that has timed out, such as terminating the operation of the task, or executing the next task, and so on.

[0093] For example, Figure 4 As shown, the framework code defines the waitResultTimeoutTimer property of the target job, and Figure 5The attribute parameters corresponding to this attribute are set. This attribute is used to execute the timeout timer to feed back the result of the task timeout to the Service so that the Service can take corresponding processing measures according to the timeout result. For example, if the structure of the task with sequence number 1 in MissionList times out, the task execution timeout is fed back to the Service. The reason for the task execution timeout may be that the task is waiting for other steps to return processing result data. Therefore, the Service can decide to terminate the task or jump to the next task execution, and restart the task when other steps return processing result data.

[0094] Therefore, through the feedback mechanism of task execution timeout set by the framework code and customized code, the execution status of the task can be obtained in time, and corresponding processing measures can be taken according to the abnormal situation of task execution, which is conducive to the processing and execution of subsequent tasks and can improve the execution efficiency of tasks.

[0095] based on Figure 1 The illustrated embodiment and its various implementations described above, in another optional implementation, an interface may be called to create structures of the various objects described above, for example, a service creation interface may be called to create a structure of a target service according to the properties and methods of the service in the framework code and the property parameters and method parameters of the target service in the custom code; and, a work creation interface may be called to create a structure of a target work according to the properties and methods of the work in the framework code and the property parameters and method parameters of the target work in the custom code; and, a task creation interface may be called to create a structure of a target task according to the properties and methods of the task in the framework code and the property parameters and method parameters of the target task in the custom code.

[0096] For example, Figure 8 As shown, the Base interface of the target service structure, the Base interface of the target work structure, and the Base interface of the target task structure can be defined respectively, and the target service structure, the target work structure, and the target task structure can be created respectively using the above Base interfaces. Among them, a Base interface is also defined to initialize the MissionList of the created Job, which is used to clear the Mission parameters in the MissionList to set them to default values.

[0097] Therefore, by calling the creation interface to respectively create the structures of the target service, target work, and target task, the structures of the above objects can be quickly created, which is beneficial to improving the code execution efficiency.

[0098] comprehensive Figure 1It can be seen from the illustrated embodiments and their various implementations that any business requirement (such as remote start of AC charging) can be achieved by using a uniformly defined framework code and customized code based on the framework code. This can effectively reduce the cost of maintaining different code implementations, and is very convenient for code expansion and very helpful in improving the overall code quality.

[0099] Specifically, first, the framework code is uniformly defined and fully tested. Once it is stable, it does not require a lot of manpower for maintenance, which can reduce code maintenance costs. Second, the parameters of the framework code are very flexible. For the jobs already included in the service, it is very convenient to delete them and adjust the execution order. For the jobs corresponding to the new functions, there is no need to modify the original code, just expand on the basis of the framework code. Third, the framework code uniformly defines the properties and methods of services, jobs and tasks, which is also convenient for code management and programming work handover.

[0100] The above describes the program development method in the embodiment of the present application. The following describes the computer device in the embodiment of the present application. Fig. 9 In the embodiment of the present application, one embodiment of the computer device includes:

[0101] A first acquisition unit is used to acquire a framework code, where the framework code is used to define the attributes and methods of a service, the attributes and methods of a job, and the attributes and methods of a task;

[0102] A second acquisition unit is used to acquire a custom code determined based on the framework code, wherein the custom code is used to set the attribute parameters and method parameters of the target service, the attribute parameters and method parameters of the target work, and the attribute parameters and method parameters of the target task; wherein the target work is set by the attribute parameters of the target service, and the target task is set by the attribute parameters of the target work;

[0103] A creation unit, used for creating a structure of the target service, a structure of the target work and a structure of the target task according to the framework code and the custom code;

[0104] an operating unit, configured to operate the structure of the target service, to operate the structure of the target work based on the method parameters of the target service, and to operate the structure of the target task based on the method parameters of the target work when operating the structure of the target work; and

[0105] The running unit is further configured to execute the operation set by the attribute parameters of the target task based on the method parameters of the target task when running the structure of the target task.

[0106] In an optional implementation of this embodiment, the method parameter of the target service is used to set a control method for the work;

[0107] The operation unit is specifically used for:

[0108] The structure of the target service is run to perform corresponding control operations on the structure of the target work based on the control method set by the method parameters of the target service.

[0109] In an optional implementation of this embodiment, the attribute parameters of the target service include a work queue, and the work queue is used to store the work corresponding to the target service; the target work is one of the work queues;

[0110] The method of the target service includes a work start method, and the method parameter of the work start method is used to indicate the start of the work in the work queue;

[0111] The operation unit is specifically used for:

[0112] Run the structure of the target service to start the structure of the target work in the work queue based on the method parameters of the work start method.

[0113] In an optional implementation of this embodiment, the method parameter of the target service is specifically used to set one or more of adding, deleting and adjusting the execution order of the work;

[0114] The attribute parameters of the target service include a work queue, and the work queue is used to store the work corresponding to the target service;

[0115] The operating unit is also used for:

[0116] Running the structure of the target service to add a new job based on the method parameters of the target service, and adding the new job to the job queue of the target service;

[0117] or,

[0118] Running the structure of the target service to delete the work to be deleted from the work queue based on the deletion work set by the method parameters of the target service;

[0119] or,

[0120] The structure of the target service is run to adjust the execution order of the plurality of tasks in the task queue based on the adjusted execution order set by the method parameter of the target service.

[0121] In an optional implementation of this embodiment, the attribute parameters of the target work include a task queue, and the task queue is used to store tasks corresponding to the target work; the target task is one of the task queues;

[0122] The operation unit is specifically used for:

[0123] When the structure of the target task is run, the structure of each task in the task queue is run in sequence according to the execution order of the multiple tasks in the task queue based on the method parameters of the target task.

[0124] In an optional implementation of this embodiment, the attribute parameters of the target task are also used to set a timeout timer for task execution;

[0125] The operating unit is also used for:

[0126] When running the structure of the target task, the timeout timer set based on the attribute parameters of the target task determines whether the operation of the structure of the target task has timed out, and when the operation of the structure of the target task has timed out, the result of the target task operation timeout is fed back to the target service.

[0127] In an optional implementation of this embodiment, the creating unit is specifically used for:

[0128] Calling a service creation interface to create a structure of the target service according to the service attributes and methods in the framework code and the attribute parameters and method parameters of the target service in the custom code; and,

[0129] Calling a job creation interface to create a structure of the target job according to the properties and methods of the job in the framework code and the property parameters and method parameters of the target job in the custom code; and,

[0130] The task creation interface is called to create the structure of the target task according to the attributes and methods of the task in the framework code and the attribute parameters and method parameters of the target task in the custom code.

[0131] In this embodiment, the operations performed by each unit in the computer device are the same as those described above. Figure 1 The illustrated embodiment and its various implementations are similar to those described above and will not be described in detail here.

[0132] The computer device in the embodiment of the present application is described below. Fig.10 In the embodiment of the present application, one embodiment of the computer device includes:

[0133] The computer device 1000 may include one or more central processing units (CPU) 1001 and a memory 1005 , wherein the memory 1005 stores one or more application programs or data.

[0134] The memory 1005 may be a volatile storage or a persistent storage. The program stored in the memory 1005 may include one or more modules, each of which may include a series of instruction operations in the computer device. Furthermore, the central processing unit 1001 may be configured to communicate with the memory 1005 and execute a series of instruction operations in the memory 1005 on the computer device 1000.

[0135] The computer device 1000 may also include one or more power supplies 1002, one or more wired or wireless network interfaces 1003, one or more input and output interfaces 1004, and / or one or more operating systems, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0136] The CPU 1001 can execute the aforementioned Figure 1 The operations performed by the computer device in the illustrated embodiment and its various implementations are not described in detail here.

[0137] The present application also provides a computer storage medium, wherein one embodiment includes: the computer storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the aforementioned Figure 1 The operations performed by the computer device in the illustrated embodiment and its various implementations.

[0138] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the computer devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0139] In the several embodiments provided in the present application, it should be understood that the disclosed computer devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0140] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0141] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0142] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A program development method, characterized in that: The method comprises: Obtaining a framework code, wherein the framework code is used to define properties and methods of a service, properties and methods of a job, and properties and methods of a task; Obtaining a custom code determined based on the framework code, the custom code being used to set attribute parameters and method parameters of a target service, attribute parameters and method parameters of a target work, and attribute parameters and method parameters of a target task; wherein the target work is set by the attribute parameters of the target service, and the target task is set by the attribute parameters of the target work; Create a structure of the target service, a structure of the target work, and a structure of the target task according to the framework code and the custom code; Running the structure of the target service to run the structure of the target work based on the method parameters of the target service, and running the structure of the target task based on the method parameters of the target work when running the structure of the target work; and, When the structure of the target task is run, the operation set by the attribute parameters of the target task is executed based on the method parameters of the target task.

2. The method according to claim 1, characterized in that The method parameter of the target service is used to set the control method of the work; The structure of running the target service, to run the structure of the target work based on the method parameters of the target service, includes: The structure of the target service is run to perform corresponding control operations on the structure of the target work based on the control method set by the method parameters of the target service.

3. The method according to claim 2, characterized in that The attribute parameters of the target service include a work queue, and the work queue is used to store the work corresponding to the target service; the target work is one of the work queues; The method of the target service includes a work start method, and the method parameter of the work start method is used to indicate the start of the work in the work queue; The structure of running the target service performs a corresponding control operation on the structure of the target work based on the control method set by the method parameter of the target service, including: Run the structure of the target service to start the structure of the target work in the work queue based on the method parameters of the work start method.

4. The method according to claim 2, characterized in that: The method parameter of the target service is specifically used to set one or more of adding, deleting and adjusting the execution order of tasks; The attribute parameters of the target service include a work queue, and the work queue is used to store the work corresponding to the target service; The method further comprises: Running the structure of the target service to add a new job based on the method parameters of the target service, and adding the new job to the job queue of the target service; or, Running the structure of the target service to delete the work to be deleted from the work queue based on the deletion work set by the method parameters of the target service; or, The structure of the target service is run to adjust the execution order of the plurality of tasks in the task queue based on the adjusted execution order set by the method parameter of the target service.

5. The method according to claim 1, characterized in that The attribute parameters of the target task include a task queue, and the task queue is used to store tasks corresponding to the target task; the target task is one of the tasks in the task queue; The step of running the target task structure based on the method parameters of the target task when running the target task structure includes: When the structure of the target task is run, the structure of each task in the task queue is run in sequence according to the execution order of the multiple tasks in the task queue based on the method parameters of the target task.

6. The method according to claim 1, characterized in that The attribute parameters of the target task are also used to set a timeout timer for task execution; The method further comprises: When running the structure of the target task, the timeout timer set based on the attribute parameters of the target task determines whether the operation of the structure of the target task has timed out, and when the operation of the structure of the target task has timed out, the result of the target task operation timeout is fed back to the target service.

7. The method according to any one of claims 1 to 6, characterized in that: The step of creating the structure of the target service, the structure of the target work, and the structure of the target task according to the framework code and the custom code includes: Calling a service creation interface to create a structure of the target service according to the service attributes and methods in the framework code and the attribute parameters and method parameters of the target service in the custom code; and, Calling a job creation interface to create a structure of the target job according to the properties and methods of the job in the framework code and the property parameters and method parameters of the target job in the custom code; and, The task creation interface is called to create the structure of the target task according to the attributes and methods of the task in the framework code and the attribute parameters and method parameters of the target task in the custom code.

8. A computer device, characterized in that: The computer device comprises: A first acquisition unit is used to acquire a framework code, where the framework code is used to define the attributes and methods of a service, the attributes and methods of a job, and the attributes and methods of a task; A second acquisition unit is used to acquire a custom code determined based on the framework code, wherein the custom code is used to set the attribute parameters and method parameters of the target service, the attribute parameters and method parameters of the target work, and the attribute parameters and method parameters of the target task; wherein the target work is set by the attribute parameters of the target service, and the target task is set by the attribute parameters of the target work; A creation unit, used for creating a structure of the target service, a structure of the target work and a structure of the target task according to the framework code and the custom code; an operating unit, configured to operate the structure of the target service, to operate the structure of the target work based on the method parameters of the target service, and to operate the structure of the target task based on the method parameters of the target work when operating the structure of the target work; and The running unit is further configured to execute the operation set by the attribute parameters of the target task based on the method parameters of the target task when running the structure of the target task.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer storage medium, characterized in that: The computer storage medium stores instructions, and when the instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 7.