A cooperative remote printing method and system based on a P2P network

By filtering and optimizing the selection of print nodes in a P2P network, the problem of ignoring business attributes and real-time status in existing technologies is solved, enabling efficient and secure cross-network print task allocation and management, and improving the practicality and reliability of the print network.

CN121934792BActive Publication Date: 2026-06-23ZHUHAI XPRINTER ELECTRONICS TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHUHAI XPRINTER ELECTRONICS TECHNOLOGY CO LTD
Filing Date
2026-03-30
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing P2P printing solutions ignore the business attribute requirements of printing tasks, cannot achieve task filtering based on geographical location, organizational affiliation, and security level, and do not fully consider the real-time operating status of printers when allocating printing tasks, resulting in uneven task distribution, slow speed, and insufficient reliability.

Method used

By broadcasting node attribute credentials in the P2P network, a set of compliant nodes is selected based on the business execution strategy. Within the compliant set, an optimal selection is made, taking into account factors such as current load, processing capacity, network latency, and physical distance. The target node with the best overall performance is then selected, and a distributed resource market optimization and stateful collaborative scheduling mechanism are used for task allocation and fault migration.

Benefits of technology

Ensuring that print jobs comply with organizational management standards enhances the practicality and intelligence of the P2P printing network, improves the completion speed and system reliability of large tasks, and enables secure printing and data transmission across private networks without complex configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121934792B_ABST
    Figure CN121934792B_ABST
Patent Text Reader

Abstract

The application discloses a cooperative remote printing method and system based on a P2P network, relates to the technical field of printing methods, and can be widely applied in the manufacturing of computer peripheral devices such as man-machine interactive devices and graphic image output devices, and the manufacturing of electronic devices such as cloud platforms, Internet of Things, mobile intelligent terminals and intelligent medical systems. According to the method, nodes with matched business attributes are screened out according to a business execution strategy to form a compliance node set, and the mechanism ensures that a printing task is executed only on a printer that meets business rules such as a geographical position, organizational affiliation and security level, thereby solving the problems of information leakage or management confusion in the prior art. On the basis, further optimization selection is carried out in the compliance set according to real-time state information, and a target node with the optimal comprehensive performance is selected, so that the printing task meets the organizational management specification and the optimal execution performance is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of printing method technology, specifically to a collaborative remote printing method and system based on a P2P network, which is particularly suitable for the manufacturing of computer peripherals such as human-computer interaction devices and graphic image output devices, as well as electronic equipment manufacturing fields such as cloud platforms, the Internet of Things, mobile smart terminals, and intelligent medical systems. Background Technology

[0002] With the development of network technology, remote printing has become an important part of office automation. Traditional network printing usually adopts a client-server architecture, where print jobs are distributed and managed through a centralized print server. In this model, all printers need to register with the central server, and users discover available printers and submit jobs through the server. This centralized architecture has the advantages of convenient management and centralized access control, and is widely used in organizations such as enterprises and schools. However, centralized architecture also has the risk of single point of failure. When the print server goes down, the entire printing network will be paralyzed. At the same time, as the number of printers increases, the server needs to handle a large number of connection requests and task scheduling, which can easily become a performance bottleneck, leading to increased task response delays. In addition, in complex network environments that span regions and organizations, centralized servers find it difficult to effectively manage printers scattered across different private networks, often requiring complex network configurations to achieve cross-network printing.

[0003] To address the limitations of centralized architectures, the industry has begun exploring the application of P2P technology in the printing service field. P2P networks are characterized by decentralization, self-organization, and high scalability. Each node can act as both a service requester and a service provider. In some existing P2P printing solutions, after a printer node joins the P2P network, users can discover all online printers through the network and submit print jobs directly to the target printer. This solution eliminates the dependence on a central server, improves the robustness of the system, and simplifies the configuration of cross-network communication.

[0004] While existing P2P printing solutions have achieved their goal of decentralization, they still have the following problems in practical applications. First, existing P2P printing solutions typically only focus on the online status and basic accessibility of printers, ignoring the business attributes of the printing task itself. For example, in printing tasks involving trade secrets or personal privacy, the task initiator may want to restrict the task to printers with specific security levels, or want the printing task to be completed only on printers within a specific organization or department. Existing solutions lack consideration for business attributes such as geographical location, organizational affiliation, and security level, and cannot achieve task screening based on business policies. Second, after screening out printers that meet business requirements, existing solutions often simply select randomly or use a round-robin method to allocate tasks, without fully considering the business requirements. Considering the real-time operating status of the printer, factors such as the printer's current load, processing capacity, network latency, and physical distance directly affect the efficiency of printing task completion. Ignoring these factors may result in tasks being assigned to printers with excessive loads, causing long waiting times, or to printers with high network latency, increasing task transmission time. In addition, when printing across private networks, existing solutions usually require manual configuration of port forwarding or virtual private networks, which is complex and unfriendly to ordinary users. For large printing tasks, existing solutions are usually slow, and tasks are paused when nodes fail, resulting in slow completion speed and insufficient reliability for large tasks. To address the shortcomings of existing technologies, this invention provides a collaborative remote printing method and system based on a P2P network to solve the above problems. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a collaborative remote printing method and system based on a P2P network. Nodes matching business attributes are selected according to business execution strategies to form a compliant node set. This mechanism ensures that printing tasks are executed only on printers that meet business rules such as geographical location, organizational affiliation, and security level. This solves the problem of information leakage or management chaos that may result from ignoring task business attributes in existing technologies. Furthermore, within the compliant set, optimization is performed based on real-time status information, comprehensively considering factors such as current load, processing capacity, network latency, and physical distance to select the target node with the best overall performance. This avoids the uneven load and slow speed problems caused by random allocation or polling methods in existing solutions. Through this two-layer screening structure—first business, then technology—printing tasks not only comply with organizational management standards but also achieve optimal execution performance, improving the practicality and intelligence of the P2P printing network.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a collaborative remote printing method based on a P2P network, comprising the following steps:

