CN114968515A - Script processing method and device, electronic equipment and storage medium - Google Patents

Script processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114968515A
CN114968515A CN202210475966.5A CN202210475966A CN114968515A CN 114968515 A CN114968515 A CN 114968515A CN 202210475966 A CN202210475966 A CN 202210475966A CN 114968515 A CN114968515 A CN 114968515A
Authority
CN
China
Prior art keywords
script
processed
execution
executing
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210475966.5A
Other languages
Chinese (zh)
Inventor
刘晓帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210475966.5A priority Critical patent/CN114968515A/en
Publication of CN114968515A publication Critical patent/CN114968515A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure provides a script processing method, a script processing device, electronic equipment and a storage medium, and relates to the field of artificial intelligence such as cloud computing and distributed storage, wherein the method comprises the following steps: acquiring script configuration information, and determining a script to be processed according to the script configuration information; and aiming at any script to be processed, respectively maintaining the script in the memory, circularly executing the script to be processed, and finishing the corresponding data processing logic through the execution of the script to be processed. By applying the scheme disclosed by the disclosure, the timeliness of data processing can be improved.

Description

Script processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of artificial intelligence technologies, and in particular, to a script processing method and apparatus, an electronic device, and a storage medium in the fields of cloud computing and distributed storage.
Background
In many scenarios, timely processing of data is required. For example, for red packet data in a live broadcast room scene, such as red packet, red packet expiration, etc., it is desirable to process in time so as to reach the processing result to the user in time.
Disclosure of Invention
The disclosure provides a script processing method and device, an electronic device and a storage medium.
A script processing method, comprising:
acquiring script configuration information, and determining a script to be processed according to the script configuration information;
and aiming at any script to be processed, respectively maintaining the script in the memory, circularly executing the script to be processed, and completing the corresponding data processing logic through the execution of the script to be processed.
A script processing apparatus comprising: a determining module and an executing module;
the determining module is used for acquiring script configuration information and determining a script to be processed according to the script configuration information;
and the execution module is used for respectively maintaining any script to be processed in the memory, circularly executing the script to be processed and finishing the corresponding data processing logic through the execution of the script to be processed.
An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method as described above.
A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method as described above.
A computer program product comprising computer programs/instructions which, when executed by a processor, implement a method as described above.
One embodiment in the above disclosure has the following advantages or benefits: the script can be maintained in the memory and can be executed circularly, so that the timeliness of data processing is improved, and red packet data can be processed in time in a live broadcast room scene.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow chart of a first embodiment of a script processing method according to the present disclosure;
FIG. 2 is a flow chart of a second embodiment of a script processing method according to the present disclosure;
FIG. 3 is a schematic diagram of a first embodiment 300 of a script processing apparatus according to the present disclosure;
FIG. 4 is a schematic diagram illustrating a second embodiment 400 of a script processing apparatus according to the present disclosure;
FIG. 5 illustrates a schematic block diagram of an electronic device 500 that may be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In addition, it should be understood that the term "and/or" herein is merely one type of association relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter associated objects are in an "or" relationship.
Fig. 1 is a flowchart of a script processing method according to a first embodiment of the present disclosure. As shown in fig. 1, the following detailed implementation is included.
In step 101, script configuration information is obtained, and a script to be processed is determined according to the script configuration information.
In step 102, any script to be processed is maintained in the memory, and the script to be processed is executed in a loop, and the corresponding data processing logic is completed through the execution of the script to be processed.
In the scheme of the embodiment of the method, the script can be maintained in the memory and can be executed circularly, so that the timeliness of data processing is improved, for example, the red packet data can be processed in time in a live broadcast room scene.
In practical applications, the executive body of the embodiment shown in fig. 1 may be the coroutine invoked by the actuator, for example, after executing a main ()) function, the coroutine may be invoked. The executor may be deployed on a business machine.
Only one executor may be deployed on each service machine, and the script configuration information corresponding to the executor may be generated in advance, that is, the configuration of the script to be executed may be in the form of an array, the number of elements in the array may be one or multiple, and each element in the array may correspond to one script.
And aiming at each script included in the script configuration information, each script can be respectively used as a script to be processed, the script to be processed can be maintained in a memory through the coroutine, the script to be processed is executed circularly, and the corresponding data processing logic is completed through the execution of the script to be processed.
Different scripts to be processed are mutually independent and are executed circularly and mutually unaffected.
In an embodiment of the present disclosure, for any script to be processed, the following first processes may be respectively performed: determining whether the script to be processed meets a preset execution condition, executing the script to be processed in response to the determination that the script to be processed meets the execution condition, executing the ending execution operation aiming at the script to be processed after the execution is finished, namely performing post-processing, then repeatedly executing the first processing, and repeatedly executing the first processing in response to the determination that the script to be processed does not meet the execution condition.
In the processing mode, the script to be processed can be maintained in the memory through the coroutine, and the operations of condition judgment, script execution, post-processing and the like can be continuously performed, so that the circular execution of the script to be processed is realized.
In practical applications, each script may inherit an interface class (data service interface) as shown below.
Interface class:
{
CanRun()bool
Run()bool
FinishRun () (64-bit integer (int64), Boolean (boul))
}。
Accordingly, for any of the scripts to be processed, when determining whether the script to be processed meets the predetermined execution condition, it may be determined whether the script to be processed meets the predetermined execution condition by executing a runnable (CanRun ()) method.
If the execution condition is not met, the first processing can be repeatedly executed, namely, the condition judgment is continued. If the execution condition is determined to be met, the to-be-processed script can be executed, for example, the to-be-processed script can be executed by executing a Run ()) method, and the corresponding data processing logic is completed by executing the to-be-processed script.
After the execution of the to-be-processed script is completed, an end execution operation for the to-be-processed script may also be executed, and then the first processing may be repeatedly executed, for example, the end execution operation may be implemented by executing a finish execution (FinishRun ()) method.
In one embodiment of the present disclosure, the meeting of the execution condition may include: the script running lock corresponding to the script to be processed can be acquired, and accordingly, the ending of the execution operation may include: and releasing the script running lock.
In practical application, in order to prevent the scripts deployed on the service machines from being unable to run normally due to the failure of the service machines, the same script is deployed on a plurality of service machines, although the scripts are deployed on the plurality of service machines, only one script on one service machine can be executed at the same time, scripts on other service machines are in a waiting state, and which script can obtain the script running lock can be executed, that is, the execution condition can be considered to be met.
Accordingly, whether any script to be processed meets the execution condition can be conveniently and efficiently determined based on the script running lock, and accordingly, after the script to be processed is executed, the script running lock can be released by means of ending the execution operation, so that resources can be timely recycled.
The execution-eligible and execution-ending operations described above are only examples, and are not intended to limit the technical solution of the present disclosure, and the specific conditions of the execution-eligible and execution-ending operations may be determined according to actual needs, such as determining that new data needs to be processed, and the specific contents of the execution-ending operations may also be determined according to actual needs, such as releasing some other resources besides releasing the script running lock.
In one embodiment of the disclosure, the first processing may be further executed repeatedly after waiting for a first predetermined time period, that is, for any script to be processed, it may be determined first whether the script to be processed meets a predetermined execution condition, in response to determining that the script to be processed meets the execution condition, the script to be processed may be executed, and an execution ending operation for the script to be processed may be executed after the execution is completed, and then the first processing may be executed repeatedly after waiting for the first predetermined time period, in response to determining that the script to be processed does not meet the execution condition, the first processing may be executed repeatedly after waiting for the first predetermined time period.
The specific value of the first predetermined time period can be determined according to actual needs, and is usually smaller. By setting the first preset time length, the execution times of the first processing can be reduced, so that the resource consumption is reduced, and the method is particularly suitable for scenes with relatively low requirements on the timeliness of data processing.
In addition, in practical application, if necessary, the condition judgment and the post-processing are not executed, but the script to be processed is directly executed, further, the script to be processed can be repeatedly executed after the execution is finished and the first preset time duration is waited, and the method is very flexible and convenient.
In an embodiment of the present disclosure, a script recording table may be further generated and maintained, where the script to be processed that is being executed is recorded in the script recording table, and in response to obtaining the predetermined signal, except for the recorded script to be processed, the execution of the script to be processed may not be started any more, and the execution ending operation may be performed on the recorded script to be processed.
For example, for any script to be processed, after the script to be processed is started to be executed, the script to be processed may be recorded in the script recording table, and after the execution of the script to be processed is finished, the script to be processed may be deleted from the script recording table.
The specific type of the predetermined signal may be determined according to actual needs, and may include system signals such as hang-up (signal), program termination (signal), and program termination (signal) for example.
After the predetermined signal is obtained, any script to be processed can no longer be started and executed except the script to be processed recorded in the script recording table, and the execution ending operation can be executed on the script to be processed recorded in the script recording table.
In practical applications, when a to-be-processed script is executed, an executor needs to be in a starting (RUNNING) state, after a predetermined signal is acquired, the state of the executor can be adjusted, that is, the starting state is modified into a terminating state, and after the state is changed, any to-be-processed script cannot be started and executed.
The states of the actuators may include an un-activated (UNSTART) state, an activated state, a CLOSED in (CLOSING) state, and a CLOSED (CLOSED) state. In practical application, the closed state is entered from the starting state first, and then the closed state is entered.
In addition, before each script to be processed is executed circularly, the graceful closing method can be registered in advance, and accordingly, after the predetermined signal is acquired, the registered graceful closing method can be called, that is, the operation of ending execution is executed on the script to be processed recorded in the script record table.
Through the processing, the script running lock occupied by the script to be processed can be released in time, so that the resource can be recovered in time.
In an embodiment of the disclosure, timing may be started from acquiring the predetermined signal, the execution ending operation may be executed after the execution is completed for a script to be processed that is completed before the second predetermined time period is reached in the recorded scripts to be processed, and the execution ending operation may be forcibly executed for a script to be processed that is not completed after the second predetermined time period is reached in the recorded scripts to be processed.
The specific value of the second predetermined time period may be determined according to actual needs, for example, 180 seconds.
For example, the recorded scripts to be processed include the script to be processed 1, the script to be processed 2, and the script to be processed 3, and if the execution of both the script to be processed 1 and the script to be processed 2 is completed before the second predetermined time duration is reached, the execution ending operation may be executed after the execution of both the script to be processed 1 and the script to be processed 2 is completed, for example, the FinishRun () method is executed, and if the execution of the script to be processed 3 is not completed after the second predetermined time duration is reached, the execution ending operation may be forcibly executed with respect to the script to be processed 3.
Through the processing, the script running lock occupied by each script to be processed can be released in time, so that the resources can be recovered in time, and the scripts to be processed can be normally executed as far as possible by waiting for the second preset time, so that the influence on the normal data processing logic is avoided.
With the above introduction, fig. 2 is a flowchart of a script processing method according to a second embodiment of the present disclosure. As shown in fig. 2, the following detailed implementation is included.
In step 201, the script configuration information is obtained, the script to be processed is determined according to the script configuration information, and then step 202 and step 207 are executed.
In step 202, any script to be processed is processed in the manner shown in steps 203-206.
In step 203, it is determined whether the script to be processed meets a predetermined execution condition, if yes, step 204 is executed, otherwise, step 206 is executed.
The compliance with the execution condition may include: and acquiring a script running lock corresponding to the script to be processed.
In step 204, the script to be processed is executed.
In step 205, after the execution is completed, the ending execution operation for the to-be-processed script is executed, and then step 206 is executed.
Accordingly, the ending performing operation may include: and releasing the script running lock.
In step 206, wait for a first predetermined time period, and then repeat step 203.
For convenience of description, the process shown in steps 202-206 above is referred to as a loop execution process.
In step 207, a script record table is generated and maintained, and the script record table records the script to be processed that is being executed.
In step 208, if a predetermined signal is obtained, the loop execution process is stopped, and the execution of the to-be-processed script recorded in the script recording table is finished.
Specifically, timing may be started from acquiring the predetermined signal, the execution ending operation may be executed after the execution is completed for a to-be-processed script that is executed before the second predetermined time period is reached in the recorded to-be-processed scripts, and the execution ending operation may be forcibly executed for a to-be-processed script that is not executed after the second predetermined time period is reached in the recorded to-be-processed scripts.
It is noted that while for simplicity of explanation, the foregoing method embodiments are described as a series of acts, those skilled in the art will appreciate that the present disclosure is not limited by the order of acts, as some steps may, in accordance with the present disclosure, occur in other orders and concurrently. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required for the disclosure. In addition, for parts which are not described in detail in a certain embodiment, reference may be made to relevant descriptions in other embodiments.
In a word, by adopting the scheme of the embodiment of the method disclosed by the invention, the script can be maintained in the memory and can be executed circularly, so that the timeliness of data processing is improved, for example, the red packet data can be processed in time in a scene of a live broadcast room, so that the processing result can be timely touched to a user, for example, after the red packet is sent, the live broadcast room can display instantly, the user can receive the message in time after the red packet is robbed, and the red packet can disappear rapidly after the red packet is robbed up or the red packet is over, and the like.
The above is a description of embodiments of the method, and the embodiments of the apparatus are further described below.
Fig. 3 is a schematic structural diagram of a script processing apparatus 300 according to a first embodiment of the present disclosure. As shown in fig. 3, includes: a determination module 301 and an execution module 302.
The determining module 301 is configured to obtain script configuration information, and determine a script to be processed according to the script configuration information.
The execution module 302 is configured to maintain any script to be processed in a memory, and execute the script to be processed in a loop, so as to complete a corresponding data processing logic through execution of the script to be processed.
In the scheme of the embodiment of the device, the script can be maintained in the memory and can be executed circularly, so that the timeliness of data processing is improved, and red packet data can be processed in time in a live broadcast room scene.
In an embodiment of the disclosure, for any script to be processed, the executing module 302 may respectively execute the following first processes: determining whether the script to be processed meets a preset execution condition, executing the script to be processed in response to the determination that the script to be processed meets the execution condition, executing the ending execution operation aiming at the script to be processed after the execution is finished, namely performing post-processing, then repeatedly executing the first processing, and repeatedly executing the first processing in response to the determination that the script to be processed does not meet the execution condition.
In one embodiment of the present disclosure, the meeting of the execution condition may include: the script running lock corresponding to the script to be processed can be acquired, and accordingly, the ending of the execution operation may include: and releasing the script running lock.
In an embodiment of the disclosure, the executing module 302 may further repeatedly execute the first process after waiting for the first predetermined time, that is, for any script to be processed, first determine whether the script to be processed meets a predetermined execution condition, execute the script to be processed in response to determining that the script to be processed meets the execution condition, and execute an execution ending operation for the script to be processed after the execution is completed, then repeatedly execute the first process after waiting for the first predetermined time, and repeatedly execute the first process after waiting for the first predetermined time in response to determining that the script to be processed does not meet the execution condition.
Fig. 4 is a schematic structural diagram of a script processing apparatus 400 according to a second embodiment of the present disclosure. As shown in fig. 4, includes: a determination module 301, an execution module 302, a maintenance module 303, and a shutdown module 304.
The determining module 301 and the executing module 302 are the same as those in the embodiment shown in fig. 3, and are not described again.
The maintenance module 303 is configured to generate and maintain a script record table, where the script to be processed that is being executed is recorded in the script record table.
And the closing module 304 is configured to, in response to acquiring the predetermined signal, notify the executing module 302 that execution of any script to be processed is not started any more except for the recorded script to be processed, and execute an execution ending operation on the recorded script to be processed.
For example, for any script to be processed, after the script to be processed is started to be executed, the script to be processed may be recorded in the script recording table, and after the execution of the script to be processed is finished, the script to be processed may be deleted from the script recording table.
The specific type of the predetermined signal may be determined according to actual needs, and may include system signals such as hang-up, program termination, and program termination, for example.
In an embodiment of the disclosure, the shutdown module 304 may count time from acquiring the predetermined signal, wait for a second predetermined time period, may execute the execution ending operation after the execution is completed for a to-be-processed script that is executed before the second predetermined time period is reached in the recorded to-be-processed scripts, and may force the execution ending operation for a to-be-processed script that is not executed after the second predetermined time period is reached in the recorded to-be-processed scripts.
The specific working flows of the embodiments of the apparatuses shown in fig. 3 and fig. 4 may refer to the related descriptions in the foregoing method embodiments, and are not repeated.
In a word, by adopting the scheme of the embodiment of the device disclosed by the invention, the script can be maintained in the memory and can be circularly executed, so that the timeliness of data processing is improved, for example, the red packet data can be timely processed in a scene of a live broadcast room, so that the processing result can be timely touched to a user, for example, after the red packet is sent, the live broadcast room can instantly display the red packet, the user can timely receive a message after the red packet is overtaken, or the red packet can quickly disappear after the red packet is overtaken or the red packet is over, and the like.
The scheme disclosed by the disclosure can be applied to the field of artificial intelligence, in particular to the fields of cloud computing, distributed storage and the like. Artificial intelligence is a subject for studying a computer to simulate some thinking processes and intelligent behaviors (such as learning, reasoning, thinking, planning and the like) of a human, and has a hardware technology and a software technology, the artificial intelligence hardware technology generally comprises technologies such as a sensor, a special artificial intelligence chip, cloud computing, distributed storage, big data processing and the like, and the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, machine learning/deep learning, a big data processing technology, a knowledge graph technology and the like.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 5 shows a schematic block diagram of an electronic device 500 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the apparatus 500 comprises a computing unit 501 which may perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The calculation unit 501, the ROM 502, and the RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in the device 500 are connected to the I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, or the like; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508, such as a magnetic disk, optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 501 performs the various methods and processes described above, such as the methods described in this disclosure. For example, in some embodiments, the methods described in this disclosure may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM 502 and/or the communication unit 509. When loaded into RAM 503 and executed by computing unit 501, may perform one or more steps of the methods described in the present disclosure. Alternatively, in other embodiments, the computing unit 501 may be configured by any other suitable means (e.g., by means of firmware) to perform the methods described by the present disclosure.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (15)

