CN112732979A - Information writing method, information writing device, electronic equipment and computer readable medium - Google Patents

Information writing method, information writing device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN112732979A
CN112732979A CN202011607256.0A CN202011607256A CN112732979A CN 112732979 A CN112732979 A CN 112732979A CN 202011607256 A CN202011607256 A CN 202011607256A CN 112732979 A CN112732979 A CN 112732979A
Authority
CN
China
Prior art keywords
target node
execution information
service
target
node set
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.)
Granted
Application number
CN202011607256.0A
Other languages
Chinese (zh)
Other versions
CN112732979B (en
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.)
Wuba Co Ltd
Original Assignee
Wuba 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 Wuba Co Ltd filed Critical Wuba Co Ltd
Priority to CN202011607256.0A priority Critical patent/CN112732979B/en
Publication of CN112732979A publication Critical patent/CN112732979A/en
Application granted granted Critical
Publication of CN112732979B publication Critical patent/CN112732979B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Abstract

The embodiment of the disclosure discloses an information writing method, an information writing device, electronic equipment and a medium. One embodiment of the method comprises: acquiring a pre-constructed directed acyclic graph related to a service set, wherein the service is provided for a corresponding terminal, and the directed acyclic graph is used for representing the execution sequence of the service in the service set; determining a target node set in the directed acyclic graph, wherein each target node in the target node set is each service to be executed; responding to the fact that the number of target nodes in the target node set is larger than a preset threshold value, executing all services corresponding to the target node set in parallel to obtain a first execution information set, wherein the first execution information represents that the services corresponding to the target nodes are executed; and writing the first execution information set into the global variable to obtain the written global variable. The implementation method can quickly and efficiently execute each service corresponding to the target node set in parallel, and saves the scheduling time.

Description

Information writing method, information writing device, electronic equipment and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to an information writing method and apparatus, an electronic device, and a computer-readable medium.
Background
At present, for responding to the corresponding request of each terminal, the corresponding service is often provided to the corresponding terminal. Therefore, the services to be provided to each terminal are often exposed in the form of a Directed Acyclic Graph (DAG), which facilitates scheduling of the services. The commonly used approach is: the node relation of the directed acyclic graph is converted into an adjacency list, and the nodes are executed in a depth-first traversal mode.
However, when the nodes are executed in the above manner, there are often the following technical problems:
firstly, the depth-first traversal mode is adopted, so that the parallel execution relation of the nodes cannot be effectively utilized, and the execution resources are utilized to the maximum extent.
Secondly, whether the merge node executes or not is determined by the execution state of the front node. In a multi-thread environment, inter-thread communication is required, which increases implementation complexity, and in a high-concurrency real-time system, performance is reduced due to a large number of threads being suspended instantaneously.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose an information writing method, apparatus, electronic device, and computer readable medium to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide an information writing method, including: acquiring a pre-constructed directed acyclic graph related to a service set, wherein the service is provided for a corresponding terminal, and the directed acyclic graph is used for representing the execution sequence of the service in the service set; determining a target node set in the directed acyclic graph, wherein each target node in the target node set is each service to be executed; responding to that the number of target nodes in the target node set is larger than a preset threshold value, executing each service corresponding to the target node set in parallel to obtain a first execution information set, wherein the first execution information represents that the service corresponding to the target node is executed; and writing the first execution information set into a global variable to obtain the written global variable.
In a second aspect, some embodiments of the present disclosure provide an information writing apparatus, including: the system comprises a labeling unit and an acquiring unit, wherein the acquiring unit is configured to acquire a pre-constructed directed acyclic graph related to a service set, the service is provided for a corresponding terminal, and the directed acyclic graph is used for representing the execution sequence of the service in the service set; a determining unit, configured to determine a target node set in the directed acyclic graph, where each target node in the target node set is each service to be executed; the execution unit is configured to respond that the number of target nodes in the target node set is greater than a preset threshold value, execute each service corresponding to the target node set in parallel, and obtain a first execution information set, wherein the first execution information represents that the service corresponding to the target node is executed; and the writing unit is configured to write the first execution information set into a global variable to obtain the written global variable.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method as described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the disclosure provide a computer readable medium having a computer program stored thereon, where the program when executed by a processor implements a method as described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following beneficial effects: through the information writing method of some embodiments of the present disclosure, each service corresponding to the target node set can be executed quickly and efficiently in parallel, and the scheduling time is saved. Specifically, the node relation of the directed acyclic graph is converted into an adjacency list, and nodes are executed in a depth-first traversal mode. Based on this, the information writing method of some embodiments of the present disclosure may first obtain a pre-constructed directed acyclic graph related to a service set. The service is provided for a corresponding terminal, and the directed acyclic graph is used for representing the execution sequence of the services in the service set. Here, the related service is provided to the corresponding terminal through the obtained above-mentioned directed acyclic graph. Then, a set of target nodes in the directed acyclic graph is determined. And each target node in the target node set is each service to be executed. And then, in response to that the number of target nodes in the target node set is greater than a preset threshold, executing each service corresponding to the target node set in parallel to obtain a first execution information set, wherein the first execution information represents that the service corresponding to the target node is executed. Here, the number of target nodes in the set of target nodes is used to subsequently determine whether parallel operations are required. Alternatively, the parallel execution of the nodes can be completed by constructing related parallelizers. Therefore, the time for constructing the relevant parallelizer can be effectively saved by determining whether the parallelization operation needs to be carried out. And finally, writing the first execution information set into a global variable to obtain the written global variable. The execution subject in the written global variable may be used for executing a subsequent service. The information writing method can be used for quickly and efficiently executing all the services corresponding to the target node set in parallel, and the scheduling time is saved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Fig. 1 is a schematic diagram of one application scenario of an information writing method according to some embodiments of the present disclosure;
FIG. 2 is a flow chart of some embodiments of an information writing method according to the present disclosure;
FIG. 3 is a schematic diagram of a directed acyclic graph in an information writing method, according to some embodiments of the present disclosure;
FIG. 4 is a schematic illustration of global variable write execution information in an information write method according to some embodiments of the present disclosure;
FIG. 5 is a flow chart of still other embodiments of a method of writing information according to the present disclosure;
FIG. 6 is a schematic block diagram of some embodiments of an information writing apparatus according to the present disclosure;
FIG. 7 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of an application scenario of an information writing method according to some embodiments of the present disclosure.
In the application scenario of fig. 1, first, the electronic device 101 may obtain a pre-constructed directed acyclic graph 102 related to a service set. The service is provided to a corresponding terminal, and the directed acyclic graph 102 is used to represent an execution order of the services in the service set. In this application scenario, the initial node of the directed acyclic graph 102 is node 1021. The post-node of node 1021 includes: node 1022 and node 1023. The post-node of the node 1022 includes: node 1024 and node 1025. The post-node of the node 1023 includes: node 1025, and node 1026. Wherein, the service set comprises: service 1, service 2, service 3, service 4, service 5, service 6. The service corresponding to the node 1021 is service 1. The service corresponding to the node 1022 is service 2. The service corresponding to the node 1023 is service 3. The service corresponding to the node 1024 is service 4. The service corresponding to the node 1025 is service 5. The service corresponding to the node 1026 is service 6. Then, a set of target nodes 103 in the directed acyclic graph 102 is determined. Wherein, each target node in the target node set 103 is each service to be executed. In this application scenario, the target node set 103 includes: node 1024 in directed acyclic graph 102, node 1025 in directed acyclic graph 102, and node 1026 in directed acyclic graph 102. Further, in response to that the number of target nodes in the target node set 103 is greater than a preset threshold, executing each service corresponding to the target node set 103 in parallel to obtain a first execution information set 104. Wherein, the first execution information represents that the service corresponding to the target node is executed. In the present application scenario, the number of target nodes is 3. The threshold may be "1". The first execution information set includes: execution information 1041 corresponding to node 1024, execution information 1041 corresponding to node 1025, execution information 1042 corresponding to node 1025, and execution information 1043 corresponding to node 1026. Finally, the first execution information set 104 is written into the global variable 105, and a written global variable 106 is obtained. In the application scenario, the execution information written in the global variable 105 may include: execution information 1051, execution information 1052, execution information 1053, execution information 1042, execution information 1054, and execution information 1055 in the first set of execution information 104. The execution information written in the written global variable 106 includes: execution information 1051, execution information 1052, execution information 1053, execution information 1042 in the first set of execution information 104, execution information 1054, execution information 1055, execution information 1041 in the first set of execution information 104, execution information 1043 in the first set of execution information 104.
The electronic device 101 may be hardware or software. When the electronic device is hardware, the electronic device may be implemented as a distributed cluster formed by a plurality of servers or terminal devices, or may be implemented as a single server or a single terminal device. When the electronic device is embodied as software, it may be installed in the above-listed hardware devices. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of electronic devices in fig. 1 is merely illustrative. There may be any number of electronic devices, as desired for implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of an information writing method according to the present disclosure is shown. The information writing method comprises the following steps:
step 201, a pre-constructed directed acyclic graph related to a service set is obtained.
In some embodiments, an executing entity (e.g., the electronic device shown in fig. 1) of the information writing method may obtain the pre-constructed directed acyclic graph related to the service set through a wired connection manner or a wireless connection manner. The service is provided for a corresponding terminal, and the directed acyclic graph is used for representing the execution sequence of the services in the service set. The set of services may include, but is not limited to, at least one of: hypertext transfer protocol (http) requests related services, script related services, internal protocol services. Here, the execution of each service in the service set can be efficiently scheduled using a directed acyclic graph associated with the service set.
It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G/5G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
Step 202, determining a target node set in the directed acyclic graph.
In some embodiments, the execution agent may determine a set of target nodes in the directed acyclic graph. And each target node in the target node set is each service to be executed. The directed acyclic graph may be initialized. As an example, the execution agent may first determine each request that needs to be processed from each terminal at the current time. Then, according to the responses corresponding to the requests, a target node set in the directed acyclic graph can be determined.
As an example, as shown in fig. 3, the virtual node 302 of the directed acyclic graph 301 serves as an execution entry of the directed acyclic graph 301. The initial node of the directed acyclic graph 301 is node a 303. The nodes behind the node a303 are a node D305 and a node B304. The node D305 is followed by a node C306. The node B304 is followed by a node C306. The initialized directed acyclic graph 307 is "virtual node" - > "a", "a" - > "B, D", "B" - > "C", "D" - > "C".
Step 203, responding to that the number of the target nodes in the target node set is greater than a preset threshold, executing each service corresponding to the target node set in parallel, and obtaining a first execution information set.
In some embodiments, in response to that the number of target nodes in the target node set is greater than a preset threshold, the execution main body may execute each service corresponding to the target node set in parallel to obtain a first execution information set. Wherein, the first execution information represents that the service corresponding to the target node is executed. As an example, the threshold value may be "1". As an example, in response to that the number of target nodes in the target node set is greater than a preset threshold, the execution main body may execute each service corresponding to the target node set through a pre-constructed parallelizer, so as to obtain a first execution information set.
And 204, writing the first execution information set into a global variable to obtain the written global variable.
In some embodiments, the execution agent writes the first set of execution information to a global variable. The global variable may be used to record execution condition information of a service corresponding to each node in the directed acyclic graph.
As an example, the global variable may be obtained by writing all of the first execution information sets into the global variable.
In some optional implementation manners of some embodiments, the execution subject may write at least one first execution information, which is not present in the global variable, in the first execution information set into the global variable, to obtain the written global variable.
As an example, as shown in fig. 4, the first execution information set 401 includes: execution information 4011, execution information 4012, execution information 4013, execution information 4014, execution information 4015, and execution information 4016. The execution information 402 in the global variable includes: execution information 4021, execution information 4022, execution information 4023, execution information 4024, execution information 4025, execution information 4026, execution information 4027, execution information 4013, and execution information 4014. The first execution information 403 in the written global variable includes: execution information 4021, execution information 4022, execution information 4023, execution information 4024, execution information 4025, execution information 4026, execution information 4027, execution information 4013, execution information 4014, execution information 4011, execution information 4012, execution information 4015, execution information 4016.
In some optional implementations of some embodiments, the global variable is initialized in response to each of the target nodes being an initial node of the directed acyclic graph.
In some optional implementation manners of some embodiments, in response to that the number of target nodes in the target node set is equal to the preset threshold, each service corresponding to the target node set is executed in series. Wherein the threshold may be "1".
The above embodiments of the present disclosure have the following beneficial effects: through the information writing method of some embodiments of the present disclosure, each service corresponding to the target node set can be executed quickly and efficiently in parallel, and the scheduling time is saved. Specifically, the node relation of the directed acyclic graph is converted into an adjacency list, and nodes are executed in a depth-first traversal mode. Based on this, the information writing method of some embodiments of the present disclosure may first obtain a pre-constructed directed acyclic graph related to a service set. The service is provided for a corresponding terminal, and the directed acyclic graph is used for representing the execution sequence of the services in the service set. Here, the related service is provided to the corresponding terminal through the obtained above-mentioned directed acyclic graph. Then, a set of target nodes in the directed acyclic graph is determined. And each target node in the target node set is each service to be executed. And then, in response to that the number of target nodes in the target node set is greater than a preset threshold, executing each service corresponding to the target node set in parallel to obtain a first execution information set, wherein the first execution information represents that the service corresponding to the target node is executed. Here, the number of target nodes in the set of target nodes is used to subsequently determine whether parallel operations are required. Alternatively, the parallel execution of the nodes can be completed by constructing related parallelizers. Therefore, the time for constructing the relevant parallelizer can be effectively saved by determining whether the parallelization operation needs to be carried out. And finally, writing the first execution information set into a global variable to obtain the written global variable. The execution subject in the written global variable may be used for executing a subsequent service. The information writing method can be used for quickly and efficiently executing all the services corresponding to the target node set in parallel, and the scheduling time is saved.
With further reference to fig. 5, a flow 500 of further embodiments of an information writing method according to the present disclosure is shown. The information writing method comprises the following steps:
step 501, a pre-constructed directed acyclic graph related to a service set is obtained.
Step 502, determining a target node set in the directed acyclic graph.
Step 503, in response to that each target node is an internal node of the directed acyclic graph, determining at least one front node of each target node in the target node set.
In some embodiments, in response to the target nodes being internal nodes of the directed acyclic graph, an executing entity (e.g., the electronic device shown in fig. 1) may determine at least one front node of each target node in the set of target nodes. And determining at least one front node of each target node in the target node set.
As an example, in response to the target nodes being internal nodes of the directed acyclic graph, the executing entity may determine at least one front node of each target node in the target node set by detecting a relationship between the nodes in the directed acyclic graph.
Step 504, determining second execution information of each front node in the at least one front node according to the first execution information written in the global variable, to obtain a second execution information set.
In some embodiments, the execution subject may determine, according to the first execution information written in the global variable, second execution information of each of the at least one front node, to obtain a second execution information set. The second execution information is information of whether the service corresponding to the front end node is executed. As an example, the execution subject may first detect whether the first execution information of each front node exists in the first execution information written by the global variable. Then, in response to the presence, characterizing that the service corresponding to the head node has been executed. And responding to the non-existence, and characterizing that the service corresponding to the preposed node is not executed.
And 505, merging the target nodes in the target node set according to the second execution information set corresponding to each target node, and taking the merged node set as a target node set.
In some embodiments, the executing body may merge target nodes in the target node set in various ways according to the second execution information set corresponding to each target node, and obtain a merged node set as the target node set.
In some optional implementation manners of some embodiments, the merging the target nodes in the target node set according to the second execution information set corresponding to each target node, and obtaining a merged node set as the target node set may include the following steps:
and step one, screening the target node set according to the second execution information set corresponding to each target node to obtain a screened target node set. For example, the execution body may filter the target node set by using various methods according to the second execution information set corresponding to each target node, so as to obtain a filtered target node set.
And secondly, merging the screened target node sets in the target node set to obtain a merged node set serving as a target node set.
Optionally, the screening the target node set according to the second execution information set corresponding to each target node to obtain a screened target node set may include the following steps:
and step one, determining whether second execution information exists in a second execution information set corresponding to each target node, wherein the second execution information is information that service corresponding to the prepositive node is not executed, and obtaining a determination result.
And secondly, screening the target node set according to the determination result corresponding to each target node to obtain a screened target node set. As an example, the screened target node may be a node corresponding to the second execution information set, where the second execution information is information that the service corresponding to the front-end node is not executed.
Step 506, in response to that the number of target nodes in the target node set is greater than a preset threshold, executing each service corresponding to the target node set in parallel to obtain a first execution information set.
And 507, writing the first execution information set into a global variable to obtain the written global variable.
In some embodiments, the specific implementation of steps 501, 502, and 506 and the technical effect thereof can refer to steps 201 and 204 in the embodiment corresponding to fig. 2, which are not described herein again.
The embodiment of the disclosure can reduce the complexity of service execution by reducing the number of nodes of the directed acyclic graph, thereby greatly improving the scheduling efficiency. Factors that lead to higher complexity and less efficient scheduling of service execution tend to be as follows: whether the merge node executes or not is decided by the execution state of the front node. In a multi-thread environment, inter-thread communication is required, which increases implementation complexity, and in a high-concurrency real-time system, performance is reduced due to a large number of threads being suspended instantaneously. Therefore, the embodiment of the present disclosure effectively merges the target nodes in the target node set by determining the execution conditions of at least one front node and a corresponding front node of each target node in the target node set.
With further reference to fig. 6, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of an information writing apparatus, which correspond to those of the method embodiments shown in fig. 2, and which may be applied in particular to various electronic devices.
As shown in fig. 6, an information writing apparatus 600 includes: an acquisition unit 601, a determination unit 602, an execution unit 603, and a writing unit 604. Wherein the obtaining unit 601 is configured to: and acquiring a pre-constructed directed acyclic graph related to a service set, wherein the service is provided for a corresponding terminal, and the directed acyclic graph is used for representing the execution sequence of the service in the service set. The determining unit 602 is configured to: and determining a target node set in the directed acyclic graph, wherein each target node in the target node set is each service to be executed. The execution unit 603 is configured to: and in response to that the number of target nodes in the target node set is greater than a preset threshold value, executing each service corresponding to the target node set in parallel to obtain a first execution information set, wherein the first execution information represents that the service corresponding to the target node is executed. The writing unit 604 is configured to: and writing the first execution information set into a global variable to obtain the written global variable.
In some optional implementations of some embodiments, the apparatus 600 may further include: a front node determining unit, a second execution information determining unit, and a merging unit (not shown in the figure). Wherein the front node determination unit is configured to: and determining at least one front node of each target node in the target node set in response to each target node being an internal node of the directed acyclic graph. The second execution information determination unit is configured to: and determining second execution information of each front node in the at least one front node according to the first execution information written in the global variable to obtain a second execution information set, wherein the second execution information is information on whether a service corresponding to the front node is executed or not. The merging unit is configured to: and merging the target nodes in the target node set according to the second execution information set corresponding to each target node to obtain a merged node set as a target node set.
In some optional implementations of some embodiments, the apparatus 600 may further include: a screening unit, a node merging unit (not shown). The screening unit is configured to: and screening the target node set according to the second execution information set corresponding to each target node to obtain a screened target node set. The node merge unit is configured to: and merging the screened target node sets in the target node set to obtain a merged node set as a target node set.
In some optional implementations of some embodiments, the apparatus 600 may further include: an information determination unit, a node screening unit (not shown in the figure). The information determination unit is configured to: and determining whether second execution information exists in a second execution information set corresponding to each target node, wherein the second execution information is information that the service corresponding to the prepositive node is not executed, and obtaining a determination result. The node screening unit is configured to: and screening the target node set according to the determination result corresponding to each target node to obtain the screened target node set.
In some optional implementations of some embodiments, the apparatus 600 may further include: an initialization unit (not shown in the figure). The initialization unit is configured to: and initializing the global variable in response to each target node being an initial node of the directed acyclic graph.
In some optional implementations of some embodiments, the apparatus 600 may further include: an execution unit (not shown in the figure). The execution unit is configured to: and responding to the number of the target nodes in the target node set equal to the preset threshold value, and serially executing each service corresponding to the target node set.
In some optional implementations of some embodiments, the writing unit 604 in the apparatus 600 may be further configured to: and writing at least one piece of first execution information which does not exist in the global variables in the first execution information set into the global variables to obtain the written global variables. It will be understood that the elements described in the apparatus 600 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 600 and the units included therein, and are not described herein again.
Referring now to fig. 7, a schematic diagram of an electronic device (e.g., the electronic device of fig. 1) 700 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 7 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network via communications means 709, or may be installed from storage 708, or may be installed from ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described above in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having 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. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a pre-constructed directed acyclic graph related to a service set, wherein the service is provided for a corresponding terminal, and the directed acyclic graph is used for representing the execution sequence of the service in the service set; determining a target node set in the directed acyclic graph, wherein each target node in the target node set is each service to be executed; responding to that the number of target nodes in the target node set is larger than a preset threshold value, executing each service corresponding to the target node set in parallel to obtain a first execution information set, wherein the first execution information represents that the service corresponding to the target node is executed; and writing the first execution information set into a global variable.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a determination unit, an execution unit, and a writing unit. Where the names of these units do not in some cases constitute a limitation on the units themselves, for example, an acquisition unit may also be described as a "unit that acquires a pre-constructed directed acyclic graph associated with a set of services".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. An information writing method, comprising:
acquiring a pre-constructed directed acyclic graph related to a service set, wherein the service is provided for a corresponding terminal, and the directed acyclic graph is used for representing the execution sequence of the service in the service set;
determining a target node set in the directed acyclic graph, wherein each target node in the target node set is each service to be executed;
responding to that the number of target nodes in the target node set is larger than a preset threshold value, executing all services corresponding to the target node set in parallel to obtain a first execution information set, wherein the first execution information represents that the services corresponding to the target nodes are executed;
and writing the first execution information set into a global variable to obtain the written global variable.
2. The method according to claim 1, wherein before the responding that the number of target nodes in the target node set is greater than a preset threshold, executing each service corresponding to the target node set in parallel to obtain a first execution information set, the method further comprises:
determining at least one front node of each target node in the target node set in response to each target node being an internal node of the directed acyclic graph;
determining second execution information of each front node in the at least one front node according to the first execution information written in the global variable to obtain a second execution information set, wherein the second execution information is information on whether a service corresponding to the front node is executed or not;
and merging the target nodes in the target node set according to the second execution information set corresponding to each target node to obtain a merged node set serving as a target node set.
3. The method according to claim 2, wherein the merging target nodes in the target node set according to the second execution information set corresponding to each target node to obtain a merged node set as a target node set includes:
screening the target node set according to the second execution information set corresponding to each target node to obtain a screened target node set;
and merging the screened target node sets in the target node set to obtain a merged node set as a target node set.
4. The method of claim 3, wherein the screening the target node set according to the second execution information set corresponding to each target node to obtain a screened target node set comprises:
determining whether second execution information exists in a second execution information set corresponding to each target node, wherein the second execution information is information that service corresponding to the prepositive node is not executed, and obtaining a determination result;
and screening the target node set according to the determination result corresponding to each target node to obtain the screened target node set.
5. The method of claim 2, wherein the method further comprises:
and initializing the global variable in response to each target node being an initial node of the directed acyclic graph.
6. The method of claim 1, wherein the method further comprises:
and responding to the number of the target nodes in the target node set equal to the preset threshold value, and serially executing each service corresponding to the target node set.
7. The method of claim 1, wherein the writing the first set of execution information to a global variable, resulting in a written global variable, comprises:
and writing at least one piece of first execution information which does not exist in the global variables in the first execution information set into the global variables to obtain the written global variables.
8. An information writing apparatus comprising:
the service processing device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to acquire a pre-constructed directed acyclic graph related to a service set, the service is provided for a corresponding terminal, and the directed acyclic graph is used for representing the execution sequence of the services in the service set;
a determining unit configured to determine a target node set in the directed acyclic graph, wherein each target node in the target node set is each service to be executed;
the execution unit is configured to respond that the number of target nodes in the target node set is greater than a preset threshold value, execute each service corresponding to the target node set in parallel, and obtain a first execution information set, wherein the first execution information represents that the service corresponding to the target nodes is executed;
and the writing unit is configured to write the first execution information set into a global variable to obtain a written global variable.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-7.
CN202011607256.0A 2020-12-29 2020-12-29 Information writing method, information writing device, electronic equipment and computer readable medium Active CN112732979B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011607256.0A CN112732979B (en) 2020-12-29 2020-12-29 Information writing method, information writing device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011607256.0A CN112732979B (en) 2020-12-29 2020-12-29 Information writing method, information writing device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN112732979A true CN112732979A (en) 2021-04-30
CN112732979B CN112732979B (en) 2023-02-17

Family

ID=75610094

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011607256.0A Active CN112732979B (en) 2020-12-29 2020-12-29 Information writing method, information writing device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN112732979B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113704076A (en) * 2021-10-27 2021-11-26 北京每日菜场科技有限公司 Task optimization method and device, electronic equipment and computer readable medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106687920A (en) * 2014-09-02 2017-05-17 起元科技有限公司 Managing invocation of tasks
CN109523187A (en) * 2018-11-27 2019-03-26 北京字节跳动网络技术有限公司 Method for scheduling task, device and equipment
CN109814986A (en) * 2017-11-20 2019-05-28 上海寒武纪信息科技有限公司 Task method for parallel processing, storage medium, computer equipment, device and system
CN110333940A (en) * 2019-06-25 2019-10-15 深圳前海微众银行股份有限公司 Method for scheduling task, device, equipment and storage medium based on condition
CN110554909A (en) * 2019-09-06 2019-12-10 腾讯科技(深圳)有限公司 task scheduling processing method and device and computer equipment
CN111061551A (en) * 2019-12-06 2020-04-24 深圳前海微众银行股份有限公司 Node merging and scheduling method, device, equipment and storage medium
CN111258740A (en) * 2020-02-03 2020-06-09 北京无限光场科技有限公司 Method and device for starting application program and electronic equipment
CN111324470A (en) * 2020-01-20 2020-06-23 北京百度网讯科技有限公司 Method and device for generating information
CN111367642A (en) * 2020-03-09 2020-07-03 中国铁塔股份有限公司 Task scheduling execution method and device
CN111597028A (en) * 2020-05-19 2020-08-28 北京百度网讯科技有限公司 Method and device for task scheduling
CN111831424A (en) * 2019-04-17 2020-10-27 杭州海康威视数字技术股份有限公司 Task processing method, system and device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106687920A (en) * 2014-09-02 2017-05-17 起元科技有限公司 Managing invocation of tasks
CN109814986A (en) * 2017-11-20 2019-05-28 上海寒武纪信息科技有限公司 Task method for parallel processing, storage medium, computer equipment, device and system
CN109523187A (en) * 2018-11-27 2019-03-26 北京字节跳动网络技术有限公司 Method for scheduling task, device and equipment
CN111831424A (en) * 2019-04-17 2020-10-27 杭州海康威视数字技术股份有限公司 Task processing method, system and device
CN110333940A (en) * 2019-06-25 2019-10-15 深圳前海微众银行股份有限公司 Method for scheduling task, device, equipment and storage medium based on condition
CN110554909A (en) * 2019-09-06 2019-12-10 腾讯科技(深圳)有限公司 task scheduling processing method and device and computer equipment
CN111061551A (en) * 2019-12-06 2020-04-24 深圳前海微众银行股份有限公司 Node merging and scheduling method, device, equipment and storage medium
CN111324470A (en) * 2020-01-20 2020-06-23 北京百度网讯科技有限公司 Method and device for generating information
CN111258740A (en) * 2020-02-03 2020-06-09 北京无限光场科技有限公司 Method and device for starting application program and electronic equipment
CN111367642A (en) * 2020-03-09 2020-07-03 中国铁塔股份有限公司 Task scheduling execution method and device
CN111597028A (en) * 2020-05-19 2020-08-28 北京百度网讯科技有限公司 Method and device for task scheduling

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113704076A (en) * 2021-10-27 2021-11-26 北京每日菜场科技有限公司 Task optimization method and device, electronic equipment and computer readable medium

Also Published As

Publication number Publication date
CN112732979B (en) 2023-02-17

Similar Documents

Publication Publication Date Title
CN110753089B (en) Method, device, medium and electronic equipment for managing client
CN111784712B (en) Image processing method, device, equipment and computer readable medium
CN112150490A (en) Image detection method, image detection device, electronic equipment and computer readable medium
CN113722055A (en) Data processing method and device, electronic equipment and computer readable medium
CN113760536A (en) Data caching method and device, electronic equipment and computer readable medium
CN112907942A (en) Vehicle scheduling method, device, equipment and medium based on edge calculation
CN113419841B (en) Message scheduling method and device, electronic equipment and computer readable medium
CN111625422A (en) Thread monitoring method and device, electronic equipment and computer readable storage medium
CN112732979B (en) Information writing method, information writing device, electronic equipment and computer readable medium
CN112150491A (en) Image detection method, image detection device, electronic equipment and computer readable medium
CN111726476B (en) Image processing method, device, equipment and computer readable medium
CN113792869A (en) Video processing method and device based on neural network chip and electronic equipment
CN112699111B (en) Report generation method and device, electronic equipment and computer readable medium
CN111898061B (en) Method, apparatus, electronic device and computer readable medium for searching network
CN110825461B (en) Data processing method and device
CN112464039A (en) Data display method and device of tree structure, electronic equipment and medium
CN113778850A (en) Data processing method and device, electronic equipment and computer readable medium
CN112527454A (en) Container group scheduling method and device, electronic equipment and computer readable medium
CN111625692B (en) Feature extraction method, device, electronic equipment and computer readable medium
CN114629821B (en) Internet of things consumption data generation method, device, equipment and medium
CN111404824B (en) Method, apparatus, electronic device, and computer-readable medium for forwarding request
CN112203113B (en) Video stream structuring method and device, electronic equipment and computer readable medium
CN112070163B (en) Image segmentation model training and image segmentation method, device and equipment
CN113704076B (en) Task optimization method and device, electronic equipment and computer readable medium
CN112883697B (en) Workflow form generation method, device, electronic equipment and computer readable 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
GR01 Patent grant
GR01 Patent grant