CN119276863B - A distributed framework implementation method, electronic device, and storage medium - Google Patents
A distributed framework implementation method, electronic device, and storage mediumInfo
- Publication number
- CN119276863B CN119276863B CN202411368813.6A CN202411368813A CN119276863B CN 119276863 B CN119276863 B CN 119276863B CN 202411368813 A CN202411368813 A CN 202411368813A CN 119276863 B CN119276863 B CN 119276863B
- Authority
- CN
- China
- Prior art keywords
- target
- node
- distributed
- application
- equipment
- 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.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/63—Routing a service request depending on the request content or context
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The application relates to the technical field of the Internet of things, and particularly discloses a realization method of a distributed framework, electronic equipment and a storage medium, wherein when any physical node in a distributed system responds to a starting request of a distributed application, the physical node intercepts the starting request to acquire information of equipment to be scheduled, and when the triggering of the scheduling of the distributed equipment is determined based on the information of the equipment to be scheduled, a target node and target equipment are selected according to a preset scheduling strategy; and in response to the physical node being the target master node or the target slave node, the target master node or the target slave node locally creates a logic device corresponding to the target device and performs cross-node communication based on the logic device. The application solves the problem of flexibly calling various distributed devices by the cross-terminal under the condition of no sense of upper-layer application, and can meet the requirements of various cross-terminal combined scene services.
Description
Technical Field
The application relates to the technical field of Internet of things, and particularly provides a method for realizing a distributed framework, electronic equipment and a storage medium.
Background
Along with the continuous evolution of the mobile internet and the internet of things, ecological integration, information flow and calculation power sharing of equipment such as a vehicle digital cabin, a mobile phone and the like become trend of future development.
Emerging distributed systems comprehensively build new distributed systems and application ecologies from underlying kernels/drivers, to distributed soft buses and multi-device virtualization, and to upper distributed applications. FIG. 1 shows a logical schematic of an emerging distributed system in which a distributed application A of node A may invoke devices of node A/B/C. Similarly, distributed application B supports streaming between nodes B and C, and may also invoke the facilities of node A/B/C.
These new distributed systems have the following limitations:
1. the distributed system has strong dependence on the cooperation of the bottom layer software and hardware and kernel driving, and the bottom layer system must be in the same ecology.
2. The independent ecological bottom layer system is not compatible with other mainstream mobile phones and PC operating systems.
3. The independent ecological upper layer application AP I is not compatible with other mainstream mobile phones and PC operating systems.
The above limitations result in the inability of existing mass storage applications to flexibly invoke distributed devices across nodes.
Disclosure of Invention
In order to overcome the defects, the application provides a method for realizing a distributed framework, a distributed system and a storage medium, and application program non-sense cross-end sharing equipment is realized by means of a native system.
In a first aspect, the present application provides a method for implementing a distributed framework, applied to a distributed system, where the distributed system includes a plurality of physical nodes for implementing the distributed framework, and the method is characterized in that the method includes:
When any physical node in the distributed system responds to a starting request of a distributed application, the physical node intercepts the starting request to acquire information of equipment to be scheduled, and when the triggering of the distributed equipment scheduling is determined based on the information of the equipment to be scheduled, a target node and target equipment are selected according to a preset scheduling strategy;
the target nodes comprise a target master node and at least one target slave node, wherein the target master node is used for executing the distributed application, and the target slave node is used for providing target equipment required for executing the distributed application;
And in response to the physical node being the target master node or the target slave node, the target master node or the target slave node locally creates a logic device corresponding to the target device and performs cross-node communication based on the logic device.
In some embodiments, the physical node further comprises, after intercepting the start request, obtaining static configuration resource information, where the static configuration resource information includes user-specified resource information and resource information configured by a system background;
The step of selecting the target node and the target device according to the preset scheduling policy comprises the steps of judging whether the information of the device to be scheduled is matched with the static configuration resource information, if so, selecting the target node and the target device according to the preset static scheduling policy, otherwise, selecting the target node and the target device according to the preset dynamic scheduling policy.
The method comprises the steps that a plurality of physical nodes for realizing the distributed framework collect and store respective resource state information in advance, wherein the resource state information at least comprises distributed equipment information, node system load state information and network link state information;
The target node and the target device are selected according to a preset static scheduling strategy, wherein the target node and the target device meeting scheduling requirements are determined according to the user-specified resource information or the resource information configured by the system background and the pre-collected resource state information;
The step of selecting the target node and the target device according to the preset dynamic scheduling strategy comprises the step of traversing the resources corresponding to the information of the device to be scheduled by combining the pre-collected resource state information so as to determine the target node and the target device meeting the scheduling requirement.
In some embodiments, the target slave node locally creates a logical device corresponding to the target device, and communicating across nodes based on the logical device comprises:
The target slave node locally creates logic equipment corresponding to the target equipment, starts a local distributed application based on a native system of the target slave node, and connects the logic equipment to the native system of the target master node;
The target master node creating a logical device corresponding to the target device locally and performing cross-node communication based on the logical device includes:
and the target master node locally creates logic equipment corresponding to the target equipment, continuously starts the distributed application based on a native system of the target master node, acquires an equipment resource mapping table, determines the logic equipment according to the equipment resource mapping table, and uses the target equipment provided by the target slave node based on the logic equipment.
Preferably, the target master node further includes, after locally creating a logical device corresponding to the target device:
and the target master node updates the equipment resource mapping table, wherein the equipment resource mapping table is used for storing the mapping relation between the application ID of the distributed application and the logic equipment.
In some embodiments, the intercepting, by the physical node, the start request to obtain information of the device to be scheduled includes:
The physical node intercepts the starting request, acquires an application ID of the distributed application according to the starting request, analyzes application file description information corresponding to the application ID, and acquires the equipment type and the service quality parameter of the equipment to be scheduled;
The method further comprises the step that the physical node judges whether to trigger distributed equipment scheduling according to the equipment type and the service quality parameters.
Preferably, the method further comprises the step that the target master node and the target slave node synchronize states of the distributed application in real time based on a preset application life cycle management strategy, wherein the states at least comprise a starting state, a pause state and a stopping state.
Preferably, the real-time synchronization of the states of the distributed applications by the target master node and the target slave node based on a preset application lifecycle management policy includes:
When all the distributed applications on the target slave nodes are in a starting state, synchronizing the distributed applications on the target master nodes into a starting state;
When the distributed application on the target master node is in a stop state or a pause state, all the distributed applications on the target slave nodes are synchronized to be in the stop state or the pause state;
and triggering the distributed application on the target master node to enter a pause state when the target equipment on any target slave node is preempted with the resource.
In a second aspect, the present application provides an electronic device, where the electronic device includes a processor and a storage device, where the storage device is adapted to store a plurality of program codes, where the program codes are adapted to be loaded and executed by the processor to perform the implementation method of the distributed framework according to any one of the technical solutions of the implementation method of the distributed framework.
In a third aspect, the present application provides a computer readable storage medium, in which a plurality of program codes are stored, the program codes being adapted to be loaded and executed by a processor to perform the implementation method of the distributed framework according to any one of the technical solutions of the implementation method of the distributed framework.
The technical scheme provided by the application has at least one or more of the following beneficial effects:
In the technical scheme of implementing the application, when any physical node in a distributed system responds to a starting request of a distributed application, the starting request is intercepted to acquire information of equipment to be scheduled, when the distributed equipment scheduling is determined to be triggered based on the information of the equipment to be scheduled, a target node and target equipment are selected according to a preset scheduling strategy, when the physical node is a target master node or a target slave node, the target master node or the target slave node locally creates logic equipment corresponding to the target equipment, and cross-node communication is performed based on the logic equipment. The distributed framework provided by the application comprehensively judges and abstracts a more general target master node for executing the distributed application and a target slave node for providing the capability of the distributed equipment based on a preset scheduling strategy, and performs logic equipment abstraction on the distributed equipment required by executing the distributed application, namely the target equipment, so that the details of the underlying physical equipment can be shielded, and the distributed equipment management and scheduling of the framework are simplified. The distributed framework of the application also designs a target master node and a target slave node, after the logic device is created, the distributed application is started based on the original system to carry out cross-node communication, so that the existing resources are utilized to the maximum extent, the problem that various distributed devices are flexibly called by a cross-end under the condition that the upper-layer application is noninductive is solved, and the requirements of various cross-end combined scene services can be met.
Drawings
The present disclosure will become more readily understood with reference to the accompanying drawings. It is to be understood by persons of ordinary skill in the art that the drawings are designed solely for the purposes of illustration and not as a definition of the limits of the application. Moreover, like numerals in the figures are used to designate like parts, wherein:
FIG. 1 is a logical schematic diagram of a distributed framework implementation of the prior art mainstream;
FIG. 2 is a logical schematic of a distributed framework of the present application;
FIG. 3 is a flow chart of the main steps of a method for implementing a distributed framework of the present application;
FIG. 4 is a schematic diagram of a process of intercepting an application and using a distributed device of the present application;
FIG. 5 is a schematic diagram of a distributed scheduling process of the present application;
FIG. 6 is a schematic diagram of a logical device abstraction and distributed transmission process of the present application;
FIG. 7 is a schematic diagram of a distributed application declaration period management process of the present application.
Detailed Description
Some embodiments of the application are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are merely for explaining the technical principles of the present application, and are not intended to limit the scope of the present application.
In the description of the present application, a "module," "processor" may include hardware, software, or a combination of both. A module may comprise hardware circuitry, various suitable sensors, communication ports, memory, or software components, such as program code, or a combination of software and hardware. The processor may be a central processor, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and/or signal processing functions. The processor may be implemented in software, hardware, or a combination of both. Non-transitory computer readable storage media include any suitable medium that can store program code, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, and the like. The term "a and/or B" means all possible combinations of a and B, such as a alone, B alone or a and B. The term "at least one A or B" or "at least one of A and B" has a meaning similar to "A and/or B" and may include A alone, B alone or A and B. The singular forms "a", "an" and "the" include plural referents.
Some terms related to the present application will be explained first.
A distributed system refers to a system of computer nodes (or physical nodes) that communicate over a network and coordinate to perform a common task.
Physical nodes, which are a basic concept in computer networks and refer to physical devices in the network, may be computers, routers, switches, or other network devices, which are typically tangible, touchable entities.
A distributed framework, a way to design and organize computer systems, is intended to enable a plurality of individual computer nodes to work together to accomplish tasks by connecting them. The core of the distributed framework is to distribute the components in the system on different computers, communicate and cooperate through a network to achieve a common target design mode. In such an architecture, the individual computer nodes operate independently, interact with each other through messaging or sharing states, and aim to improve performance, reliability, and scalability of the system.
Distributed applications, which refer to applications or services distributed on different computers that together accomplish a task over a network.
A native system-a computer operating system is understood to be an ecosystem, a native system being an operating system that has not been modified, cracked or optimized.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it being understood that the preferred embodiments described herein are for illustration and explanation only, and not for limitation of the present application, and embodiments of the present application and features of the embodiments may be combined with each other without conflict.
Referring to fig. 2, a logic schematic diagram of a distributed framework provided by the present application is shown in the figure, where three physical nodes, namely, node a, node B and node C, are exemplarily shown, and an application scenario is that a distributed application a of node a invokes a device B of node B and a device C of node C through a native system, and in the application scenario, the distributed framework of the present application abstracts the node a executing the distributed application into a master node (hereinafter referred to as a Host node), and abstracts the node B and the node C providing the capability of the distributed device into a slave node (hereinafter referred to as a Guest node). ①②③④⑤ in fig. 2 illustrates the key technical points in the implementation of the distributed framework of the present application, specifically as follows:
① The capability of calling the distributed equipment by the cross-end is provided by the original system, and the existing ecological resources are utilized to the maximum extent. Typical native mobile operating systems are ios, andro i d, hong, etc., and PC native operating systems are macOS, wi ndows, L i nux, etc.
② The distributed framework abstracts more general Host and Guest nodes, such as Host node A, guest node B and Guest node C shown in the figure, according to the node functions of executing applications and providing device capabilities.
③ The distributed framework schedules requests to the Guest nodes.
④ The Guest node starts up the Guest application through the native system to provide the Host node with distributed devices to be used, such as device B and device C shown in the figure.
⑤ The Guest node interfaces the distributed device to the Host node's native system through distributed transport and logical device abstraction.
In practical applications, a distributed application of 1 Host node may use devices on multiple Guest nodes. The concepts of Host and Guest are differentiated for a single distributed application, and a single physical node may be both a Host node and a Guest node. For example, a certain physical node may share the application Y of the device to other nodes while executing the distributed application X, where the physical node is not only a Host node executing the application X, but also a Guest node providing the application Y with the capability of the distributed device.
Taking the example of the mobile phone, the car machine and NBOX playing the game cooperatively, the mobile phone runs the game, the screen of the car machine displays a game interface, NBOX is connected with a game control lever, in the application scene, the mobile phone is a Host node, and the car machine and NBOX are Guest nodes. And the map navigation application is run by the NBOX, the navigation interface is displayed on the screen of the vehicle, the GPS navigation and the loudspeaker navigation sound playing are also provided by the vehicle, and in the application scene, NBOX is a Host node and the vehicle is a Guest node. For the first gaming application NBOX is the Guest node and for the second map navigation application NBOX is the Host node.
Referring to fig. 3, the implementation method of the distributed framework provided by the application realizes the key technical points, solves the problem of flexibly calling various distributed devices by cross nodes under the condition of no sense of upper application, and can meet the requirements of various cross-end combined scene services in the future. As shown in fig. 3, the implementation method of the distributed framework provided by the application is applied to a distributed system, wherein the distributed system comprises a plurality of physical nodes for implementing the distributed framework, and the implementation method of the distributed framework mainly comprises the following steps S11 and S12.
Step S11, when any physical node in the distributed system responds to a starting request of a distributed application, the physical node intercepts the starting request to acquire information of equipment to be scheduled, and when the triggering of the distributed equipment scheduling is determined based on the information of the equipment to be scheduled, a target node and target equipment are selected according to a preset scheduling strategy;
the target nodes comprise a target master node and at least one target slave node, wherein the target master node is used for executing the distributed application, and the target slave node is used for providing target equipment required for executing the distributed application.
And step S12, responding to the fact that the physical node is the target master node or the target slave node, and locally creating a logic device corresponding to the target device by the target master node or the target slave node and performing cross-node communication based on the logic device.
In the embodiment of the application, for the target master node executing the distributed application, the calling logic device is the same as the calling local device, but the logic device can send the processing procedures of data receiving, transmitting, device control and the like to the target slave node for interaction, so that the details of bottom layer devices, network transmission and the like are not required to be considered for the application and service of the upper layer, the realization is simpler, and the application can achieve the effects of simplifying the management and the dispatching of the distributed device of the framework by abstracting the logic device and shielding the details of the bottom layer physical devices.
Based on the step S11, the step of intercepting the start request by the physical node to obtain the information of the device to be scheduled includes that the physical node intercepts the start request, obtains an application ID of the distributed application according to the start request, and analyzes application file description information corresponding to the application ID to obtain a device type and a service quality parameter of the device to be scheduled, where the resource requested by the start request may be a single device or a group of devices (such as a screen, a touch control, a speaker, etc.) with application scene dependence. Correspondingly, the physical node can judge whether to trigger the distributed equipment scheduling according to the equipment type and the service quality parameters, specifically, the physical node judges whether the local equipment can simultaneously meet the equipment type and the service quality parameters, if so, the distributed equipment scheduling is not triggered, the physical node responds to a normal (non-distributed) starting request of an application program, and if not, the distributed equipment scheduling is triggered. Taking playing QQ music on the mobile phone as an example, if the QQ music is started normally, the distributed scheduling is not triggered, and the mobile phone directly plays the QQ music. If the mobile phone and the vehicle cabin share the distributed equipment, the mobile phone is a Host node to execute the QQ music application program, the vehicle cabin is a Guest node, the target equipment is a vehicle-mounted loudspeaker to bear sound playing, and when the distributed QQ music application is started on the mobile phone, the mobile phone music is played on the vehicle-mounted loudspeaker through distributed scheduling.
Further, in the step S11, the start request of the distributed application may be a local application start request or a cross-end application start request, and when the physical node responds to the start request of the distributed application, the intercepting process of intercepting the start request may include intercepting, by the physical node, the start request based on a system authority of a system where a local or cross-end application to be started is located. After intercepting the starting request, when determining to trigger the distributed equipment to dispatch, selecting a Host node and a Guest node according to a preset dispatching strategy.
In an application scenario, NBOX and 2 physical nodes of a vehicle are brand-A products, and support Host service, namely, have system authority for intercepting application, a map is started on the vehicle, a vehicle system intercepts a starting request of the application, and when judging that NBOX system load is lower according to a preset scheduling strategy, the vehicle system schedules NBOX to execute the application. The end result is NBOX as the Host node, running the map application, and the vehicle machine that initially starts the map as the Guest node, only providing display and touch screen device functions.
In an application scene, two physical nodes, namely NBOX of brand A and a vehicle machine, have system permission for intercepting an application, and a physical node, namely a mobile phone of brand B, cannot intercept the application, namely does not have the system permission for intercepting the application. In practical application, the B brand mobile phone can provide the capability of the distributed equipment through the installation guest sdk app for the application of the A brand NBOX and the vehicle app, specifically, when the B brand mobile phone responds to the starting request of the application, the A brand NBOX with application interception authority and the vehicle app icon of the vehicle are displayed through the guide app interface, then the user clicks the icon through the guide app window to select nodes, the position information of the B brand mobile phone is sent to the user selected A brand NBOX or the vehicle app to intercept the application and perform distributed scheduling, the B brand mobile phone does not participate in application interception, and the B brand mobile phone performs partial message forwarding through the guide app and supports the calling of the distributed equipment.
Furthermore, the distributed device scheduling in the embodiment of the application can support two scheduling modes of static scheduling and dynamic scheduling, and the preset scheduling policy comprises a preset static scheduling policy and a preset dynamic scheduling policy. Specifically, in the step S11, after the physical node intercepts the start request, the method further includes obtaining static configuration resource information, where the static configuration resource information includes user-specified resource information and resource information configured by a system background, and the corresponding selecting the target node and the target device according to a preset scheduling policy includes determining whether information of the device to be scheduled matches with the static configuration resource information, if so, selecting the target node and the target device according to the preset static scheduling policy, otherwise, selecting the target node and the target device according to the preset dynamic scheduling policy. In practical application, a plurality of physical nodes for implementing the distributed framework collect and store respective resource state information in advance, so that when distributed scheduling is performed according to a preset scheduling policy, appropriate target nodes and target devices can be determined by combining the pre-collected resource state information. In this embodiment, the resource status information at least includes distributed device information, node system load status information, and network link status information, and the resource status information of each node collected in advance may be uniformly stored in a distributed storage system, for example, stored in a file system, a database, or the like.
The static scheduling and the dynamic scheduling are explained below.
For static scheduling, selecting target nodes and target equipment according to a preset static scheduling strategy, and specifically determining the target nodes and the target equipment meeting scheduling requirements according to user-specified resource information or resource information configured by a system background and pre-collected resource state information. In a specific embodiment, when a physical node intercepts a starting request of a distributed application, the physical node can acquire specified information of service nodes and equipment, namely static configuration resource information, such as a system desktop provides a service node and equipment list to be selected for the user at an interface when the distributed application is started, the user selects a target node and target equipment, the physical node judges whether the specified or configured node and equipment of the static configuration resource information meet a scheduling requirement according to the resource state information collected in advance, if yes, the specified or configured node and equipment of the static configuration resource information are determined as the target node and target equipment, the used resource QoS (for example, the coding rate is adjusted, the transmission type is adjusted, and the like) is updated if necessary, and if not, the scheduling requirement is not met, the scheduling request is returned to fail.
Taking a mobile phone, a car phone and NBOX as examples, the mobile phone needs to call a distributed loudspeaker to play audio. For static scheduling, determining that a mobile phone is a designated master node, a vehicle is a designated slave node, a loudspeaker of the vehicle is a designated device according to user designated resource information, judging whether the loudspeaker of the vehicle is available or not based on the system load of the vehicle node and the network link state, if the available condition is met, determining that the mobile phone is a target master node, determining that the vehicle and the loudspeaker are target slave nodes and target devices meeting scheduling requirements, continuing to configure and use vehicle loudspeaker resources, and if the designated vehicle node and the designated loudspeaker device do not meet the available condition, no other nodes and devices are searched, and the call fails.
And for dynamic scheduling, selecting a target node and target equipment according to a preset dynamic scheduling strategy, specifically, traversing resources corresponding to the information of the equipment to be scheduled by combining the pre-collected resource state information to determine the target node and target equipment meeting scheduling requirements. In a specific embodiment, a physical node can find all resources corresponding to the equipment to be scheduled, namely nodes and equipment, traverse all the nodes and equipment, judge whether each node and equipment meet the scheduling requirement according to the resource state information in the traversing process until the node and equipment meeting the scheduling requirement are found by traversing and are determined as target nodes and target equipment, update the QoS (for example, the adjustment of the coding rate, the transmission type and the like) of the resources which are already used if necessary, and return a call request failure if the target nodes and the target equipment meeting the scheduling requirement are not found after the traversing is completed.
Taking a mobile phone, a car phone and NBOX as examples, for dynamic scheduling, finding all resources (including nodes and equipment) corresponding to the equipment to be scheduled according to the information of the equipment to be scheduled, determining the mobile phone as a target master node from the found resources according to the resource state information, traversing all the equipment in the resources, supposing that car phone speakers are firstly searched, judging whether car phone speakers are available or not based on a car phone node system and a network state, if the available conditions are met, designating the car phone and the speakers as target slave nodes and target equipment, continuing to configure and use car phone speaker resources, if the car phone speakers do not meet the available conditions, continuing to search and judge NBOX whether the speakers are available, if the available conditions are met, designating NBOX and the speakers as target slave nodes and target equipment, continuing to configure and use NBOX speaker resources, and if NBOX speakers do not meet the available conditions, and no other candidate nodes and distributed speaker equipment, failing to call.
Based on the step S12, the target slave node creates the logic device corresponding to the target device locally and performs cross-node communication based on the logic device, wherein the target slave node creates the logic device corresponding to the target device locally, starts a local distributed application based on a native system of the target slave node, and connects the logic device to the native system of the target master node.
The target master node creates logic equipment corresponding to the target equipment locally and performs cross-node communication based on the logic equipment, wherein the target master node creates the logic equipment corresponding to the target equipment locally, continues to start the distributed application based on a native system of the target master node, acquires an equipment resource mapping table, determines the logic equipment according to the equipment resource mapping table, and uses the target equipment provided by the target slave node based on the logic equipment. Correspondingly, the target master node further comprises a step of updating the device resource mapping table by the target master node after the logic device corresponding to the target device is locally created, wherein the device resource mapping table is used for storing the mapping relation between the application ID of the distributed application and the logic device.
Further, the implementation method of the distributed framework provided by the embodiment of the present application may further include the following step S13.
And step S13, the target master node and the target slave node synchronize the states of the distributed application in real time based on a preset application life cycle management strategy, wherein the states at least comprise a starting state, a pause state and a stop state.
In a specific embodiment, the real-time synchronization of the states of the distributed applications by the target master node and the target slave node based on a preset application lifecycle management policy includes:
When all the distributed applications on the target slave nodes are in a starting state, synchronizing the distributed applications on the target master nodes into a starting state;
When the distributed application on the target master node is in a stop state or a pause state, all the distributed applications on the target slave nodes are synchronized to be in the stop state or the pause state;
And triggering the distributed application on the target master node to enter a pause state when the target equipment on any target slave node is preempted with the resource.
It can be understood that if the target device of the preempted resource resumes use, the target master node resumes executing the application program, and all the target slave nodes also resume executing the application program, i.e. the state of the distributed application of the target master node and the target slave nodes is changed to the start state. For example, if the native system high priority application exits and releases the preemption device, the distributed application implementing the Host node and the Guest node of the distributed framework all resume execution.
Taking an application scene as an example, the mobile phone is a Host node, and the vehicle machine provides a distributed loudspeaker for the Guest node. The mobile phone runs the QQ music application program, and the car speaker plays the audio of the QQ music. When an incoming call exists on the mobile phone, the incoming call is an application with higher priority, and the mobile phone informs the car machine to pause playing QQ music. After the mobile phone calls, the mobile phone informs the car phone to continuously play QQ music.
In order to further understand the implementation method of the distributed framework provided by the present application, a process of intercepting an application and using a distributed device, a distributed scheduling process, a logical device abstraction and distributed transmission process, and an application lifecycle management process, which are involved in the implementation method of the distributed framework, will be described in detail below with reference to fig. 4 to 7.
Referring to fig. 4, fig. 4 shows a process of intercepting an application and using a distributed device, and the processes 1 to 5 in the drawings are respectively:
① Intercepting a starting request of a local or cross-terminal application program to be started through a system desktop, and acquiring equipment type, service quality parameters (QoS), application ID (app Id), static configuration resource information and the like, wherein the method specifically comprises the following steps of:
a. Parsing the application file description information (e.g., man i fest) to refine the device type and QoS required by the application/service;
b. Recording information for delivering the start request, i.e. application context information required in a distributed manner, such as app id and the like;
c. acquiring user-specified resource information or resource information configured by a system background;
In addition, the application to be started can also be intercepted by an application starter (Launcher);
② Judging whether to trigger distributed scheduling, wherein the specific process comprises the following steps:
a. if no distributed devices are needed, the native system starts the application normally.
B. If a distributed device needs to be invoked, the native system schedules the device to the Guest node B through the distributed framework.
③ Configuration and starting of Host node and Guest node equipment resources specifically comprises the following steps:
a, a guest node B starts an application and configures a local device B;
b. creating a logic device B of a Host node and a logic device B of a Guest node;
the logical device B of the host node interfaces to the local device B of the Guest node via distributed transmission.
④ The distributed framework maintains a device resource mapping table, specifically comprising:
a. and updating the mapping relation between the application ID and the logic device stored in the device resource mapping table.
⑤ The target Host node desktop (or Host) native system continues to launch the application, and when the framework service involves using the distributed device resources, the native system selects to use the distributed device by looking up a device resource mapping table.
Referring to fig. 5, fig. 5 shows a distributed scheduling process, where the processes corresponding to fig. 1-5 are respectively:
① The resource state information of each node is collected in advance and stored;
② Judging the scheduling triggered by the starting request of the application program;
③ Static scheduling;
④ Dynamic scheduling;
⑤ Creating a logic device, interfacing the logic device between a Host node and a Guest node, and interfacing and updating the logic device to respective native systems by the Host node and the Guest node.
The application performs logic device abstraction on various physical devices for distributed scheduling to simplify management of the distributed devices. .
The logic device mainly supports two types of functions:
(1) The cross-node communication links are created according to different application requirements and transmission types supported by the bottom layer.
The distributed transmission technology supports wired transmission and wireless transmission, and the distributed transmission chain establishment is completed according to the specific wired and wireless distributed transmission technology, and finally control and data communication of the distributed equipment are carried.
Typical wired transmissions are usb, hdmi, dp, a b, etc., and typical wireless transmissions are wi f i, bluetooth, infrared, star flash, 3G/4G/LTE/5G/6G, etc.
(2) The data received and transmitted by the logic device is connected to the native system through the native system framework device service.
Referring to fig. 6, fig. 6 shows a process of logic device abstraction and distributed transmission, and the corresponding processes of 1-4 in the figure are respectively:
① The device type is acquired based on the distributed scheduling, and the transmission type of the data of the bearing distributed device is acquired.
The distributed transmission priority is generally based on the principle of wired transmission > wireless transmission, and high-speed transmission > low-speed transmission, for example, in the case of simultaneous USB connection and wi f i connection, the USB transmission type is preferentially used.
② And creating logic device instances at the Host node and the Guest node respectively.
The upper distributed device service can operate the bottom physical device like calling files, and does not need to pay attention to complicated distributed transmission butt joint, device control, device data receiving and transmitting processing and the like of the bottom layer. In the distributed framework, the logical device may be created by triggering the Guest node by transmitting an RPC message, and the logical device may be controlled to open, close, connect, port, configure, and query by the RPC message. .
③ The cross-node communication links are created with different transmission types.
④ The data received and transmitted by the logic device is connected to the native system through the native system framework device service.
Referring to fig. 7, fig. 7 illustrates a distributed application lifecycle management process, where the processes 1-5 are respectively:
① After the Host node intercepts the distributed application, the application of the Guest node is started through scheduling.
② After all the applications of the Guest node are in the starting state, the distributed applications of the Host node are in the starting state.
③ The high-priority application of the original system preempts the application resource of the Guest node, and the Guest node application enters a pause state.
④ The distributed framework informs the distributed applications of the Host node and the applications of other Guest nodes to enter a suspended state.
⑤ The distributed application A of the Host node exits and enters a stop state, and the distributed framework informs the application of other Guest nodes to exit and enter the stop state.
The problem of conflict of shared equipment is solved through application lifecycle synchronization between the Host node and the Guest node and a native system framework of the Host and the Guest node, and design and development of the distributed framework can be simplified.
It will be appreciated by those skilled in the art that the present application may implement all or part of the procedures in the methods of the above embodiments, or may be implemented by a computer program for instructing relevant hardware, where the computer program may be stored in a computer readable storage medium, and the computer program may implement the steps of each of the method embodiments when executed by a processor. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable storage medium may include any entity or device capable of carrying the computer program code, a medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory, a random access memory, an electrical carrier wave signal, a telecommunication signal, a software distribution medium, etc. It should be noted that the computer readable storage medium may include content that is subject to appropriate increases and decreases as required by jurisdictions and by jurisdictions in which such computer readable storage medium does not include electrical carrier signals and telecommunications signals.
The application further provides electronic equipment.
In an embodiment of an electronic device according to the present application, the electronic device mainly includes a processor and a storage device, the storage device may be configured to store a program for executing the implementation method of the distributed framework of the above-described method embodiment, and the processor may be configured to execute the program in the storage device, including, but not limited to, the program for executing the implementation method of the distributed framework of the above-described method embodiment. For convenience of explanation, only those portions of the embodiments of the present application that are relevant to the embodiments of the present application are shown, and specific technical details are not disclosed, please refer to the method portions of the embodiments of the present application.
The electronic device in the embodiment of the application can be a control device formed by various electronic devices. In some possible implementations, the electronic device may include multiple storage devices and multiple processors. And a program for executing the implementation method of the distributed framework of the above method embodiment may be divided into a plurality of sub-programs, and each sub-program may be loaded and executed by a processor to execute different steps of the implementation method of the distributed framework of the above method embodiment. Specifically, each of the sub-programs may be stored in different storage devices, and each of the processors may be configured to execute the programs in one or more storage devices, so as to jointly implement the implementation method of the distributed framework of the method embodiment, that is, each of the processors performs different steps of the implementation method of the distributed framework of the method embodiment, so as to jointly implement the implementation method of the distributed framework of the method embodiment.
The plurality of processors may be processors disposed on the same device, for example, the electronic device may be a high-performance device composed of a plurality of processors, and the plurality of processors may be processors configured on the high-performance device. In addition, the plurality of processors may be processors disposed on different devices, for example, the electronic device may be a server cluster, and the plurality of processors may be processors on different servers in the server cluster.
Further, the application also provides a computer readable storage medium.
In one embodiment of a computer-readable storage medium according to the present application, the computer-readable storage medium may be configured to store a program for performing the implementation method of the distributed framework of the above-described method embodiment, which may be loaded and executed by a processor to implement the implementation method of the distributed framework described above. For convenience of explanation, only those portions of the embodiments of the present application that are relevant to the embodiments of the present application are shown, and specific technical details are not disclosed, please refer to the method portions of the embodiments of the present application. The computer readable storage medium may be a storage device including various electronic devices, and optionally, the computer readable storage medium in the embodiments of the present application is a non-transitory computer readable storage medium.
Thus far, the technical solution of the present application has been described in connection with the preferred embodiments shown in the drawings, but it is easily understood by those skilled in the art that the scope of protection of the present application is not limited to these specific embodiments. Equivalent modifications and substitutions for related technical features may be made by those skilled in the art without departing from the principles of the present application, and such modifications and substitutions will fall within the scope of the present application.
Claims (9)
1. A method for implementing a distributed framework, applied to a distributed system, the distributed system including a plurality of physical nodes for implementing the distributed framework, the method comprising:
When any physical node in the distributed system responds to a starting request of a distributed application, the physical node intercepts the starting request to acquire information of equipment to be scheduled, and when the triggering of the distributed equipment scheduling is determined based on the information of the equipment to be scheduled, a target node and target equipment are selected according to a preset scheduling strategy;
the target nodes comprise a target master node and at least one target slave node, wherein the target master node is used for executing the distributed application, and the target slave node is used for providing target equipment required for executing the distributed application;
In response to the physical node being the target slave node, the target slave node locally creating a logical device corresponding to the target device, starting a local distributed application based on a native system of the target slave node, and interfacing the logical device to the native system of the target master node to perform cross-node communication based on the logical device;
And responding to the physical node being the target master node, the target master node locally creating a logic device corresponding to the target device, continuously starting the distributed application based on a native system of the target master node, acquiring a device resource mapping table, determining the logic device according to the device resource mapping table, and using the target device provided by the target slave node based on the determined logic device to perform cross-node communication based on the logic device.
2. The method according to claim 1, characterized in that:
The physical node also comprises the step of acquiring static configuration resource information after intercepting the starting request, wherein the static configuration resource information comprises user-specified resource information and resource information configured by a system background;
The step of selecting the target node and the target device according to the preset scheduling policy comprises the steps of judging whether the information of the device to be scheduled is matched with the static configuration resource information, if so, selecting the target node and the target device according to the preset static scheduling policy, otherwise, selecting the target node and the target device according to the preset dynamic scheduling policy.
3. The method according to claim 2, characterized in that:
The method further comprises the steps that the plurality of physical nodes for realizing the distributed framework collect and store respective resource state information in advance, wherein the resource state information at least comprises distributed equipment information, node system load state information and network link state information;
The target node and the target device are selected according to a preset static scheduling strategy, wherein the target node and the target device meeting scheduling requirements are determined according to the user-specified resource information or the resource information configured by the system background and the pre-collected resource state information;
The step of selecting the target node and the target device according to the preset dynamic scheduling strategy comprises the step of traversing the resources corresponding to the information of the device to be scheduled by combining the pre-collected resource state information so as to determine the target node and the target device meeting the scheduling requirement.
4. The method according to claim 1, characterized in that:
the target master node further includes, after locally creating a logical device corresponding to the target device:
and the target master node updates the equipment resource mapping table, wherein the equipment resource mapping table is used for storing the mapping relation between the application ID of the distributed application and the logic equipment.
5. The method of claim 1, wherein the intercepting, by the physical node, the start request to obtain information of a device to be scheduled comprises:
The physical node intercepts the starting request, acquires an application ID of the distributed application according to the starting request, analyzes application file description information corresponding to the application ID, and acquires the equipment type and the service quality parameter of the equipment to be scheduled;
The method further comprises the step that the physical node judges whether to trigger distributed equipment scheduling according to the equipment type and the service quality parameters.
6. The method according to claim 1, characterized in that:
The method further comprises the step that the target master node and the target slave node synchronize states of the distributed application in real time based on a preset application life cycle management strategy, wherein the states at least comprise a starting state, a pause state and a stopping state.
7. The method according to claim 6, wherein:
The target master node and the target slave node synchronizing the states of the distributed application in real time based on a preset application lifecycle management strategy comprises:
When all the distributed applications on the target slave nodes are in a starting state, synchronizing the distributed applications on the target master nodes into a starting state;
When the distributed application on the target master node is in a stop state or a pause state, all the distributed applications on the target slave nodes are synchronized to be in the stop state or the pause state;
and triggering the distributed application on the target master node to enter a pause state when the target equipment on any target slave node is preempted with the resource.
8. An electronic device comprising a processor and a storage means adapted to store a plurality of program code, characterized in that the program code is adapted to be loaded and executed by the processor to perform the method of implementing the distributed framework of any of claims 1 to 7.
9. A computer readable storage medium having stored therein a plurality of program codes, characterized in that the program codes are adapted to be loaded and executed by a processor to perform the implementation of the distributed framework of any of claims 1 to 7.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411368813.6A CN119276863B (en) | 2024-09-27 | 2024-09-27 | A distributed framework implementation method, electronic device, and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411368813.6A CN119276863B (en) | 2024-09-27 | 2024-09-27 | A distributed framework implementation method, electronic device, and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN119276863A CN119276863A (en) | 2025-01-07 |
| CN119276863B true CN119276863B (en) | 2025-09-26 |
Family
ID=94115989
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202411368813.6A Active CN119276863B (en) | 2024-09-27 | 2024-09-27 | A distributed framework implementation method, electronic device, and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN119276863B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120011082B (en) * | 2025-04-17 | 2025-06-10 | 深圳市华腾智能科技有限公司 | Intelligent interaction method and system for intelligent central control screen based on large model |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111355658A (en) * | 2020-02-28 | 2020-06-30 | 电子科技大学 | SDN cross-domain cooperation method based on distributed service framework |
| CN114090623A (en) * | 2021-12-08 | 2022-02-25 | 云知声智能科技股份有限公司 | Method and device for creating cache resources, electronic equipment and storage medium |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9081621B2 (en) * | 2009-11-25 | 2015-07-14 | Microsoft Technology Licensing, Llc | Efficient input/output-aware multi-processor virtual machine scheduling |
| CN115914242A (en) * | 2021-08-12 | 2023-04-04 | 杭州萤石软件有限公司 | Distributed computing method, system and device |
| CN115801782B (en) * | 2023-01-29 | 2023-05-16 | 中国人民解放军61660部队 | Cross-regional data center cloud resource scheduling system and method |
| CN117707797B (en) * | 2024-02-06 | 2024-05-03 | 湘江实验室 | Task scheduling method, device and related equipment based on distributed cloud platform |
-
2024
- 2024-09-27 CN CN202411368813.6A patent/CN119276863B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111355658A (en) * | 2020-02-28 | 2020-06-30 | 电子科技大学 | SDN cross-domain cooperation method based on distributed service framework |
| CN114090623A (en) * | 2021-12-08 | 2022-02-25 | 云知声智能科技股份有限公司 | Method and device for creating cache resources, electronic equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119276863A (en) | 2025-01-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20240086231A1 (en) | Task migration system and method | |
| CN112015521A (en) | Configuration method and device of inference service, electronic equipment and storage medium | |
| CN106599711A (en) | Database access control method and device | |
| WO2023093429A1 (en) | Micro-application running method and apparatus, and device, storage medium and program product | |
| CN109697120A (en) | Method, electronic equipment for application migration | |
| US20120166646A1 (en) | Method and apparatus for providing multi-level distributed computations | |
| CN114625479B (en) | Cloud-edge collaborative application management method and corresponding device in edge computing | |
| EP2838243A1 (en) | Capability aggregation and exposure method and system | |
| CN115827223B (en) | A service grid hosting method and system based on cloud native platform | |
| CN119276863B (en) | A distributed framework implementation method, electronic device, and storage medium | |
| AU2019256257A1 (en) | Processor core scheduling method and apparatus, terminal, and storage medium | |
| CN114666864A (en) | Multi-network communication method, terminal device, storage medium, and program product | |
| JP7526715B2 (en) | Method and system for segmenting and transmitting data between a computing device and a vehicle head unit - Patents.com | |
| WO2025103006A1 (en) | Serverless computing-based data processing methods and electronic device | |
| CN115589434B (en) | Request processing method, service-oriented system, ECU, vehicle and storage medium | |
| CN114143315B (en) | Edge cloud system, host access method and equipment | |
| EP3430510B1 (en) | Operating system support for game mode | |
| EP4567598A1 (en) | Resource scheduling method, device, system and storage medium | |
| CN120301863A (en) | A method to realize automatic service discovery based on xxl-job transformation of service registration center | |
| CN116887357B (en) | Computing platform management system based on artificial intelligence | |
| US20150135269A1 (en) | Method and system for sharing applications among a plurality of electronic devices | |
| CN117472321A (en) | Audio processing method and device, storage medium and electronic equipment | |
| WO2024109187A9 (en) | Multi-network collaborative operation method, device, and storage medium | |
| KR102914974B1 (en) | Method and apparatus of managing network of performing video information processing in virtual space | |
| CN118445489B (en) | Methods, devices, equipment, and media for using cloud terminal applications |
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 |