1. A script processing method, comprising:
acquiring script configuration information, and determining a script to be processed according to the script configuration information;
and aiming at any script to be processed, respectively maintaining the script in the memory, circularly executing the script to be processed, and finishing the corresponding data processing logic through the execution of the script to be processed.
2. The method of claim 1, wherein the looping execution of the pending script comprises:
for the script to be processed, executing the following first processing:
determining whether the script to be processed meets a preset execution condition;
in response to the fact that the script to be processed meets the execution condition, executing the script to be processed, executing the execution finishing operation aiming at the script to be processed after the execution is finished, and then repeatedly executing the first processing;
and in response to determining that the script to be processed does not meet the execution condition, repeatedly executing the first processing.
3. The method of claim 2, wherein,
the repeatedly performing the first process includes: and after waiting for a first preset time, repeatedly executing the first processing.
4. The method of claim 2, wherein,
the meeting of the execution condition comprises: a script running lock corresponding to the script to be processed can be acquired;
the ending execution operation includes: and releasing the script running lock.
5. The method of any of claims 2-4, further comprising:
generating and maintaining a script recording table, wherein the script recording table records a script to be processed which is being executed;
and in response to the acquisition of the preset signal, no longer starting to execute any script to be processed except the recorded script to be processed, and executing the execution ending operation on the recorded script to be processed.
6. The method of claim 5, wherein the performing the end execution operation on the recorded pending script comprises:
starting timing from the acquisition of the preset signal, and executing the execution ending operation after the execution is finished aiming at the script to be processed which is executed before the second preset time length is reached in the recorded scripts to be processed;
and forcibly executing the execution ending operation aiming at the script to be processed which is not executed after the second preset time length is reached in the recorded scripts to be processed.
7. A script processing apparatus comprising: a determining module and an executing module;
the determining module is used for acquiring script configuration information and determining a script to be processed according to the script configuration information;
the execution module is used for respectively maintaining any script to be processed in the memory, circularly executing the script to be processed, and finishing the corresponding data processing logic through the execution of the script to be processed.
8. The apparatus of claim 7, wherein,
the execution module executes the following first processing aiming at the script to be processed: determining whether the script to be processed meets a preset execution condition, executing the script to be processed in response to the determination that the script to be processed meets the execution condition, executing the execution finishing operation aiming at the script to be processed after the execution is finished, then repeatedly executing the first processing, and repeatedly executing the first processing in response to the determination that the script to be processed does not meet the execution condition.
9. The apparatus of claim 8, wherein,
the execution module is further configured to repeatedly execute the first processing after waiting for a first predetermined time period.
10. The apparatus of claim 8, wherein,
the meeting of the execution condition comprises: a script running lock corresponding to the script to be processed can be acquired;
the ending execution operation includes: and releasing the script running lock.
11. The apparatus of any of claims 8-10, further comprising: a maintenance module and a shutdown module;
the maintenance module is used for generating and maintaining a script recording table, and the script recording table records the script to be processed which is being executed;
and the closing module is used for responding to the acquired preset signal, informing the execution module not to start executing any script to be processed any more except the recorded script to be processed, and executing the execution ending operation on the recorded script to be processed.
12. The apparatus of claim 11, wherein,
and the closing module starts to time from the acquisition of the preset signal, executes the execution ending operation after the execution is finished aiming at the scripts to be processed which are executed before the second preset time in the recorded scripts to be processed, and forcibly executes the execution ending operation aiming at the scripts to be processed which are not executed after the second preset time in the recorded scripts to be processed is reached.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of claims 1-6.
15. A computer program product comprising a computer program/instructions which, when executed by a processor, implement the method of any one of claims 1-6.
CN202210475966.5A 2022-04-29 2022-04-29 Script processing method and device, electronic equipment and storage medium Pending CN114968515A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210475966.5A CN114968515A (en) 2022-04-29 2022-04-29 Script processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210475966.5A CN114968515A (en) 2022-04-29 2022-04-29 Script processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114968515A true CN114968515A (en) 2022-08-30