[0007] Step S1: In the P2P network, each printing node broadcasts a node attribute certificate carrying a digital signature. The node attribute certificate contains at least business attribute information issued by a trusted attribute authority. The printing task initiating node generates a printing task, which carries a business execution strategy and a task resource budget.

[0008] Step S2: The printing task initiating node verifies the authenticity and validity of the node attribute credentials of the responding node in the P2P network according to the business execution strategy, and filters out the responding nodes with compliant business attributes to form a preliminary set of compliant nodes.

[0009] Step S3: Within the initial set of compliant nodes, an optimization selection process based on the distributed resource market is initiated: Each responding node submits a resource quote for executing the printing task to the printing task initiating node or the designated coordinating node based on its own real-time status information and resource costs; The printing task initiating node or the coordinating node determines one or more target printing nodes to finally execute the printing task based on the resource quote and the task resource budget, with the goal of optimizing the overall system efficiency.

[0010] Step S4: If multiple target printing nodes are determined, the printing task is decomposed into multiple sub-tasks with sequential dependencies based on its document logical structure, and a state synchronization channel is established for the nodes participating in the collaboration; then each sub-task is sent to the corresponding target printing node.

[0011] Preferably, the printing method further includes step S5, which involves real-time monitoring of the execution status and resource status of each target printing node during task execution; when any target printing node actively warns or passively detects a fault through the status synchronization channel, a replacement node is dynamically selected from the preliminary compliant node set based on the unfinished sub-tasks and the sequential dependency relationship, and fault migration and status recovery are performed.

[0012] Preferably, the printing method further includes step S6, which sends the printing task or subtask to the target printing node or replacement node for execution; when the target node and the initiating node are located in different private networks, NAT traversal is attempted based on the ICE protocol family, and if the traversal fails, an end-to-end encrypted data channel is established through a relay node for transmission.

[0013] Preferably, the business attribute information includes at least one of geographical location, organizational affiliation, and security level; the business execution strategy is a matching condition for the business attribute information.

[0014] Preferably, the real-time status information includes at least one of the following: the node's current load, processing capacity, network latency, and physical distance from the task initiating node.

[0015] Preferably, in step S2, a print node matching the business attribute is obtained by searching using the distributed hash table DHT with the business execution strategy as the key.

[0016] Preferably, if the printing task is a large task and requires collaborative printing, multiple target printing nodes are determined in step S3, and the printing task is decomposed into multiple sub-tasks before step S4, and then each sub-task is sent to the corresponding target printing node for parallel execution.

[0017] Preferably, during the parallel execution of subtasks, the execution status of each target printing node is monitored in real time. When any target printing node is detected to be faulty, a new target printing node is selected from the set of compliant nodes, and the unfinished subtasks are sent to the new target printing node to continue execution.

[0018] Preferably, in step S4, when the target printing node and the task initiating node are located in different private networks, NAT traversal is automatically performed based on the ICE protocol family. If traversal fails, an encrypted data channel is established through a relay node in the P2P network to forward the printing task to the target printing node.

[0019] Preferably, the P2P network includes a management node, which is used to collect and maintain the mapping relationship between the business attribute information and real-time status information of each printing node; in step S2, the list of printing nodes with matching business attributes is obtained by querying the management node.

[0020] Preferably, the P2P network includes relay nodes, which are used to forward data when printing nodes cannot communicate directly and support end-to-end encrypted transmission.

[0021] This invention also discloses a collaborative remote printing system based on a P2P network, used to implement the aforementioned collaborative remote printing method based on a P2P network, comprising:

[0022] Multiple terminal nodes, acting as initiators or executors of print tasks, are used to broadcast node attribute credentials carrying digital signatures, receive print tasks, and execute printing.

[0023] At least one management node is used to maintain the mapping relationship between the business attributes and real-time status information of each printing node, and to respond to query requests for business execution strategies, return a set of matching compliant nodes, or act as a coordinating node to make global optimization decisions on resource pricing.

[0024] At least one relay node is used to establish a data relay channel when direct communication between terminal nodes is not possible, ensuring data transmission across networks.

[0025] Each node is a self-organizing network based on the P2P protocol. Through a multi-layered mechanism of trusted attribute verification, distributed resource market optimization, and stateful collaborative scheduling, collaborative remote printing is achieved. The system is deployed in the manufacturing of computer peripherals such as human-computer interaction devices and graphic image output devices, as well as in the fields of cloud platforms, the Internet of Things, mobile smart terminals, smart medical systems, and RFID electronic equipment manufacturing.

[0026] The technical effects and advantages of this invention are as follows:

[0027] 1. This collaborative remote printing method based on a P2P network selects nodes with matching business attributes according to business execution strategies, forming a set of compliant nodes. This mechanism ensures that printing tasks are executed only on printers that meet business rules such as geographical location, organizational affiliation, and security level. This solves the problem of information leakage or management chaos that may be caused by ignoring the business attributes of tasks in existing technologies. On this basis, further optimization is performed within the compliant set based on real-time status information. Taking into account factors such as current load, processing capacity, network latency, and physical distance, the target node with the best overall performance is selected. This avoids the problems of uneven load and slow speed caused by random allocation or polling methods in existing solutions. Through this two-layer screening structure of business first and technology second, printing tasks can not only comply with organizational management specifications, but also obtain the best execution performance, improving the practicality and intelligence level of the P2P printing network. This invention can be widely applied in the manufacturing of computer components such as handheld tablet computer display devices, computer peripherals such as human-computer interaction devices and graphic image output devices, industrial control computers and systems, cloud platforms, Internet of Things and other computer manufacturing, mobile smart terminals, radar and supporting equipment manufacturing, intelligent medical systems, RFID and other electronic equipment manufacturing, and has significant technological advancement and industrial application value.

[0028] 2. This P2P network-based collaborative remote printing method achieves parallel execution and fault migration of tasks through a large-task collaborative processing structure, improving the completion speed and system reliability of large tasks. When a printing task is large and requires collaborative printing, the system identifies multiple target printing nodes and decomposes the task into multiple sub-tasks for parallel execution. This task decomposition and parallel processing structure makes full use of the processing capabilities of multiple printing nodes in the network, shortening the overall printing time of large documents. During the parallel execution of sub-tasks, the execution status of each target node is monitored in real time. Once a fault is detected in any node, a new node is immediately selected from the set of compliant nodes, and the unfinished sub-tasks are sent to the new node to continue execution, improving the robustness of the system and the success rate of task completion. It is particularly suitable for large printing task scenarios with high timeliness requirements.

[0029] 3. This collaborative remote printing method based on P2P networks achieves cross-private network printing without complex configuration through a cross-network adaptive communication structure, ensuring the security and reliability of data transmission. When the target node and the task initiating node are located on different private networks, NAT traversal is automatically performed based on the ICE protocol family. If traversal fails, an encrypted data channel is established through a relay node to forward the task. This adaptive communication structure overcomes the cumbersome operation of manually configuring port forwarding or VPN for cross-network printing in existing technologies, realizing plug-and-play remote printing. The introduction of the ICE protocol family enables the system to automatically detect the optimal communication path, prioritize efficient P2P direct connection, and switch to relay mode only when traversal fails. This ensures connectivity while optimizing transmission speed as much as possible. At the same time, the relay node supports end-to-end encrypted transmission, ensuring that the printed data content will not be stolen by intermediate nodes even after relay forwarding, thus ensuring the security of sensitive printing tasks. This structure enables the P2P printing system of this invention to be smoothly deployed in complex Internet environments, significantly expanding the application scenarios and user base. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1 This is a flowchart of the overall method of the present invention;

[0032] Figure 2 This is a system architecture diagram of the present invention;

[0033] Figure 3 This is a diagram illustrating the business matching and filtering process of this invention;

[0034] Figure 4 This is a diagram illustrating the optimization selection process of the present invention;

[0035] Figure 5 This is a flowchart of the large-scale task collaborative processing of the present invention;

[0036] Figure 6 This is a flowchart of the cross-network communication processing of the present invention;

[0037] Figure 7 This is a schematic diagram of the management node function of the present invention;

[0038] Figure 8 This is a schematic diagram of relay node forwarding in this invention. Detailed Implementation

[0039] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0040] This embodiment discloses a collaborative remote printing method based on a P2P network, according to the appendix. Figure 1 To be continued Figure 8 As shown, it includes the method steps and system composition.

[0041] Methods section, such as Figure 1 As shown, it includes the following steps:

[0042] Step S1: In the P2P network, each printing node broadcasts a node attribute certificate carrying a digital signature. The node attribute certificate contains at least business attribute information issued by a trusted attribute authority. The printing task initiating node generates a printing task, which carries a business execution strategy and a task resource budget.

[0043] Step S2: The printing task initiating node verifies the authenticity and validity of the node attribute credentials of the responding node in the P2P network according to the business execution strategy, and filters out the responding nodes with compliant business attributes to form a preliminary set of compliant nodes.

[0044] Step S3: Within the initial set of compliant nodes, an optimization selection process based on the distributed resource market is initiated: Each responding node submits a resource quote for executing the printing task to the printing task initiating node or the designated coordinating node based on its own real-time status information and resource costs; The printing task initiating node or the coordinating node determines one or more target printing nodes to finally execute the printing task based on the resource quote and the task resource budget, with the goal of optimizing the overall system efficiency.

[0045] Step S4: If multiple target printing nodes are determined, the printing task is decomposed into multiple sub-tasks with sequential dependencies based on its document logical structure, and a state synchronization channel is established for the nodes participating in the collaboration; then each sub-task is sent to the corresponding target printing node for execution.

[0046] Step S5: During task execution, monitor the execution status and resource status of each target printing node in real time; when any target printing node actively warns or passively detects a fault through the status synchronization channel, dynamically select a replacement node from the preliminary compliant node set based on the unfinished sub-tasks and the sequential dependency relationship, and perform fault migration and status recovery.

[0047] Step S6: Send the printing task or subtask to the target printing node or replacement node for execution; when the target node and the initiating node are located in different private networks, attempt NAT traversal based on the ICE protocol family. If traversal fails, establish an end-to-end encrypted data channel through the relay node for transmission.

[0048] System components, such as Figure 2 As shown, it includes:

[0049] Multiple terminal nodes, acting as initiators or executors of print tasks, are used to broadcast node attribute credentials carrying digital signatures, receive print tasks, and execute printing.

[0050] At least one management node is used to maintain the mapping relationship between the business attributes and real-time status information of each printing node, and to respond to query requests for business execution strategies, return a set of matching compliant nodes, or act as a coordinating node to make global optimization decisions on resource pricing.

[0051] At least one relay node is used to establish a data relay channel when direct communication between terminal nodes is not possible, ensuring data transmission across networks.

[0052] Each node is a self-organizing network based on the P2P protocol. Through a multi-layered mechanism of trusted attribute verification, distributed resource market optimization, and stateful collaborative scheduling, collaborative remote printing is achieved. The system is deployed in the manufacturing of computer peripherals such as human-computer interaction devices and graphic image output devices, as well as in the fields of cloud platforms, the Internet of Things, mobile smart terminals, smart medical systems, and RFID electronic equipment manufacturing.

[0053] Furthermore, for the broadcasting and generation of node attribute credentials in step S1, various publishing mechanisms in P2P networks can be adopted. During system initialization, a trusted attribute authority service is deployed. This service can be integrated into the management node or exist independently. Before joining the network, all compliant printers need to register their identity with this authority service. After the authority verifies the true attributes such as the physical department of origin and security level, it issues a node attribute credential. This credential is a digital certificate containing the node ID, business attribute information (such as geographical location, organizational affiliation, security level, etc.), and is signed by the authority's private key. When a node joins the network, it broadcasts its node attribute credential to the entire network through flooding or gossip protocol. Alternatively, the credential information can be published in the distributed hash table (DHT), allowing other nodes to look it up using key-value pairs.

[0054] The printing task is initiated by any terminal node. The task carries a business execution strategy, which is a matching condition for business attribute information, such as "security level ≥ confidential level", "geographic location = Beijing headquarters" or "organization affiliation = finance department". The task resource budget includes constraints such as the upper limit of expected completion time and the maximum acceptable cost points. The initiating node encapsulates the task into a task data package, which includes a strategy description and the content of the document to be printed.

[0055] Furthermore, regarding the screening process in step S2, such as Figure 3 As shown, there are two main implementation methods: DHT-based lookup and query through management nodes. Regardless of the method used, after receiving the node attribute credentials from the responding node, the initiating node first uses a pre-set trusted attribute authoritative public key to verify the digital signature of each credential. Only nodes with valid signatures and expired credentials have their declared business attributes accepted. Subsequently, the verified attributes are matched according to the business execution strategy to form a real preliminary set of compliant nodes. This mechanism completely solves the attribute trust problem, making the screening of business execution strategies tamper-proof and spoofable.

[0056] The first approach is based on DHT: Nodes in the network store their node attribute credentials in the DHT as key-value pairs. The key is a certain code of the business attribute, and the value is the node identifier. When the initiating node needs to filter, it performs a DHT lookup with the business execution policy as the key value to obtain a list of all nodes that match the business attributes. For example, by combining "geographical location + organization affiliation" as the key, the DHT returns all nodes registered with that key. This approach is suitable for pure P2P architectures and does not require a central node.

[0057] The second method is through querying the management node: One or more management nodes are set up in the P2P network to collect and maintain the mapping relationship between the node attribute credential information and real-time status information of each printing node. The management node can update the information through node active reporting or periodic polling. The initiating node sends the business execution policy to the management node, and the management node queries its database and returns a list of matching nodes to form a set of compliant nodes. The management node can be a specially elected high-performance node or a cluster of multiple nodes to improve availability.

[0058] The two methods can be used in combination. For example, DHT can be used to quickly locate some nodes first, and then the management node can be used to supplement the accurate information.

[0059] Furthermore, regarding the optimization selection of step S3, such as... Figure 4As shown, within the set of compliant nodes, an optimization selection process based on a distributed resource market is introduced. The initiating node (or the management node as a coordinator) issues a task bidding request containing the task resource budget to all nodes in the set. After receiving the request, each compliant node calculates a resource bid required to complete the task based on its own real-time status information (current load, processing capacity, network latency, physical distance, etc.) and resource cost model (such as estimated energy consumption and toner consumption conversion cost). This bid reflects the cost for the node to execute the task at the current moment. After collecting all bids, the coordinator makes a decision with the goal of optimizing the overall system efficiency: for a single task, a node with a suitable bid can be selected; for large collaborative tasks, the coordinator aims to minimize the total bid of all participating nodes or maximize the overall system throughput, and uses optimization algorithms (such as the Hungarian algorithm and greedy algorithm variants) to allocate suitable nodes to multiple sub-tasks. This mechanism elevates the optimization decision from a local perspective to a system-wide perspective, and realizes the self-balancing scheduling of P2P network resources through a simulated market mechanism.

[0060] Furthermore, regarding the handling of large-scale tasks, such as Figure 5 As shown, if the print job is a large job that requires collaborative printing, typically exceeding 100 pages and 100MB in size, multiple target print nodes are identified in step S3, such as the top K nodes with the highest scores. Before step S4, the print job is decomposed into multiple sub-tasks. The task decomposition adopts an intelligent decomposition method: the system parses the metadata or structure of the print document (such as bookmarks in PDFs and section breaks in Words), identifies logical breakpoints (such as the end of a chapter or before and after a chart), and performs segmentation at logical boundaries. Each sub-task is labeled with its global sequence number and dependencies. After identifying multiple target nodes, not only are sub-tasks assigned, but a lightweight status synchronization channel is also established between these nodes (e.g., based on P2P multicast or relayed through a management node). During the printing process, the nodes periodically broadcast their execution status (such as completed sub-tasks, current page number, etc.) through this channel.

[0061] During the parallel execution of subtasks, the initiating node or coordinator monitors the execution status of each target printing node in real time. The monitoring methods include: nodes periodically broadcasting progress through the status synchronization channel; nodes actively reporting heartbeats; and the initiating node actively polling the status. When a node predicts a failure through self-checking (such as a low paper / toner warning), it actively sends a pre-migration request and the precise status of its unfinished subtasks through the status synchronization channel. Upon receiving the request, the coordinator immediately selects an idle or low-load replacement node from the initial set of compliant nodes and transfers the remaining tasks of the failed node along with its current progress status. The new node can continue printing from the breakpoint without starting from scratch. If a node's heartbeat times out, passive fault migration is also triggered. This fault tolerance mechanism improves the reliability and recovery efficiency of large tasks.

[0062] Furthermore, regarding the handling of large-scale tasks, such as Figure 5 As shown, if the print job is a large job that requires collaborative printing, typically exceeding 100 pages and 100MB in size, multiple target print nodes are identified in step S3, such as the top K nodes with the highest scores. Before step S4, the print job is decomposed into multiple sub-tasks. The task decomposition can be based on an average distribution of pages or a dynamic distribution based on the processing capacity of each node, such as allocating more pages to nodes with higher processing capacity. Each sub-task contains part of the original task's data and a sub-task identifier. Then, each sub-task is sent to its corresponding target print node for parallel execution. During the parallel execution of sub-tasks, the initiating node or management node monitors the execution status of each target print node in real time. Monitoring methods include: nodes periodically sending heartbeat reports on progress; the initiating node actively polling the status, and when any target print node is detected to be faulty, a new target print node is immediately selected from the set of compliant nodes. The optimization in S3 can be performed again, and the unfinished sub-tasks are sent to the new target print node for continued execution. At the same time, the results of completed sub-tasks need to be merged to ensure that the final output is a complete printout. This fault tolerance mechanism improves the reliability of large jobs.

[0063] Furthermore, for cross-network communication, such as Figure 6As shown, when the target printing node and the task initiating node are located in different private networks, such as after NAT, step S4 needs to handle NAT traversal. Specifically, NAT traversal is automatically performed based on the ICE protocol suite. The ICE process includes: the initiating node and the candidate target node respectively collect their local IP address, hostname, reflection address obtained through the STUN server, and relay address obtained through the TURN server to form candidate address pairs. The two parties exchange candidate addresses and perform connectivity checks, such as sending a STUN binding request. If there are candidate address pairs that can be directly connected, a direct P2P connection is established, and the printing task is transmitted encrypted. If all candidate address pairs cannot be connected, such as due to symmetric NAT restrictions, the traversal fails. At this time, an encrypted data channel is established through the relay node in the P2P network to forward the printing task to the target printing node. The relay node is responsible for forwarding data at both ends and supports end-to-end encrypted transmission to ensure data privacy. The relay node can be fixed or dynamically selected from relays that are closer to both networks.

[0064] Furthermore, the specific functions of the management node are as follows: Figure 7 As shown: The management node maintains a database or mapping table that records the node attribute credentials (such as geographical location, organization affiliation, security level) and real-time status (current load, processing capacity, network latency, etc.) of each printing node. Nodes can report information to the management node through registration, updates, heartbeats, etc. When the initiating node sends a query request, the management node filters out compliant nodes according to the matching conditions in the policy and returns a node list based on the real-time status information. The management node can also provide a subscription mechanism so that the initiating node can know the node status changes in real time. In addition, the management node can act as a coordinating node, undertaking the functions of collecting resource quotations and making global optimization decisions.

[0065] Furthermore, the role of relay nodes is as follows: Figure 8 As shown: When two terminal nodes cannot communicate directly, the relay node acts as an intermediary for data forwarding. The relay node needs to have a public IP address and be able to accept connection requests from different private networks. It establishes two independent encrypted channels to connect to the initiating node and the target node respectively, and then forwards data between the two. To ensure security, the relay node only forwards encrypted data and cannot decrypt the content, thus achieving end-to-end encryption. The relay node can also perform traffic control and load balancing to avoid becoming a bottleneck.

[0066] It is particularly important to emphasize that the core of this invention lies in the multi-layered mechanism of trusted attribute verification, distributed resource market optimization, and stateful collaborative scheduling. Trusted attribute verification ensures that tasks comply with business rules such as security and organization and are not forgery. Distributed resource market optimization guarantees optimal global system efficiency. Stateful collaborative scheduling improves the reliability of large-scale tasks and user experience. This multi-layered decoupled design enables the system to flexibly adapt to different scenarios.

[0067] The workflow of the present invention will be described in detail below through several embodiments. In the embodiments, the technical solution of the present invention can be deployed in the manufacturing of computer components such as handheld tablet computer display devices, computer peripherals such as human-computer interaction devices and graphics and image output devices, industrial control computers and systems, cloud platforms, Internet of Things and other computer manufacturing, mobile intelligent terminals, radar and supporting equipment manufacturing, intelligent medical systems, RFID and other electronic equipment manufacturing scenarios, to realize cross-network, multi-node collaborative remote printing.

[0068] Example 1: This example uses a company's internal network as an example. The network contains multiple printer nodes that self-organize through the P2P protocol. A management node is set up to collect information. During the system initialization phase, the company's IT department deploys a lightweight attribute certificate authority service, which is integrated into the management node. Before all compliant printers in the company can join the network, they need to register their identity with this authority service. After the authority verifies the true attributes such as the physical department and security level, it issues node attribute certificates to them.

[0069] After Node A (printer) starts up, it broadcasts its node attribute credentials to the entire network. The credentials include the node ID, business attributes: geographical location = "Shanghai Branch", organizational affiliation = "Marketing Department", security level = "normal", and are signed by an authoritative private key. At the same time, Node A periodically reports its real-time status to the management node: current load = 3 pending print jobs, processing capacity = 30 pages / minute, network latency = 50ms, and physical distance approximately 500 meters.

[0070] If employee H needs to print a marketing brochure on their computer (initiating node B), and the brochure is not confidential but they want to print it nearby for easy pickup, employee H selects "any security level, Shanghai branch location" as the business execution strategy in the printing software, sets the task resource budget to be completed within 10 minutes and the cost points not exceeding 10, and initiates the printing task. The task data package contains the strategy, budget, and PDF file.

[0071] Initiating node B sends the business execution strategy to the management node for query. The management node returns a list of all printer nodes located in the Shanghai branch and their respective node attribute credentials. Node B uses a pre-set authoritative public key to verify the digital signature of each node's credentials, confirming that the attributes of nodes such as node A are genuine and valid, thus forming a preliminary set of compliant nodes, totaling 5 nodes.

[0072] Node B, acting as the coordinator, issues a task bidding request to these 5 nodes, including the task resource budget. Each node calculates its resource bid based on its real-time status: Node A has a moderate load and is the closest in physical distance, with a bid of 8 cost points; Node C has a light load but is far away, with a bid of 9 cost points; Node D has a heavy load, with a bid of 12 cost points, etc. After collecting all bids, Node B selects Node A, whose bid is within the budget and the best, as the target printing node.

[0073] Node B initiates a connection with Node A. Since both are on the same local area network, a TCP connection is established directly without NAT traversal, and the print task is transmitted via TLS encryption. After receiving the task, Node A adds it to the print queue and notifies employee H to pick it up upon completion.

[0074] Example 2: This example uses a design institute as an example. They need to print a 100-page architectural drawing, which is a huge file and needs to be completed quickly.

[0075] Multiple printer nodes in the network have broadcast node attribute credentials via DHT, such as support for A3 size and color printing. The management node also maintains the real-time status. Attribute certificate authority has been deployed during the system initialization phase, and all nodes have obtained and broadcast their credentials.

[0076] Designer M initiates a print job on node C with the business execution strategy of "supporting A3 size, color printing, and no security level restrictions" and the task resource budget of "expecting to be completed within 20 minutes, with the cost points being moderately flexible". Since the task is a large task and requires collaborative printing, the software automatically selects the collaborative mode.

[0077] Initiating node C uses the DHT to search for 10 eligible nodes according to the policy, and verifies the validity of their node attribute credentials to form a preliminary set of compliant nodes.

[0078] Node C, acting as the coordinator, issues a task bidding request to these 10 nodes, including the task resource budget and task information (100 pages, A3 color). Each node calculates its resource bid based on its real-time status (load, processing capacity, toner cost, etc.). After collecting the bids, node C uses a greedy algorithm to select the four nodes with the highest scores as target nodes, with the goal of minimizing the total cost and meeting the time constraint. For example, nodes D, E, F, and G bid 15, 16, 18, and 17 cost points respectively, with a total cost of 66 and an estimated total completion time of 15 minutes.

[0079] Node C initiates the parsing of the PDF document structure, identifying that the document contains 4 chapters, with chapter boundaries at pages 25, 50, and 75 respectively. Therefore, the 100-page drawing is logically decomposed into 4 sub-tasks: Node D prints pages 1-25 of Chapter 1, Node E prints pages 26-50 of Chapter 2, Node F prints pages 51-75 of Chapter 3, and Node G prints pages 76-100 of Chapter 4. Each sub-task is labeled with a global sequence number 1-4 and its sequential dependencies (it must be output in chapter order, but can be printed in parallel).

[0080] Initiating node C establishes a P2P multicast-based state synchronization channel for nodes D, E, F, and G to broadcast the execution status. Initiating node C establishes connections with the four nodes respectively, sends subtasks, and the four nodes begin printing in parallel, periodically broadcasting progress through the state synchronization channel, such as node D "Subtask 1 completed, page 25 completed".

[0081] During the printing process, node F detects during its self-check that the toner is running out and predicts that it will be unable to continue printing in 10 minutes. Node F proactively sends a pre-migration request and the precise status of its unfinished subtask through the status synchronization channel: "Subtask 3, page 60 completed, 15 pages remaining." After initiating node C detects the warning, it immediately selects a new target node H from the preliminary compliant node set. H has the second highest score and is currently idle. Node C sends the unfinished subtask (subtask 3, pages 61-75) and the current progress status (starting from page 61) to node H to continue printing. Node H joins the status synchronization channel and starts printing from page 61. Meanwhile, nodes D, E, and G, which have already completed their tasks, continue working.

[0082] Finally, all subtasks were completed, and nodes D, E, H, and G output chapters 1, 2, 3, and 4 respectively. Xiao Wang obtained a complete set of 100 pages of drawings, and the chapter order was correct. The proactive pre-migration mechanism ensured that the task did not fail due to a single point of failure and avoided the waste of printing from the beginning.

[0083] Example 3: This example uses a home office scenario where a user needs to print a document from a printer on a separate private network within the company.

[0084] The company printer node I is located on the company's intranet and accesses the Internet via NAT. It has been registered with the company's attribute certificate authority and obtained node attribute credentials. The home computer node J is located on the home intranet and also accesses the Internet via NAT. The NAT types on the two sides may be different.

[0085] Node J initiates a printing task with the business execution strategy of "organization affiliation = R&D department, security level = internal" and the task resource budget of "expected completion within 30 minutes". After querying through the management node and verifying the node attribute credentials, Node I meets the conditions and is selected as the target node.

[0086] Node J and Node I begin ICE traversal. Both obtain their respective public network mapping addresses through the STUN server and exchange candidate addresses. Since both may be using symmetric NAT, the direct P2P connection attempt fails.

[0087] After the penetration fails, both node J and node I connect to the pre-configured relay node K (which has a public IP address). Node J establishes a DTLS encrypted channel with relay node K, and node I also establishes a DTLS encrypted channel with relay node K. Relay node K forwards data between the two, but cannot decrypt the content.

[0088] Node J forwards the print task data to Node I through relay node K. Node I receives and prints the data. Throughout the process, end-to-end encryption ensures data security, and the printed content cannot be viewed even through a relay.

[0089] Example 4: This example illustrates how the management node maintains real-time status information. Multiple printer nodes in the network periodically (e.g., every 30 seconds) report their current load, processing capacity (e.g., available memory), network latency (the latency to the management node is used as a reference), and node attribute credential status to the management node. The management node stores this information in an in-memory database and timestamps it. When a node query is initiated, the management node not only returns nodes matching the business attributes and their verified credential information, but also includes real-time status information. If a node fails to report for a certain period of time, the management node marks it as offline and excludes it from the selection process. When the management node acts as a coordinating node, it also collects resource quotes from each node and executes a global optimization algorithm to return the optimal node allocation scheme to the initiating node. This dynamic update mechanism ensures the timeliness and global optimality of the optimization selection.

[0090] The above embodiments illustrate in detail the workflow of the present invention in different scenarios, covering trusted attribute verification, distributed resource market optimization, stateful collaborative scheduling, intelligent task decomposition, proactive pre-migration, NAT traversal and relay forwarding. The implementation details of each step have been fully disclosed. Those skilled in the art can implement the present invention based on the description in this specification. It should be noted that the parameters and algorithms can be adjusted in the specific implementation, but all of them fall within the protection scope of the present invention.

[0091] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A collaborative remote printing method based on a P2P network, characterized in that, Includes the following steps: Step S1: In the P2P network, each printing node broadcasts a node attribute certificate carrying a digital signature. The node attribute certificate contains at least business attribute information issued by a trusted attribute authority. The printing task initiating node generates a printing task, which carries a business execution strategy and a task resource budget. Step S2: The printing task initiating node verifies the authenticity and validity of the node attribute credentials of the responding node in the P2P network according to the business execution strategy, and filters out the responding nodes with compliant business attributes to form a preliminary set of compliant nodes. Step S3: Within the initial set of compliant nodes, an optimization selection process based on the distributed resource market is initiated: Each responding node submits a resource quote for executing the printing task to the printing task initiating node or the designated coordinating node based on its own real-time status information and resource costs; The printing task initiating node or the coordinating node determines one or more target printing nodes to finally execute the printing task based on the resource quote and the task resource budget, with the goal of optimizing the overall system efficiency. Step S4: If multiple target printing nodes are determined, the printing task is decomposed into multiple sub-tasks with sequential dependencies based on its document logical structure, and a state synchronization channel is established for the nodes participating in the collaboration. Then each subtask is sent to its corresponding target printing node.

2. The collaborative remote printing method based on a P2P network according to claim 1, characterized in that, It also includes step S5, which involves real-time monitoring of the execution status and resource status of each target printing node during task execution; when any target printing node actively warns or passively detects a fault through the status synchronization channel, a replacement node is dynamically selected from the preliminary compliant node set based on the unfinished sub-tasks and the sequential dependency relationship, and fault migration and status recovery are performed.

3. The collaborative remote printing method based on a P2P network according to claim 2, characterized in that, It also includes step S6, which sends the printing task or subtask to the target printing node or replacement node for execution; when the target node and the initiating node are located in different private networks, NAT traversal is attempted based on the ICE protocol family, and if the traversal fails, an end-to-end encrypted data channel is established through the relay node for transmission.

4. The collaborative remote printing method based on a P2P network according to claim 1, characterized in that, In step S2, the distributed hash table DHT is used to search for the business execution strategy as the key to obtain the print node that matches the business attribute.

5. The collaborative remote printing method based on a P2P network according to claim 1, characterized in that, If the printing task is a large task and requires collaborative printing, multiple target printing nodes are determined in step S3, and the printing task is decomposed into multiple sub-tasks before step S4. Then, each sub-task is sent to the corresponding target printing node for parallel execution.

6. The collaborative remote printing method based on a P2P network according to claim 5, characterized in that, During the parallel execution of subtasks, the execution status of each target printing node is monitored in real time. When any target printing node fails, a new target printing node is selected from the set of compliant nodes, and the unfinished subtasks are sent to the new target printing node to continue execution.

7. The collaborative remote printing method based on a P2P network according to claim 1, characterized in that, In step S4, when the target printing node and the task initiating node are located in different private networks, NAT traversal is automatically performed based on the ICE protocol family. If traversal fails, an encrypted data channel is established through a relay node in the P2P network to forward the printing task to the target printing node.

8. The collaborative remote printing method based on a P2P network according to claim 1, characterized in that, The P2P network includes a management node, which is used to collect and maintain the mapping relationship between the business attribute information and real-time status information of each printing node; In step S2, a list of print nodes matching the business attributes is obtained by querying the management node.

9. A collaborative remote printing method based on a P2P network according to claim 1, characterized in that, The P2P network includes relay nodes, which are used to forward data when printing nodes cannot communicate directly and support end-to-end encrypted transmission.

10. A collaborative remote printing system based on a P2P network, used to implement the collaborative remote printing method based on a P2P network as described in any one of claims 1 to 9, characterized in that, include: Multiple terminal nodes, acting as initiators or executors of print tasks, are used to broadcast node attribute credentials carrying digital signatures, receive print tasks, and execute printing. At least one management node is used to maintain the mapping relationship between the business attributes and real-time status information of each printing node, and to respond to query requests for business execution strategies, return a set of matching compliant nodes, or act as a coordinating node to make global optimization decisions on resource pricing. At least one relay node is used to establish a data relay channel when direct communication between terminal nodes is not possible, ensuring data transmission across networks. Each node is a self-organizing network based on the P2P protocol. Through a multi-layered mechanism of trusted attribute verification, distributed resource market optimization, and stateful collaborative scheduling, collaborative remote printing is achieved. The system is deployed in the fields of computer peripheral equipment manufacturing, as well as cloud platforms, Internet of Things, mobile smart terminals, smart medical systems, and RFID electronic equipment manufacturing.