Family

ID=82979057

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210475966.5A Pending CN114968515A (en) 2022-04-29 2022-04-29 Script processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114968515A (en)

Similar Documents

Publication Publication Date Title
JP2022018095A (en) Multi-modal pre-training model acquisition method, apparatus, electronic device and storage medium
CN113656175B (en) Method and equipment for training model based on distributed system
US20230034881A1 (en) Scheduling method and device based on deep learning node computation, and storage medium
CN107045475B (en) Test method and device
CN112508768B (en) Single-operator multi-model pipeline reasoning method, system, electronic equipment and medium
CN113986788B (en) Data processing method and device, chip, electronic equipment and medium
US9384044B2 (en) Intelligent inclusion/exclusion automation
CN113242358A (en) Audio data processing method, device and system, electronic equipment and storage medium
CN114091672B (en) Distributed model reasoning method and device, electronic equipment and medium
CN115964153A (en) Asynchronous task processing method, device, equipment and storage medium
US20140250251A1 (en) Automatically and transparently preserving testing state across sessions
CN113778849A (en) Method, apparatus, device and storage medium for testing code
US20120311117A1 (en) Object Pipeline-Based Virtual Infrastructure Management
CN114881170B (en) Training method for neural network of dialogue task and dialogue task processing method
CN114968515A (en) Script processing method and device, electronic equipment and storage medium
CN115357493A (en) Test method, test device, electronic equipment and storage medium
CN114706622B (en) Method, device, equipment, medium and product for starting model service
CN115391204A (en) Test method and device for automatic driving service, electronic equipment and storage medium
CN113590782B (en) Training method of reasoning model, reasoning method and device
CN114386577A (en) Method, apparatus, and storage medium for executing deep learning model
US10901807B2 (en) Computer system with concurrency for multithreaded applications
CN113962191B (en) Sequence randomization method and device, electronic equipment and storage medium
CN113961405B (en) State switching instruction verification method and device, electronic equipment and storage medium
CN113568797B (en) Testing method and device of intelligent interaction system, electronic equipment and medium
CN113573080B (en) Live broadcast recording method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination