CN117135199A - Session management method and electronic equipment - Google Patents

Session management method and electronic equipment Download PDF

Info

Publication number
CN117135199A
CN117135199A CN202310091000.6A CN202310091000A CN117135199A CN 117135199 A CN117135199 A CN 117135199A CN 202310091000 A CN202310091000 A CN 202310091000A CN 117135199 A CN117135199 A CN 117135199A
Authority
CN
China
Prior art keywords
session
type
file
physical link
bandwidth
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310091000.6A
Other languages
Chinese (zh)
Inventor
郭吉放
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310091000.6A priority Critical patent/CN117135199A/en
Publication of CN117135199A publication Critical patent/CN117135199A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/083Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability for increasing network speed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0896Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/20Traffic policing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/72Admission control; Resource allocation using reservation actions during connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application provides a session management method and electronic equipment, and relates to the technical field of communication. Under the condition that a physical link is established between the first device and the second device, the first device limits the speed of the file type session on the physical link by utilizing the number of different types of sessions on the physical link and the maximum transmission bandwidth of the physical link, so that the bandwidth of the non-file type session on the physical link can meet the operation requirement of the session, and the problems that the bandwidth of the physical link occupied by the file type session is overlarge and the non-file type session bandwidth is limited in the process of file transmission by a PC, a mobile phone and a tablet personal computer can be solved, the fluency of the non-file type session data transmission in the file transmission process is ensured, and the stability and the reliability of service operation are improved.

Description

Session management method and electronic equipment
Technical Field
The present application relates to the field of communications technologies, and in particular, to a session management method and an electronic device.
Background
When some services (such as a super mouse, a heterogeneous screen throwing service and the like) are performed between two devices, different types of sessions (sessions), such as file sessions, byte sessions, stream sessions and the like, can be established based on a physical link between the two devices. Different types of sessions may be used to transfer different types of data for the service, such as in a super mouse service, a file type session may be used to transfer files, and a streaming session may be used to transfer mouse coordinates.
Along with the increase of service types and service quantity between devices, how to improve the transmission performance of the service transmitted between devices through the session becomes a problem to be solved.
Disclosure of Invention
In view of this, the present application provides a session management method and an electronic device, which can reduce the transmission delay of a session of a non-file type, so as to ensure the normal operation of a service.
In a first aspect, the present application provides a session management method. In the case that the first device establishes a physical link with the second device, the first device acquires the session number of the sensitive type (or referred to as the first type), the session number of the non-sensitive type (or referred to as the second type) and the session number of the file type corresponding to the physical link. Wherein the sensitive type and the non-sensitive type belong to a non-file type. Wherein the non-file type indicates a type other than the file type. A file-type session may be used to transfer a file.
The first device obtains a reserved bandwidth of a session of a non-file type corresponding to the physical link by combining the session number of a non-sensitive type corresponding to the physical link based on the session number of a sensitive type corresponding to the physical link and a first preset bandwidth corresponding to the sensitive type. The first preset bandwidth may represent a minimum bandwidth for a session of a sensitive type to keep transmitting data normally. The reserved bandwidth of the session of the non-file type corresponding to the physical link represents the minimum bandwidth required to be occupied on the basis of ensuring normal transmission of all session data of the non-file type on the physical link.
The first device obtains a maximum transmission bandwidth of the physical link. Wherein the maximum transmission bandwidth of a physical link represents the maximum bandwidth that the physical link is currently capable of providing.
And the first equipment calculates the difference between the maximum transmission bandwidth of the physical link and the reserved bandwidth of the session of the non-file type corresponding to the physical link to obtain the expected total bandwidth of the sessions of all the file types corresponding to the physical link.
The first device obtains the expected bandwidth of the file type session based on the expected total bandwidth of all the file type sessions corresponding to the physical link and the number of the file type sessions corresponding to the physical link.
And the first equipment calculates the ratio of the expected total bandwidth of all the file types of the sessions corresponding to the physical link to the number of the file types of the sessions corresponding to the physical link to obtain the expected bandwidth of the file types of the sessions corresponding to the physical link.
And the first equipment obtains the speed limiting parameter of the session of the file type corresponding to the physical link based on the expected bandwidth of the session of the file type. Wherein the speed limit parameter is used for limiting the bandwidth of a file type session when transmitting the file to be less than or equal to the expected bandwidth of the file type session.
In the application, the speed limiting parameter is utilized to limit the speed of the file type session, so that the bandwidth of the non-file type session is prevented from being preempted by the file type session in the process of transmitting the file by the file type, the bandwidth of the non-file type session can be effectively ensured, especially the bandwidth of the sensitive type session is ensured, the normal data transmission of the non-file type session is enabled, the transmission time delay of the non-file type session is reduced, the stable and reliable operation of the non-file type session is ensured, and the normal operation of the service is further ensured.
Wherein the expected bandwidth of the sessions for each file type on the physical link is the same.
Illustratively, the first type includes a stream type and/or a video type; the second type includes one or more of a byte type, a command type, an audio type, and an information type.
In one possible design manner, the first device may send the data of the first service through the session of the non-file type; illustratively, the first service includes a key mouse service; the data of the first service may include a coordinate stream including coordinate values of the mouse.
And sending the file through the session of the file type.
In the application, in the mouse service (or called super mouse service), the speed limit of the file type session can ensure that the transmission delay of the data of the mouse service transmitted by the non-file type session is smaller, thereby avoiding the problems of mouse blocking and high delay.
In one possible design manner, the speed limit parameter is calculated when the first file session on the physical link meets a preset progress update condition.
Wherein the first file session is a session of any file type on the physical link; the preset progress update condition includes at least one of: the file transmission increment size corresponding to the first file session (or the increment size of the file which is described as the file corresponding to the first file session) is larger than or equal to a first preset value, the file transmission progress increment value (or the increment value which is described as the file transmission progress) is larger than or equal to a second preset value, and the progress update interval time is larger than or equal to a preset time interval; the progress update interval time indicates a difference between the current time and the time when the first device last updated the file transmission progress displayed on the first device interface.
In the application, because the number of the sessions on the physical link is changed, the accuracy of the speed limiting parameters can be ensured, namely the accuracy of the limitation of the bandwidth of the file session can be ensured by updating the speed limiting parameters once by utilizing the latest sensitive type, the non-sensitive type and the number of the sessions of the file type on the physical link where the file session is positioned under the condition that the file session meets the preset process updating condition.
In one possible design manner, in the case of establishing a new session on the physical link, if the new session type belongs to the sensitive type, the first device may add 1 to the number of sessions of the sensitive type corresponding to the physical link;
if the new session type belongs to the non-sensitive type, the first device may add 1 to the number of sessions of the non-sensitive type corresponding to the physical link.
Under the condition that a new session is established on the physical link, if the new session type belongs to the file type, the first device can add 1 to the number of sessions of the file type corresponding to the physical link;
or, if the new session first satisfies the preset progress update condition, the first device may add 1 to the number of sessions of the file type corresponding to the physical link.
In the application, for the session of the non-file type, when the session is created, 1 is added to the number of the sessions of the sensitive type or the number of the sessions of the non-sensitive type to which the type of the session belongs, so that the number of the sessions on the physical link can be updated in time.
In one possible design manner, in the case that one session on a physical link is closed, if the type of the closed session belongs to a sensitive type, the first device may reduce the number of sessions of the sensitive type corresponding to the physical link by 1;
if the type of the closed session belongs to a non-sensitive type, the first device may decrease the number of sessions of the non-sensitive type corresponding to the physical link by 1;
if the type of the closed session is a file type, the first device may decrease the number of sessions of the file type corresponding to the physical link by 1.
In the application, when the session is closed, the number of the sessions of the sensitive type, the number of the sessions of the non-sensitive type or the number of the sessions of the file type is reduced by 1, so that the number of the sessions on the physical link is updated in time.
In one possible design, the calculating process of the reserved bandwidth of the session of the non-file type corresponding to the physical link may include:
The first device may calculate a product of the number of sessions of the sensitive type corresponding to the physical link and a first preset bandwidth corresponding to the sensitive type, to obtain a reserved bandwidth of the sessions of the sensitive type on the physical link. The reserved bandwidth of the non-file type session represents the minimum bandwidth that needs to be occupied on the basis of ensuring normal transmission of data for all sensitive types of sessions on the physical link.
And under the condition that the number of the non-sensitive type session corresponding to the physical link is smaller than the first number, the first device can calculate the sum of the reserved bandwidth of the sensitive type session and the second preset bandwidth corresponding to the second type to obtain the reserved bandwidth of the non-file type session.
And under the condition that the number of the non-sensitive type session corresponding to the physical link is larger than or equal to the first number and smaller than the second number, indicating that the number of the non-sensitive type session on the physical link is larger, the first device can calculate the reserved bandwidth of the non-sensitive type session corresponding to the physical link based on the first number and the number of the non-sensitive type session.
The first device may then calculate a sum of the reserved bandwidth of the session of the sensitive type and the reserved bandwidth of the non-sensitive type to obtain the reserved bandwidth of the session of the non-file type.
And under the condition that the number of the non-sensitive type session corresponding to the physical link is greater than or equal to the second number, the number of the non-sensitive type session on the physical link is large, and the bandwidth required to be occupied by the non-sensitive type session is large, so that the first device can take the third preset bandwidth corresponding to the non-sensitive type as the reserved bandwidth of the non-sensitive type session corresponding to the physical link. Based on the method, the reserved bandwidth of the session of the non-file type can be accurately determined, so that the operation requirement of the session of the non-file type can be met for ensuring the allocated bandwidth of the non-file type.
In one possible design manner, the speed limiting parameter is a difference between the maximum transmission bandwidth of the physical link and the expected bandwidth of the file type session, so as to determine the speed limiting parameter of the file type session.
In a second aspect, the present application provides an electronic device, the electronic device being a first device, the electronic device comprising a display screen, a memory, and one or more processors; the display screen, the memory and the processor are coupled; the display screen is used for displaying images generated by the processor, and the memory is used for storing computer program codes, and the computer program codes comprise computer instructions; the computer instructions, when executed by the processor, cause the electronic device to perform the session management method of any of the first aspects described above.
In a third aspect, the present application provides a computer readable storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the session management method according to any one of the first aspects above.
In a fourth aspect, the present application provides a computer program product which, when run on an electronic device, causes the electronic device to perform the session management method according to any one of the first aspects above.
It will be appreciated that the advantages achieved by the electronic device according to the second aspect, the computer readable storage medium according to the third aspect, and the computer program product according to the fourth aspect provided above may refer to the advantages in the first aspect and any possible design manner thereof, and are not described herein.
Drawings
Fig. 1A is a schematic diagram of link connection establishment according to an embodiment of the present application;
fig. 1B is a schematic diagram of a session management flow of a super mouse according to an embodiment of the present application;
fig. 2A is a schematic interface diagram of a super mouse scenario provided in an embodiment of the present application;
fig. 2B is a second interface schematic diagram of a super mouse scenario provided in an embodiment of the present application;
Fig. 2C is a schematic interface diagram III of a super mouse scene according to an embodiment of the present application;
fig. 2D is an interface schematic diagram of a super mouse scene provided by an embodiment of the present application;
fig. 3A is a schematic hardware structure of an electronic device according to an embodiment of the present application;
FIG. 3B is a schematic diagram of communication between devices according to an embodiment of the present application;
FIG. 3C is a schematic diagram illustrating a file transfer process according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a session management method according to an embodiment of the present application;
fig. 5 is a second flow chart of a session management method according to an embodiment of the present application;
fig. 6 is a schematic diagram of a service performed between devices according to an embodiment of the present application.
Detailed Description
The terms "first" and "second" are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present embodiment, unless otherwise specified, the meaning of "plurality" is two or more.
In order to better understand the scheme of the present application, the following describes terms related to the embodiments of the present application.
Super connection: the application operation state of the user can be circulated among the devices with the same account, such as editing/browsing memorandum and mails on a mobile phone, a PAD and a personal computer (Personal Computer, PC), and can be continued to the mobile phone, the PAD and the PC with the same peripheral account to continue editing under the condition of the user requirement, so that the editing/browsing state of the original device is maintained;
heterologous screen casting: unlike homologous screen shots. And under the homologous screen-throwing scene, the display content of the screen-throwing window displayed by the local terminal equipment is the same as the display interface content of the remote terminal equipment. In the heterogeneous screen-throwing scene, the display content of the screen-throwing window displayed by the local terminal device and the display interface content of the remote terminal device can be different.
Super mouse: the input device may be shared among multiple devices. Keyboards and mice, such as personal computers (personal computer, PCs), can be used on cell phones, tablet computers, etc. The mobile phone or the tablet computer is equivalent to an extended screen of the PC, and still displays an interface of the mobile phone or the tablet computer rather than an interface of the PC.
A physical link may be established between two devices, such as peer-to-peer (P2P), wireless local area network (wireless local area networks, WLAN), etc. For example, as shown in fig. 1A, the PC establishes a P2P link with the device 1 by means of softap. As another example, as shown in fig. 1A above, the PC establishes a WLAN link by connecting the same router as the device 2. The physical link may be used to establish different types of sessions corresponding to one or more services, so as to transmit different types of data, thereby ensuring normal operation of the services between the devices.
For example, the services may include a super mouse, a heterogeneous screen, a super connection, and the like, which need to establish a session corresponding to the service by using a physical link to transmit data. The types of the session may include file, bytes, stream, command (cmd), audio (audio), video (video), information (msg), and the like.
When two devices transmit multiple services through a physical link between them, resources occupied by data of the multiple services may collide. For example, when one of the two devices transmits a message of a certain service, the message transmission of the service occupies a very large bandwidth of a physical link, so that resources occupied by sessions (such as byte sessions and streaming sessions) of other services are limited, and transmission delay of the sessions of other services is relatively large, namely data transmission delay is relatively high, normal operation of the service is affected, such as a cartoon thread occurs when a mouse moves fast on a mobile phone, or mouse movement delay is relatively large.
For example, taking the above service as a super mouse, two devices as a PC and a mobile phone, respectively, the session establishment and the file transmission process corresponding to the super mouse service are introduced. As shown in fig. 1B, when a user drags a mobile phone icon on a first interface to a tray control on the first interface, it indicates that a super mouse service is performed between a PC and the mobile phone, and a first mouse service in the PC may send a first bytes session establishment request to a first connection (link) service in the PC. As shown in fig. 2A, the first interface 100 on the PC displays an icon 101 of the PC, an icon 102 of the mobile phone, an icon 103 of the tablet computer, and a tray control 104. The mobile phone and the tablet personal computer represent equipment which is successful in networking with the PC and logs in the same account. That is, the mobile phone and the tablet computer can perform a super mouse service with the PC. When the user wants the handset to establish a super mouse service with the PC, the user can drag the icon 102 of the handset onto the tray control 104. When the icon 102 of the mobile phone is placed on the tray control 104 (as shown in fig. 2B), it indicates that a super mouse service needs to be performed between the PC and the mobile phone, and the first mouse service in the PC may send a first bytes session establishment request to a first connection (link) service in the PC.
It should be understood that the above-mentioned placement of the icon of the mobile phone in the tray control is only one possible trigger operation for triggering the super mouse service between the PC and the mobile phone, and the PC may also establish the super mouse service with the mobile phone based on other trigger operations, which is not limited by the present application.
The first connection service may then send a first bytes session establishment request to a second connection service in the handset. The second connection service establishes a first bytes session (or referred to as a first byte type session) with the PC based on a P2P link with the PC in response to the first bytes session establishment request. After the first bytes session is established successfully, the second connection service may report the first session information to the second mouse service in the handset. The first session information is used to trigger the second mouse service to start a super mouse service process. For example, the first session information may include a session ID of the first bytes session and/or a first application package name. The mobile phone stores the corresponding relation between the application package name and the service. After the second mouse service in the mobile phone obtains the first application package name, the first application package name is determined to correspond to the super mouse service based on the corresponding relation between the application package name and the service, and then the second mouse service can start the mouse service process.
It should be appreciated that after the session is established, the connection service (e.g., the second connection service described above) may report the related information (e.g., the first session information described above) of the established session to the mouse service (e.g., the second mouse service described above) by calling a callback function.
After the first bytes session is established successfully, the first connection service in the PC may report second session information to the first mouse service, where the second session information may include information such as a session ID of the first bytes session, so that the first mouse service knows that the first bytes session is established successfully. For example, after the second connection service establishes the first bytes session based on the first bytes session establishment request, response success information may be returned to the first connection service, so that the first connection service may learn that the first bytes session is established successfully.
Then, the first mouse service needs to trigger the second mouse service to start the file dragging business process. The file drag business process may be used to enable file transfer between devices. Specifically, the first mouse service may send a second bytes session establishment request to the first connection service. The first connection service may then send a second bytes session establishment request to the second connection service. The second connection service establishes a second bytes session with the PC based on the P2P link with the PC in response to the second bytes session establishment request. After the second bytes session is established successfully, the second connection service may report the third session information to the second mouse service.
The third session information may include information such as a session ID of the second bytes session, for example. The second bytes session may be used to transmit an instruction, such as a first mouse service transmitting a first instruction to a second mouse service through the second bytes session, the first instruction being used to trigger the second mouse service to initiate a file drag service process.
After the second bytes session is established successfully, the first connection service may report the fourth session information to the first mouse service. The fourth session information may include, for example, a session ID of the second bytes session.
In some embodiments, the first mouse service in the PC may start a file drag service process and a super mouse service process corresponding to the first mouse service when the user opens the first interface. The file drag service process and the super mouse service process are processes required for realizing the super mouse service. Or when the user drags the mobile phone icon on the first interface to the tray control on the first interface, the first mouse service can start the super mouse service process corresponding to the first mouse service. After the first bytes session is established successfully, the first mouse service can start a file dragging business process corresponding to the first mouse service. The super mouse service process and the file drag service process can be used for realizing super mouse service.
When the user moves the mouse to pass through, it indicates that the mouse will reach the mobile phone, and the first mouse service may send a streaming session establishment request to the first connection service. Thereafter, the first connection service may send a streaming session establishment request to the second connection service. The second connection service establishes a streaming session (or a session called a streaming type) with the PC based on the above-described P2P link in response to the streaming session establishment request. The streaming session is used to transfer the coordinates of the mouse. After the streaming session is established successfully, the second connection service may report the fifth session information to the second mouse service. The fifth session information may include a session ID of the streaming session, for example. For example, as shown in FIG. 2C, when the mouse 105 reaches the side edge of the cell phone, a mouse traversal is indicated.
After the streaming session is established successfully, the first connection service may report the sixth session information to the first mouse service. Illustratively, the sixth session information may include a session ID of the streaming session, etc. Therefore, when the mouse moves on the mobile phone, the first mouse service can send the coordinate information of the mouse to the second mouse service based on the streaming session, so that the mobile phone can update the position of the mouse on the mobile phone interface based on the coordinate information of the mouse.
When the user drags the file on the PC to the mobile phone, the first mouse service may send the coordinate stream to the second mouse service based on the streaming session. The coordinate stream includes coordinates of the mouse. Specifically, the first mouse service may first send the coordinate stream to the first connection service. The first connection service sends the coordinate stream to the second connection service. The second connection service then reports the coordinate stream to a second mouse service.
After the second mouse service receives the coordinate stream, the position of the mouse on the mobile phone interface can be updated according to the coordinate stream.
When the user drags the file on the PC to the mobile phone and releases the mouse, the file is indicated to be transmitted to the mobile phone, and the second mouse service can send a second instruction to the first mouse service based on the second bytes session, and the second instruction is used for triggering the PC to transmit the file. Specifically, the second mouse service may first send the second instruction to the second connection service. The second connection service sends the second instruction to the first connection service. Then, the first connection service reports the second instruction to the first mouse service.
After receiving the second instruction, the first mouse service may send a file session establishment request to the first connection service. Thereafter, the first connection service may send a file session establishment request to the second connection service. The second connection service establishes a file type session (or referred to as a file session) with the PC based on the above-described P2P link in response to the file session establishment request. The file type session may be used to transfer a file.
After the file session is established successfully, the second connection service may report the seventh session information to the second mouse service. Illustratively, the seventh session information may include a session ID of the file type session.
After the file session is established successfully, the first connection service may report the eighth session information to the first mouse service. Illustratively, the eighth session information may include a session ID of the streaming session, etc.
Thereafter, the first mouse service may send the target file (i.e., the file dragged by the user) to the second mouse service using the file session. Specifically, the first mouse service may send the target file to the first connection service. The first connection service may send the target file to the second connection service.
When the file transmission is successful, the second connection service may report the file transmission success information to the second mouse service. After the file is successfully transmitted, the first connection service may report the file transmission success information to the first mouse service.
As shown in fig. 1B, the first connection service may transmit the file transmission progress to the first mouse service during the file transmission. The file transmission progress indicates the progress of the PC transmitting the file, such as 40% having been transmitted. After the first mouse service obtains the file sending progress, the file sending progress can be displayed on the second interface. A progress bar 111 is displayed on the second interface 110 shown in fig. 2D, and the second mouse service may update the progress bar to display the current file transmission progress, so that the user may intuitively know the file transmission condition.
In addition, as shown in fig. 1B, the second connection service may also send the receiving progress to the second mouse service during the file transfer. The file reception progress indicates the progress of the mobile phone to receive the file, such as 20% of the file has been received. After the second mouse service obtains the file receiving progress, the file receiving progress can be displayed on a mobile phone interface, or prompt information in file transmission can be directly displayed, so that a user can know the file transmission condition from the mobile phone.
The number of the target files may be one or more, that is, one or more files may be transmitted simultaneously. When the number of the target files is a plurality of, the file receiving progress represents the total progress of the mobile phone for receiving all the target files. The file transmission progress represents the total progress of the PC transmitting all the target files.
From the above, it can be seen that when the PC and the handset perform the super mouse service, different types of sessions (such as bytes session, file type session, streaming session, etc.) can be established based on the physical link (such as the P2P link) between the PC and the handset. In the process of transmitting files based on file type sessions, the PC and the mobile phone occupy large bandwidth of a physical link, so that the bandwidth occupied by non-file type sessions (i.e. sessions except file type sessions) is limited, thereby affecting data transmission of the non-file type sessions and further affecting normal operation of a service. As shown in fig. 1B, in the process of file transmission, the user moves the mouse on the mobile phone, and the first mouse service in the PC needs to send a coordinate stream (i.e., the coordinate information of the mouse) to the first mouse service in the mobile phone based on the streaming session on the P2P link, so that the mobile phone updates the position of the mouse displayed by the mobile phone. However, since the bandwidth of the P2P link occupied by the file type session is very large, the bandwidth occupied by the streaming session is affected, so that the transmission delay of the coordinate stream is increased, and the problems of mouse movement blocking and high delay on the mobile phone occur.
Aiming at the problems, considering the influence among different types of sessions on a physical link, in the embodiment of the application, the electronic equipment can limit the speed of the preset type of session so as to improve the transmission performance of the other types of session. Taking a preset type of session as an example, the electronic device limits the speed of the file type of session to ensure that the data transmission of the non-file type of session is normally performed. And considering that the sessions such as streaming sessions, video sessions and the like in the sessions of non-file types have higher requirements on network transmission bandwidth due to the characteristic of high-frequency data transmission, namely higher sensitivity to bandwidth, therefore, enough bandwidth needs to be allocated for each session with higher sensitivity to bandwidth on a physical link. In order to accurately limit the speed of the file type session so as to ensure that the bandwidth of the sensitive type session can meet the use requirement, after the first device and the second device establish a physical link, the number of the sensitive type session and the number of the non-sensitive type session corresponding to the physical link can be obtained. Wherein both sensitive type sessions and non-sensitive type sessions belong to non-file type sessions. A sensitive type of session indicates that it is desirable to transmit a session with a delay less than a preset delay, or with a bandwidth occupied greater than or equal to a preset bandwidth. The non-sensitive type is a type other than the sensitive type among the non-file types.
The first device may determine, based on the number of sessions of the sensitive type and a first preset bandwidth corresponding to the sensitive type, a reserved bandwidth of the session of the non-file type in combination with the number of sessions of the non-sensitive type, where the reserved bandwidth is a bandwidth that may be used to ensure that the session of the non-file type can normally perform data transmission. And then, the first device can calculate the difference between the maximum transmission bandwidth of the physical link and the reserved bandwidth to obtain the expected total bandwidth of all the file type sessions corresponding to the physical link, wherein the expected total bandwidth represents the bandwidth which can be allocated to all the file type sessions on the physical link on the basis of ensuring that the non-file type sessions on the physical link normally transmit data.
The first device may then calculate the desired total bandwidth and the number of sessions of the file type on the physical link, resulting in a desired bandwidth for each of the file types of sessions on the physical link. The first device can determine the speed limit parameter of the file type session on the physical link based on the expected bandwidth of the file type session, so as to limit the speed of the file type session by using the speed limit parameter, so that the bandwidth of the non-file type session is prevented from being preempted by the file type session in the process of transmitting the file by the file type, the bandwidth of the non-file type session can be effectively ensured, particularly the bandwidth of the sensitive type session is ensured, normal data transmission of the non-file type session is ensured, stable and reliable operation of the non-file type session is ensured, and further normal operation of a service is ensured.
For example, the first device/second device in the embodiments of the present application may be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook, an ultra-mobile personal computer (UMPC), a netbook, a wearable device, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR) \virtual reality (VR) device, or the like, which supports physical link electronic devices, and the embodiments of the present application do not limit the specific form of the electronic device.
By way of example, fig. 3A shows a schematic structural diagram of an electronic device 200. As shown in fig. 3A, the electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (universal serial bus, USB) interface 230, a charge management module 211, a power management module 212, a battery 213, an antenna 1, an antenna 2, a mobile communication module 240, a wireless communication module 250, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, keys 290, a motor 291, an indicator 292, a camera 293, a display 294, a user identification module (subscriber identification module, SIM) card interface 295, and the like.
It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 200. In other embodiments of the application, electronic device 200 may include more or fewer components than shown, or certain components may be combined, or certain components may be separated, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 210 may include one or more processing units such as, for example: the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 200, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may hold instructions or data that the processor 210 has just used or recycled. If the processor 210 needs to reuse the instruction or data, it may be called directly from the memory. Repeated accesses are avoided and the latency of the processor 210 is reduced, thereby improving the efficiency of the system.
In some embodiments, processor 210 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the connection relationship between the modules illustrated in the embodiment of the present application is only illustrative, and does not limit the structure of the electronic device 200. In other embodiments of the present application, the electronic device 200 may also employ different interfacing manners, or a combination of interfacing manners, as in the above embodiments.
The charge management module 211 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 211 may receive a charging input of a wired charger through the USB interface 230. In some wireless charging embodiments, the charging management module 211 may receive wireless charging input through a wireless charging coil of the electronic device 200. The charging management module 211 may also supply power to the electronic device through the power management module 212 while charging the battery 213.
The wireless communication function of the electronic device 200 can be implemented by the antenna 1, the antenna 2, the mobile communication module 240, the wireless communication module 250, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 200 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 240 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied on the electronic device 200. The mobile communication module 240 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 240 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 240 may amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate the electromagnetic waves. In some embodiments, at least some of the functional modules of the mobile communication module 240 may be disposed in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 240 may be disposed in the same device as at least some of the modules of the processor 210.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 270A, receiver 270B, etc.), or displays images or video through display screen 294. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 240 or other functional module, independent of the processor 210.
The wireless communication module 250 may provide solutions for wireless communication including WLAN (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied on the electronic device 200. The wireless communication module 250 may be one or more devices that integrate at least one communication processing module. The wireless communication module 250 receives electromagnetic waves via the antenna 2, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 210. The wireless communication module 250 may also receive a signal to be transmitted from the processor 210, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
The electronic device 200 implements display functions through a GPU, a display screen 294, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or change display information.
A display screen (or screen) 294 is used to display images, videos, and the like. The display 294 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 200 may include 1 or N display screens 294, N being a positive integer greater than 1.
The electronic device 200 may implement a photographing function through an ISP, a camera 293, a video codec, a GPU, a display 294, an application processor, and the like.
The external memory interface 220 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 200.
Internal memory 221 may be used to store computer executable program code that includes instructions. The processor 210 executes various functional applications of the electronic device 200 and data processing by executing instructions stored in the internal memory 221. The internal memory 221 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 200 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 221 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The electronic device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an ear-headphone interface 270D, an application processor, and the like. Such as music playing, recording, etc.
Keys 290 include a power on key, a volume key, etc. The keys 290 may be mechanical keys. Or may be a touch key.
The indicator 292 may be an indicator light, which may be used to indicate a state of charge, a change in power, a message indicating a missed call, a notification, etc.
The sensor module 280 may include a pressure sensor, a gyroscope sensor, a barometric sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
In some embodiments, the software system of the electronic device 200 may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. The software system of the electronic device 200 may include a business-corresponding service, a connection (link) service. The service corresponding to the service may include a service corresponding to a super connection service (or referred to as a super connection service), a service corresponding to a super mouse service (or referred to as a super mouse service), a service corresponding to a heterogeneous screen-throwing service (or referred to as a heterogeneous screen-throwing service), and other services corresponding to a super terminal service.
By way of example, the connection service may include a connection service client and a connection service. When a service (such as a super mouse service) is carried out between two electronic devices, the link establishment and the session establishment between the two electronic devices can be realized through the connection service client and the connection service server in the respective devices, so that the data transmission of the service can be realized based on the session between the devices. As shown in fig. 3B, when a service a is performed between the first device and the second device, the service a in the first device may trigger the connection service server in the first device to establish a physical link (such as a P2P link, a WlAN link, etc.) with the connection service server in the second device by calling an associated application programming interface (application programming interface, API) provided by the connection service client.
The service a in the first device may also trigger the connection service client to directly connect with the connection service client corresponding to the service a in the second device by calling a related API interface provided by the corresponding service client, for example, to establish a file session, where the file session may be used to transfer a file. Similarly, the service B and the service C in the first device may also establish corresponding services with the service B and the service C in the second device through a connection service (such as a connection service client and a connection service server) in the first device.
Illustratively, as shown in fig. 3B, the connection service client and the connection service server may communicate by means of inter-process communication (inter-process communication, IPC).
It should be understood that the above-mentioned first device, the service in the second device, the correspondence between the service and the connection service client, and the links such as the P2P link and the WLAN link established between the devices shown in fig. 3B are only examples, and the present application is not limited thereto.
In some embodiments, as shown in FIG. 3C, the connection service client may include a file channel, a very simple protocol (or referred to as a dfile module). The connection service server may include a session management module (channelListenerMgr).
As shown in fig. 3C, in the process that the service a in the first device and the service B in the second device transmit files based on the file type session, the file channel may execute step a and report the file transmission progress corresponding to the file session to the service a. And step b may be performed, where the speed limit parameter update trigger information is sent to the session management module in the case of sending the file transmission progress, where the speed limit parameter update trigger information is used to trigger the session management module to calculate the speed limit parameter of the file type session. After obtaining the speed limit parameter of the file type session, the session management module may execute step c, and send the speed limit parameter of the file type session to the very simple protocol, so that the very simple protocol limits the bandwidth (or called transmission speed) of the file type session according to the speed limit parameter of the file type session.
In some embodiments, when the file channel reports the file transmission progress corresponding to the file session to the service a for the first time, the file channel may further trigger the session management module to add 1 to the number of sessions of the file type corresponding to the physical link where the file session is located.
The application provides a session management method. The method can limit the speed of the file type session based on the number of the non-file type session (such as the number of the sensitive type session and the number of the non-sensitive type session) on the physical link, thereby avoiding the limitation of the bandwidth of the non-file type session and ensuring the stability of the data transmission of the non-file type session. The method provided by the application can be applied to any scene in which a physical link between devices is required to be used for establishing a file type session for transmitting files, such as super connection, heterogeneous screen projection, super keyboard and mouse, etc., in which the physical link is required to be used for establishing the file type session. The session management method provided by the embodiment of the application will be described in detail below with reference to the accompanying drawings. As shown in fig. 4, the method may include steps S301-S307.
S301, under the condition that a physical link is established between a first device and a second device, the first device acquires the session number of sensitive types, the session number of non-sensitive types and the session number of file types corresponding to the physical link. Wherein the sensitive type and the non-sensitive type belong to a non-file type.
Wherein the non-file type indicates a type other than the file type. A file-type session may be used to transfer a file. For example, the first device is a PC, the second device is a mobile phone, and when the PC and the mobile phone perform a super mouse service, when a user drags a file on the PC to the mobile phone, the PC can transmit the file through a file session between the PC and the mobile phone.
Wherein the non-file types include a sensitive type (or referred to as a first type) and a non-sensitive type (or referred to as a second type). The sensitive type indicates a session type in which a transmission delay is expected to be less than a preset delay. That is, sensitive types of sessions are relatively sensitive to bandwidth (or described as requiring relatively high requirements). In short, when the bandwidth occupied by a session of a sensitive type is relatively small, the data transmission of the session of the sensitive type is affected, thereby affecting the normal operation of the service.
The non-sensitive type indicates a type other than a session of the sensitive type among the non-file types. The non-sensitive type indicates a session of a type in which a transmission delay may be greater than a preset delay. That is, a non-sensitive type of session is not sensitive to bandwidth (or described as requiring less). In short, when the bandwidth occupied by the session of the non-sensitive type is relatively small, the session of the non-sensitive type can normally transmit data without affecting the operation of the service.
Wherein the number of sensitive types of sessions corresponding to a physical link indicates the number of all sensitive types of sessions on the physical link. The number of non-sensitive types of sessions corresponding to a physical link indicates the number of all non-sensitive types of sessions on the physical link. The number of sessions of a file type corresponding to a physical link represents the number of sessions of all file types on the physical link.
By way of example, the sensitive types may include streaming, video, and the like. The non-sensitive types may include types of commands, audio, bytes, information, and so forth.
In the embodiment of the application, under the condition that the first device and the second device are in a physical link, the first device can update the speed limiting parameters of the file type session on the physical link by utilizing the number of all sensitive type sessions, the number of all non-sensitive type sessions and the number of all file type sessions on the physical link, so that the first device can limit the bandwidth of the file type session on the physical link by utilizing the speed limiting parameters, and the bandwidth of the non-file type session on the physical link can meet the requirements of the first device, thereby ensuring that the non-file type session can run stably and reliably.
In some embodiments, the first device may periodically obtain, under a condition that a physical link is established between the first device and the second device, a number of sessions of a sensitive type, a number of sessions of a non-sensitive type, and a number of sessions of a file type corresponding to a target physical link where the first file session is located, so as to update the speed limit parameter, and implement periodic update of the speed limit parameter.
In some embodiments, the first device may obtain, when a first file session of the first device meets a preset progress update condition, a number of sessions of a sensitive type, a number of sessions of a non-sensitive type, and a number of sessions of a file type corresponding to a target physical link where the first file session is located, so as to update a speed limit parameter.
Wherein the first file session is a session of traffic established based on a target physical link between the first device and the second device. The first file session may be a session of any one or more file types on the target physical link. The target physical link represents a physical link on which the first file session is located. The physical link may include a WLAN, P2P, etc. type of link.
In the embodiment of the application, under the condition that the first device determines that the first file session between the first device and the second device meets the preset progress updating condition, namely under the condition that the first device needs to update the transmission progress of the file transmitted by the first file session, the first device acquires the number of the sensitive type session, the number of the non-sensitive type session and the number of the file type session corresponding to the target physical link where the first file session is located so as to update the speed limiting parameter, so that the first device can limit the bandwidths of all the file types of the sessions on the target physical link by using the speed limiting parameter, and ensure the stable and reliable operation of the non-file type session on the target physical link. Because the number of the sessions on the physical link is changed, the accuracy of the speed limit parameter can be ensured by updating the speed limit parameter once by utilizing the latest sensitive type, the non-sensitive type and the number of the sessions of the file type on the physical link where the file session is located under the condition that the file session meets the preset process updating condition, namely the accuracy of the limitation of the bandwidth of the file session can be ensured.
For example, the preset progress update condition may include at least one of: the file transmission increment size corresponding to the first file session is larger than or equal to a first preset value, the file transmission progress increment value corresponding to the first file session is larger than or equal to a second preset value, and the progress update interval time corresponding to the first file session is larger than or equal to a preset time interval. The schedule update interval time indicates a difference between the current time and a time when the first device last updated a file transmission schedule (abbreviated as a last updated file transmission schedule) corresponding to the first file session displayed by the first device. The file transmission progress corresponding to the first file session indicates the transmitted progress of the file transmitted by the first file session.
The file transfer increment size corresponding to the first file session represents a difference between the transferred size of the file transferred by the first file session and the transferred size of the file when the file transfer progress is updated last time. The file transmission progress increment value corresponding to the last first file session represents a difference between the transmitted progress of the file transmitted by the first file session and the transmitted progress of the file when the file transmission progress is updated last time.
Taking the example that the above preset progress update condition includes that the file transmission increase size is greater than or equal to a first preset value, the first device may update the speed limit parameter when the file transmission increase size corresponding to the session of the file type is greater than or equal to the first preset value. For example, the first preset value is 20M, and in the process of transmitting the file 1 based on the session of the file type, if the file transmission increment size corresponding to the session of the file type is greater than or equal to 20M, the first device may update the speed limit parameter. In short, the first device may update the speed limit parameter once every 20M of the file is transferred during the file type-based session transfer.
Taking an example that the preset progress updating condition includes that the file transmission progress increasing value is greater than or equal to a second preset value, in the process of transmitting the file based on the session of the file type, the first device updates the file speed limiting parameter under the condition that the file transmission progress increasing value corresponding to the session of the file type is greater than or equal to the second preset value. For example, the second preset value is 1%. In the process of transmitting the file based on the session of the file type, if the file transmission progress increment value corresponding to the session of the file type is greater than or equal to 1%, the first device can update the speed limit parameter. In short, the first device may update the speed limit parameter once every 1% of the file is transferred during the file type-based session transfer.
Taking an example that the preset progress update condition includes that the progress update interval time is greater than or equal to a preset time interval, in the process of transmitting the file based on the session of the file type, the first device performs one-time update of the speed limit parameter when the progress update interval time corresponding to the session of the file type is greater than or equal to the preset time interval. For example, the preset time interval is 1s, and in the process of transmitting the file based on the session of the file type, the first device may update the speed limit parameter corresponding to the session of the file type when the progress update interval time corresponding to the session of the file type is greater than or equal to 1 s. In short, the first device may update the speed limit parameter once every 1s of transmission in the process of transmitting the file based on the session of the file type.
Taking the example that the preset progress updating condition includes that the increased value of the file transmission progress is greater than or equal to a second preset value and the time of the progress updating interval is greater than or equal to a preset time interval, in the process of transmitting the file based on the session of the file type, the first device updates the speed limiting parameter corresponding to the session of the file type when the increased value of the file transmission progress corresponding to the session of the file type is greater than or equal to the second preset value and the time of the progress updating interval is greater than or equal to the preset time interval.
Taking the example that the preset progress updating condition includes that the file transmission increase size is greater than or equal to a first preset value and the progress updating interval time is greater than or equal to a preset time interval, the first device updates the speed limit parameter corresponding to the session of the file type when the file transmission increase size corresponding to the session of the file type is greater than or equal to the first preset value and the progress updating interval time is greater than or equal to the preset time interval in the process of transmitting the file based on the session of the file type.
Taking the example that the above preset progress updating condition includes that the file transmission increase size is greater than or equal to a first preset value and the file transmission progress increase value is greater than or equal to a second preset value, the first device updates the speed limit parameter corresponding to the session of the file type when the file transmission increase size corresponding to the session of the file type is greater than or equal to the first preset value and the file transmission progress increase value is greater than or equal to the second preset value in the process of transmitting the file based on the session of the file type.
Taking the example that the preset progress updating condition includes that the file transmission increasing size is greater than or equal to a first preset value, the file transmission progress increasing value is greater than or equal to a second preset value, and the progress updating interval time is greater than or equal to a preset time interval, the first device updates the speed limit parameter corresponding to the session of the file type when the file transmission increasing size corresponding to the session of the file type is greater than or equal to the first preset value, the file transmission progress increasing value is greater than or equal to the second preset value, and the progress updating interval time is greater than or equal to the preset time interval in the process of transmitting the file based on the session of the file type.
In some embodiments, the file transfer schedule may include a file transmission schedule and a file reception schedule. For example, the first device may send a file on the first device to the second device based on a session of a file type between the first device and the second device, and the file transmission progress determined by the first device may be a file sending progress. For another example, the second device may send the file on the second device to the first device based on a session of a file type between the second device and the first device, and the file transmission progress determined by the first device may be a file reception progress.
In some embodiments, in a case where the first file session of the first device meets the preset progress update condition, the first device may update the file transmission progress displayed by the first device based on the current file transmission progress corresponding to the first file session. The current file transmission progress corresponding to the first file session indicates the transmission progress of the file transmitted by the first file session, so that a user can intuitively know the file transmission condition. For example, the first file session is used for the first device to send the file 1 to the second device, where the current file transmission progress corresponding to the first file session is 60%, so that the first device may update the prompt information of the file transmission progress corresponding to the file 1 displayed by the first device to 60%, and the first device may also update the displayed progress bar.
In some embodiments, a session of one file type may transfer one or more files simultaneously. For example, in a super mouse service, a user selects multiple files on a first device at a time, and the first device may transmit the multiple files simultaneously based on a session of one file type. When a plurality of files are simultaneously transmitted by a file-type session, the file transmission progress represents the total transmission progress of the plurality of files. The file transfer progress increment value represents a total transfer progress increment value of a plurality of files.
The type of physical link established between the first device and the second device may be one or more, for example. When the types of the physical links are multiple, for each type of physical link, the first device can update the speed limiting parameters of the file type session on the type of physical link by using the number of all sensitive type sessions, the number of all non-sensitive type sessions and the number of all file type sessions on the type of physical link, so that the limitation of the bandwidth of the file session on each type of physical link can be realized, and the normal operation of the sessions of the business on different types of physical links is ensured.
In some embodiments, after a session is created or closed between a first device and a second device, the first device needs to update the number of sessions of the corresponding type on the physical link on which the session is located. The following describes how the first device updates the session of the corresponding type on the physical link where the session is located after the session is created between the first device and the second device.
For example, after one of the first device and the second device creates a session with the other device based on the physical link between the first device and the second device, that is, in a case where a new session is established on the physical link between the first device and the second device, the first device may determine the type of the physical link and the type of the new session.
In the case that the new session type belongs to a preset sensitive type, the first device may add 1 to the number of sessions of the sensitive type corresponding to the type of the physical link. Wherein the number of sensitive type sessions corresponding to the type of physical link indicates the number of all sensitive types of sessions on the type of physical link. For example, the physical link between the first device and the second device is a WLAN link. There are 2 streaming sessions and 1 video session on the WLAN link, then the number of sessions for all the sensitive types present on the WLAN link is 3. The first device establishes a new streaming session based on the WLAN link, the streaming session belongs to a sensitive type session, and the first device may increase the number of sensitive type sessions corresponding to the WLAN by 1.
In the case that the new session type belongs to a non-sensitive type, the first device may add 1 to the number of sessions of the non-sensitive type corresponding to the physical link type. For example, the physical link between the first device and the second device is a WLAN link. There is a 1 byte session on the WLAN link, then the number of sessions of all non-sensitive types on the WLAN link is 1. The first device establishes a new byte session based on the WLAN link, the byte session belongs to a non-sensitive type session, and the first device may increase the number of non-sensitive type sessions corresponding to the WLAN by 1.
In the case that the new session type is a file type, the first device may add 1 to the number of sessions of the file type corresponding to the type of the physical link. For example, the physical link between the first device and the second device is a WLAN link. There are 2 file type sessions on the WLAN link, then the number of sessions for all file types on the WLAN link is 2. The first device establishes a new file type session based on the WLAN link, and the first device may increase the number of file type sessions corresponding to the WLAN by 1.
In some embodiments, after creating a new file type session based on a physical link between the first device and the second device, the first device may add 1 to the number of sessions of the file type corresponding to the physical connection if the file type session first satisfies a preset progress update condition. For example, the first device may increase the number of sessions of the file type corresponding to the type of the physical link by 1, so that the number of sessions of the file type is updated when it is determined that a new session of the file type is transmitting a file. Rather than adding 1 to the number of sessions of the file type corresponding to the type of the physical link after creating the session of the file type. If the file type session is added by 1 after the file type session is established, the number of file type sessions becomes large, and the file type session may not have been transferred yet.
In determining the speed limit parameter corresponding to the physical link, the number of sessions of all file types on the physical link needs to be used to determine the bandwidth required to be allocated for each session of the file types. The bandwidth allocated for each file type session is the same. For file-type sessions that do not transmit files, their bandwidth requirements are actually small, and the allocated bandwidth has far exceeded its bandwidth requirements, and no allocated bandwidth resources are necessary. Since the bandwidth of the physical link is limited, the more the number of file type sessions on the physical link, the less bandwidth is allocated per file type session. When the number of sessions of the file type includes the number of sessions of the file type of the untransmitted file, the untransmitted sessions occupy the same bandwidth as the files of the other transmitted files, so that the bandwidth that the sessions of the file type of the other transmitted files can be allocated in practice becomes smaller. Therefore, under the condition that the file type session meets the preset progress updating condition for the first time, the first device updates the number of the file type sessions on the physical link where the file type session is located, so that the number of the file type sessions which actually transmit the file when determining the number of the file type sessions utilized by the speed limiting parameters can be ensured, the accuracy of calculation of the speed limiting parameters is ensured, the accuracy of the allocated bandwidth of the file type sessions is ensured, the bandwidth can be allocated to the file type sessions to the greatest extent on the basis of ensuring the bandwidth of the non-file type sessions, and the efficiency of file transmission is improved.
It will be appreciated that the physical link between the devices may be used to establish a session of one or more services. For example, one device may establish a session of a super mouse service, as well as a session of a super junction service, based on a physical link between it and another device. Typically, the number of file type sessions in a session of one service is 1. Of course, the number of file type sessions of one service may be plural, and the present application is not limited thereto.
The procedure is described above in which the first device updates a session of the corresponding type on the physical link on which the session is located in case a new session is established on the physical link between the devices. The procedure of how the first device updates the session of the corresponding type on the physical link on which the session is located after the session between the first device and the second device is closed will be described further below.
For example, after one session on a physical link between devices is closed, the first device may decrease the number of session types corresponding to the type of the physical link by 1. Specifically, after one of the first device and the second device closes a session with the other device based on a physical link between the first device and the second device, that is, in a case where one session on the physical link between the first device and the second device is closed, if the type of the closed session belongs to a sensitive type, the first device may reduce the number of sessions of the sensitive type on the physical link by 1;
If the type of the closed session belongs to a non-sensitive type, the first device may decrease the number of sessions of the non-sensitive type corresponding to the physical link by 1.
If the type of the closed session is a file type, the first device may decrease the number of sessions of the file type corresponding to the physical link by 1.
In some embodiments, in the event that one session on a physical link between a first device and the second device is closed, the first device may determine the type of the physical link and the type of the closed session.
In the case that the type of the closed session belongs to a preset sensitive type, the first device may decrease the number of sessions of the sensitive type corresponding to the type of the physical link by 1. For example, the physical link between the first device and the second device is a WLAN link. There are 2 streaming sessions and 1 video session on the WLAN link, then the number of sessions for all the sensitive types present on the WLAN link is 3. After the first device closes one streaming session on the WLAN link, the streaming session belongs to a sensitive type session, and the first device may reduce the number of sensitive type sessions corresponding to the WLAN by 1.
In the case that the type of the closed session belongs to a non-sensitive type, the first device may decrease the number of sessions of the non-sensitive type corresponding to the type of the physical link by 1. For example, the physical link between the first device and the second device is a WLAN link. There is a 1 byte session on the WLAN link, then the number of sessions of all non-sensitive types present on the WLAN link is 1. After the first device closes one byte session on the WLAN link, the byte session belongs to a non-sensitive type session, and the first device may decrease the number of non-sensitive type sessions corresponding to the WLAN by 1.
In the case that the type of the closed session is a file type, the first device may decrease the number of sessions of the file type corresponding to the type of the physical link by 1. For example, the physical link between the first device and the second device is a WLAN link. There are 2 file type sessions on the WLAN link, and then the number of sessions for all file types present on the WLAN link is 2. After the first device closes a session of a file type on the WLAN link, the first device may decrease the number of sessions of the file type corresponding to the WLAN by 1.
For example, after the service corresponding to the session between the first device and the second device is ended, the first device or the second device may close the session of the service on the physical link where the session is located. Of course, the session may be closed in other situations. For example, in the event that a file transfer over a file session is terminated, the first device or the second device may close the file session. The file transfer termination indicates that the file transfer was successful or that the file transfer failed.
S302, the first device obtains a reserved bandwidth of a session of a non-file type corresponding to the physical link by combining the session number of a non-sensitive type corresponding to the physical link based on the session number of a sensitive type corresponding to the physical link and a first preset bandwidth corresponding to the sensitive type.
For example, the first preset bandwidth may represent a minimum bandwidth for a session of the sensitive type (or referred to as the first type) to keep transmitting data normally, that is, represent a minimum bandwidth that needs to be occupied by a session of the sensitive type having a transmission delay less than the preset delay. The reserved bandwidth of the session of the non-file type corresponding to the physical link represents the bandwidth required to be occupied on the basis of ensuring normal transmission of all session data of the non-file type on the physical link.
In some embodiments, the implementation procedure of S302 may include: the first device may calculate a product of the number of sessions of the sensitive type corresponding to the physical link and a first preset bandwidth corresponding to the sensitive type, to obtain a reserved bandwidth of the sessions of the sensitive type on the physical link. The reserved bandwidth of the non-file type session represents the minimum bandwidth that needs to be occupied on the basis of ensuring normal transmission of data for all sensitive types of sessions on the physical link.
And under the condition that the number of the non-sensitive type session corresponding to the physical link is smaller than the first number, the first device can calculate the sum of the reserved bandwidth of the sensitive type session and the second preset bandwidth corresponding to the second type to obtain the reserved bandwidth of the non-file type session.
The second preset bandwidth corresponding to the non-sensitive type represents the minimum bandwidth required to be occupied on the basis of ensuring normal data transmission of all the non-sensitive type conversations on the physical link under the condition that the number of the non-sensitive type conversations corresponding to the physical link is smaller than the first number. The second preset bandwidth corresponding to the non-sensitive type is equivalent to the reserved bandwidth of the session of the non-sensitive type corresponding to the physical link.
And under the condition that the number of the non-sensitive type session corresponding to the physical link is larger than or equal to the first number and smaller than the second number, indicating that the number of the non-sensitive type session on the physical link is larger, the first device can calculate the reserved bandwidth of the non-sensitive type session corresponding to the physical link based on the first number and the number of the non-sensitive type session.
The first device may then calculate a sum of the reserved bandwidth of the session of the sensitive type and the reserved bandwidth of the non-sensitive type to obtain the reserved bandwidth of the session of the non-file type.
And under the condition that the number of the non-sensitive type session corresponding to the physical link is greater than or equal to the second number, the number of the non-sensitive type session on the physical link is large, and the bandwidth required to be occupied by the non-sensitive type session is large, so that the first device can take the third preset bandwidth corresponding to the non-sensitive type as the reserved bandwidth of the non-sensitive type session corresponding to the physical link.
Wherein the third preset bandwidth may represent an upper limit of bandwidth that can be occupied by all non-sensitive types of sessions on the guaranteed physical link.
And the first equipment calculates the sum of a third preset bandwidth corresponding to the non-sensitive type and the reserved bandwidth of the sensitive type to obtain the reserved bandwidth of the session of the non-file type.
A formula for calculating the reserved bandwidth of the session of the non-file type will be described below taking the first number of 10, the second number of 20, the first preset bandwidth of 5, and the second preset bandwidth of 5 as an example. The formula may be
Where f (n, m) represents the reserved bandwidth of the session of the non-file type corresponding to the physical link. n represents the number of sessions of the sensitive type to which the physical link corresponds. m represents the number of non-sensitive types of sessions corresponding to the physical link.
S303, the first device acquires the maximum transmission bandwidth of the physical link.
Illustratively, the maximum transmission bandwidth of a physical link represents the maximum bandwidth that the physical link is currently capable of providing.
S304, the first device calculates the difference between the maximum transmission bandwidth of the physical link and the reserved bandwidth of the session of the non-file type corresponding to the physical link, and obtains the expected total bandwidth of the sessions of all the file types corresponding to the physical link.
S305, the first device obtains the expected bandwidth of the file type session based on the expected total bandwidth of all the file type sessions corresponding to the physical link and the number of the file type sessions corresponding to the physical link.
The first device calculates a ratio of a total expected bandwidth of sessions of all file types corresponding to the physical link to a number of sessions of the file type corresponding to the physical link, to obtain an expected bandwidth of a session of the file type corresponding to the physical link.
In the case where the maximum transmission bandwidth of the physical link is greater than the reserved bandwidth of the corresponding session of the non-file type, the first device may indicate that the bandwidth of the physical link is available for occupation by the file session
The expected bandwidth of the session of the file type corresponding to the physical link is calculated. Wherein, file e Representing the desired bandwidth of the file type session. K represents the number of sessions of the file type corresponding to the physical link. TransRate represents the maximum transmission bandwidth of the physical link.
S306, the first device obtains the speed limit parameter of the session of the file type corresponding to the physical link based on the expected bandwidth of the session of the file type.
Wherein the expected bandwidth of the sessions for the respective file types on the physical link is the same.
For each physical link between a first device and a second device, the first device may calculate, for each physical link, a difference between a maximum transmission bandwidth of the physical link and a desired bandwidth of a file-type session for the file-type session after obtaining the desired bandwidth of the file-type session for the physical link, and obtain a speed limit parameter Reduced for each file-type session on the physical link, for limiting the bandwidth occupied by the file-type session on the physical link using the speed limit parameter.
In some embodiments, the first device may also directly use the desired bandwidth of the file type session as the rate-limiting parameter of the file type session.
S307, the first device limits the bandwidth occupied by the file type session on the physical link to be smaller than or equal to the expected bandwidth of the file type session based on the speed limiting parameter of the file type session corresponding to the physical link.
In some embodiments, the speed limit parameter of the file type session may also limit the bandwidth occupied by the file type session to be less than or equal to the speed limit parameter, so that the bandwidth of the physical link occupied by the file type session is less than or equal to the speed limit parameter during file transfer.
According to the application, the speed limit is carried out on the file type session on the physical link, so that the bandwidth of the non-file type session can meet the operation requirement of the non-file type session, and the problem that the file type session causes bandwidth preemption to the non-file type session in the process of file transmission between the PC, the mobile phone and the tablet personal computer can be solved. And the statistics of the conversation quantity is carried out by distinguishing the physical links, so that the self-adaptive speed-limiting regulation and control of the conversation of the file types on different physical links can be realized based on the bandwidth conditions of different physical links and the conversation conditions on different physical links, the smoothness of sending data by other session is not influenced while the file is transmitted, and the services such as super connection, heterogeneous screen throwing, super mouse and the like are better supported.
The process of establishing, closing and updating the speed limit parameters of the session will be described below by taking the first device as a PC, the second device as a mobile phone, and the super mouse service between the PC and the mobile phone as an example. As shown in fig. 5, the method comprises the steps of:
when a user drags a mobile phone icon on a first interface to a tray control on the first interface, a super mouse service is indicated to be performed between the PC and the mobile phone, and a first mouse service in the PC can send a first bytes session establishment request to a first connection (link) service in the PC.
The first connection service then sends a first bytes session establishment request to a second connection service in the handset. The second connection service establishes a first bytes session with the PC based on a P2P link with the PC in response to the first bytes session establishment request. After the first bytes session is established successfully, the second connection service may report the first session information to the second mouse service in the handset. The first session information is used to trigger the second mouse service to start a super mouse service process.
After the first bytes session is established successfully, the first connection service may add 1 to the flag 1 in case the first bytes session is established based on the P2P link, since the bytes type session belongs to a non-sensitive type session. The first connection service may report the second session information to the first mouse service. The second session information may include information such as a session ID of the first bytes session, so that the first mouse service knows that the first bytes session was established successfully.
Where the label 1 indicates the number of all non-sensitive types of sessions over the P2P link between the PC and the handset.
For example, the first connection service may update the flag 1 before invoking the callback function and reporting the second session information to the first mouse service. Of course, the first connection service may update the flag 1 after reporting to the first mouse service, and the present application does not limit the timing of updating the flag 1, and only needs to update after the session is established.
Then, the first mouse service needs to trigger the second mouse service to start the file dragging business process. The file drag business process may be used to enable file transfer between devices. Specifically, the first mouse service may send a second bytes session establishment request to the first connection service.
The first connection service may then send a second bytes session establishment request to the second connection service. The second connection service establishes a second bytes session with the PC based on the P2P link with the PC in response to the second bytes session establishment request. After the second bytes session is established successfully, the second connection service may report the third session information to the second mouse service.
The third session information may include information such as a session ID of the second bytes session, for example. The second bytes session may be used to transmit an instruction, such as a first mouse service transmitting a first instruction to a second mouse service through the second bytes session, the first instruction being used to trigger the second mouse service to initiate a file drag service process.
After the second bytes session is established successfully, because the bytes type session belongs to the non-sensitive type session, the first connection service may add 1 to the flag 1 and report the fourth session information to the first mouse service when the second bytes session is established based on the P2P link. The fourth session information may include, for example, a session ID of the second bytes session.
When the user moves the mouse to pass through, it indicates that the mouse will reach the mobile phone, and the first mouse service may send a streaming session establishment request to the first connection service. Thereafter, the first connection service may send a streaming session establishment request to the second connection service. The second connection service establishes a streaming session with the PC based on the above-described P2P link in response to the session establishment request.
After the streaming session is established successfully, the second connection service may report the fifth session information to the second mouse service. The streaming session is used to transfer the coordinates of the mouse.
After the streaming session is established successfully, since the session of the bytes type belongs to the session of the sensitive type, the first connection service may add 1 to the flag 2 and report the sixth session information to the first mouse service when the second bytes session is established based on the P2P link.
Where the label 2 indicates the number of sessions of all sensitive types on the P2P link between the PC and the handset.
When the user drags the file on the PC to the mobile phone, the first mouse service may send the coordinate stream to the second mouse service based on the streaming session. The coordinate stream includes coordinates of the mouse. Specifically, the first mouse service may first send the coordinate stream to the first connection service. The first connection service sends the coordinate stream to the second connection service. The second connection service then reports the coordinate stream to a second mouse service.
After the second mouse service receives the coordinate stream, the position of the mouse on the mobile phone interface can be updated according to the coordinate stream.
When the user drags the file on the PC to the mobile phone and releases the mouse, the file is indicated to be transmitted to the mobile phone, and the second mouse service can send a second instruction to the first mouse service based on the second bytes session, and the second instruction is used for triggering the PC to transmit the file. Specifically, the second mouse service may first send the second instruction to the second connection service. The second connection service sends the second instruction to the first connection service. Then, the first connection service reports the second instruction to the first mouse service.
After receiving the second instruction, the first mouse service may send a file session establishment request to the first connection service. Thereafter, the first connection service may send a file session establishment request to the second connection service. The second connection service establishes a file type session (or referred to as a file session) with the PC based on the above-described P2P link in response to the session establishment request. The file session may be used to transfer a file.
After the file session is established successfully, the second connection service may report the seventh session information to the second mouse service. Illustratively, the seventh session information may include a session ID of the file type session.
After the file type session is established successfully, the first connection service may report the eighth session information to the first mouse service. Illustratively, the eighth session information may include a session ID of the streaming session, etc.
Thereafter, the first mouse service may send the target file (i.e., the file dragged by the user) to the second mouse service using the file-type session. Specifically, the first mouse service may send the target file to the first connection service. The first connection service may send the target file to the second connection service.
In the file transmission process, the first connection service may send the file transmission progress corresponding to the session of the file type to the first keymouse service when the PC meets a preset progress update condition. After the first mouse service obtains the file sending progress, the file sending progress can be displayed on the second interface.
In some embodiments, the preset progress update condition may include at least one of: the file transmission increment size is larger than or equal to a first preset value, the file transmission progress increment value is larger than or equal to a second preset value, and the progress update interval time is larger than or equal to a preset time interval. Illustratively, the preset progress update condition is actually an indication progress report condition. When the first connection service determines that the file session meets the progress reporting condition, reporting a file transmission progress (such as the file sending progress) to the first key mouse service. Correspondingly, the file transmission increase size is larger than the difference between the current transmitted size of the file corresponding to the file session and the transmitted size of the file when the last first connection service reports the file transmission progress to the first mouse service. The method comprises the steps that the first connection service reports the file transmission progress to the first mouse service from last time, and the file size corresponding to the file transmission session is transmitted within the period of time from the last time to the current time.
The file transmission progress increment value represents the difference between the current file transmission progress and the file transmission progress reported to the first key mouse service by the last first connection service.
The progress update interval time represents a time difference between the current time and the file transmission progress reported to the first mouse service by the last time of the first connection service.
When the first connection service reports the file sending progress corresponding to the session of the file type for the first time, the flag 3 may be increased by 1. The first connection service may calculate, based on the latest value of the flag 3, the expected bandwidth corresponding to the file type session on the P2P link by using the latest values of the flag 1 and the flag 3, so as to update the speed limit parameter based on the bandwidth corresponding to the file type session, limit the bandwidth of the file type session on the P2P link, and ensure data transmission of the non-file type session.
Where reference 3 indicates the number of sessions for all file types on the P2P link.
In addition, under the condition that the first connection service reports the file sending progress each time, the latest values of the mark 1, the mark 2 and the mark 3 can be obtained, and the expected bandwidth corresponding to the file type session on the P2P link is calculated by utilizing the latest values of the mark 1, the mark 2 and the mark 3, so that the speed limiting parameter is updated based on the bandwidth corresponding to the file type session, the bandwidth of the file type session on the P2P link is limited, and the data transmission of the non-file type session is ensured.
When the file transmission is successful, the second connection service may report the file transmission success information to the second mouse service. After the file is successfully transmitted, the first connection service may report the file transmission success information to the first mouse service.
After the file transfer is successful, the first mouse service may send a file session close request to the first connection service. The first connection service closes the file type session in response to the file session closing request.
After the file session is closed, the above flag 3 is decremented by 1 in the case where the file type session is established based on the P2P link.
In some embodiments, the maximum transmission bandwidth of the physical link utilized by the first connection service in calculating the limitation parameter may be obtained through a dfile module.
In some embodiments, after the first mouse service receives the file transmission success information, the first mouse service may stop displaying the file transmission progress on the second interface, for example, stop displaying the progress bar. For example, the file transfer success information may indicate that the file transmission was successful.
In some embodiments, after receiving the file transfer success information, the second mouse service may stop displaying the file transfer condition, such as stopping displaying the prompt information in the file transfer, or stopping displaying the file transfer progress.
Furthermore, when the file transfer described above is successful, it is only one possible way of terminating the file transfer. When the file transfer fails, the file transfer is also terminated. In the case where the file transmitted by the file session is a file transmission termination, the state corresponding to the file session may be considered as a file transmission termination state, that is, the file session does not need to transmit a file, and thus, the related device (e.g., the first device described above). For example, the file transfer success information may indicate file transmission success, file transmission failure, file reception success, file reception failure, and close session. The shutdown session herein may indicate that the file session is closed during the file transfer. Where the file session is closed may be an abnormal closing.
In some embodiments, when a service (e.g., the first mouse service described above) sends a session establishment request to a connection service (e.g., the first connection service described above), the session establishment request may include a type of session. The type of session indicates the type of session that the session establishment request needs to establish. The types of different sessions have corresponding session identifications. For example, the session establishment request is the first bytes session establishment request, where the first bytes session establishment request may include a session identifier corresponding to a bytes type, so as to instruct the first connection service to establish a session of a bytes type.
In addition, the session establishment request may also include a link identification. The link identifier indicates that a session of a corresponding type is established based on a physical link to which the link identifier corresponds. For example, the first bytes session establishment request may include a session identifier corresponding to a bytes type and a link identifier corresponding to a P2P type, so as to indicate the first connection service, and the first connection service is established based on a P2P link.
Alternatively, the session establishment request may further include a link identifier and a corresponding priority thereof. The connection service establishes a session of a corresponding type based on a physical link corresponding to the link identifier with high priority (abbreviated as a physical link with high priority). If the physical link with high priority cannot establish the session with the corresponding type, then establishing the session with the corresponding type based on the physical link with low priority.
In the application, under the condition that the file transmission progress (such as the file transmission progress) is reported to the first key mouse service, the first connection service can determine the speed limiting parameter of the file type session on the physical link based on the number of different types of sessions on the physical link where the session corresponding to the file transmission progress is located, thereby realizing the update of the speed limiting parameter, enabling the updated speed limiting parameter to be more in line with the actual condition of the physical link, and further realizing the accurate speed limiting of the file type session. In the process of file transmission based on the file type session, when a user moves a mouse on a mobile phone, a first mouse service in a PC needs to send a coordinate stream to a second mouse service in the mobile phone based on the stream type session (as shown in the above figure 5), and the file type session does not occupy the bandwidth of the file type session, so that the problem of coordinate stream sending blocking is avoided, the real-time performance of the coordinate stream sending is ensured, and the transmission delay of the non-file type session is reduced.
It should be understood that the session type (such as the bytes session, the streaming session, and the file type session) and the session establishment sequence corresponding to the above-mentioned super mouse service are only an example, and the mobile phone and the PC may establish a corresponding session according to the actual service situation.
In addition, one or more types of physical links may be established between the two devices. Typically, the number of physical links of one type is 1. Sessions of different services can be established on one type of physical link, and sessions of different types of services can also be established. Such as sessions over the P2P link where different services may be established. Thus, different types of sessions may include different traffic on the P2P link. For example, as shown in fig. 6, the PC and the android device 1 (such as a mobile phone) perform a service 1 (such as a super mouse service) based on a P2P link, the PC and the android device 2 perform a service 2 based on a P2P link, and the PC and the android device 3 perform a service 3 based on a WLAN link. That is, there may be different types of sessions for service 1 and different types of sessions for service 2 on the P2P link. The WLAN link may have different types of sessions for traffic 3. The service corresponding to the service described in fig. 6 may be understood as a service implementing the service. For example, the service corresponding to the super mouse service is the mouse service.
In some embodiments, the procedure of actively establishing a session by the PC is described above, and in the case where the handset actively establishes a session of a service with the PC, the PC may add 1 to the number of sessions of the corresponding type on the corresponding link after the session is established. The procedure of session number update is similar to the procedure of session update described above.
In some embodiments, the PC may establish a physical link with one or more devices. There are the number of sensitive type sessions, the number of non-sensitive type sessions and the number of file type sessions on different types of physical links for each device in the PC. The number of sensitive type sessions, the number of non-sensitive type sessions and the number of file type sessions corresponding to different types of physical links for each device are independent, i.e. counted separately. For example, after establishing a streaming session of the super mouse service with the mobile phone based on the P2P link, the PC may add 1 to the number of sessions of the sensitive type corresponding to the P2P type corresponding to the mobile phone (for example, add 1 to the flag 2 corresponding to the mobile phone). After the streaming session with the tablet computer is established based on the P2P link, the PC may add 1 to the number of sessions of the sensitive type corresponding to the P2P type corresponding to the tablet computer (e.g. add 1 to the flag 2 corresponding to the tablet computer).
Illustratively, the number of sessions of the sensitive type (e.g., marker 2) corresponding to the P2P type may be represented by P2pSensitive SessionCnt. The number of sessions of the insensitive type corresponding to the P2P type (e.g., marker 1) can be represented by P2 pnormalsassioncnt. The number of sessions (e.g., reference 3) for the file type corresponding to the P2P type may be represented by P2 pfilessessioncnt.
In addition, the number of sessions of the sensitive type corresponding to the WLAN type may be represented by WLAN sensoresessioncnt. The number of sessions of the non-sensitive type corresponding to the WLAN type can be represented by WLAN normalsessioncnt. The number of sessions of the file type corresponding to the WLAN type can be represented by p2 pfilessessioncnt.
In some embodiments, when a session of a sensitive type (such as video, stream, etc.) on a physical link is successfully created, the first connection service may increment the sensoresessioncn corresponding to the physical link by 1. For example, when the callback function is called, the first connection service may add 1 to the sensorless session cn corresponding to the physical link when reporting the related information of the established session to the second mouse service.
When the session of the sensitive type on the physical link is closed successfully, the first connection service may decrease 1 the sensoresessioncn corresponding to the physical link. For example, the physical link is a P2P link. The first connection service may reduce the sensorless sendassioncn (i.e., p2 psensylsendassioncnt) corresponding to the physical link by 1 when calling the callback function and reporting the related information of the closed session to the first mouse service.
When session creation of a non-sensitive type (such as cmd, audio, msg type) on a physical link is successful, the first connection service may add 1 to the NormalSessionCnt corresponding to the physical link. For example, when the link service calls the callback function and reports the related information of the established session to the first mouse service, the NormalSessionCnt corresponding to the physical link is added by 1.
When the session of the insensitive type on the physical link is closed successfully, the first connection service may subtract 1 from the normalsassioncnt corresponding to the physical link. For example, when the callback function is called, the first connection service may reduce the normals sessioncnt corresponding to the physical link by 1 when reporting the related information of the closed session to the first mouse service.
When the file transmission progress of the file session corresponding to the physical link is reported for the first time, the first connection service may add 1 to the filesession cnt corresponding to the physical link. When the file transfer is terminated, the first connection service may decrease the filesession cnt corresponding to the physical link by 1.
And when the file transmission progress of the file session corresponding to the physical link is finished, the first connection service can calculate and obtain the speed limit parameter of the file type session on the physical link based on the value of NormalSessionCnt, sensitiveSessionCn and filesession cnt corresponding to the physical link, and set the speed limit through the speed limit interface provided by the DFILE so as to avoid preemption of the bandwidth of the physical link by the file session.
In one possible manner, the above-mentioned updating of the session number (for example NormalSessionCnt, sensitiveSessionCn and filesession cnt) and the calculating of the speed limit parameter of the different types corresponding to the physical link may be performed by the session management module in the connection service (for example the above-mentioned first connection service). For example, the session management module may update the value of NormalSessionCnt, sensitiveSessionCn or FilesessionCnt corresponding to the link type according to the link type and the session type before the first connection service callback is reported to the service.
The service in the PC uses link service to transmit file, the session management module updates FilesessionCnt corresponding to the link type according to the link type before the connection service layer reports the file transmission progress to the service, and simultaneously completes the update of the speed limit parameter.
In the application, each service can use multiple session, multiple services can run on different physical links, the bandwidth of the physical links is limited, the bandwidth occupied by file transmission is limited by updating the speed limiting parameters of the file session in the process of transmitting the file, necessary bandwidth is reserved for the session of a non-file type, and the stable and reliable running of the session of the non-file type under different services and the same service can be ensured.
In some embodiments, the application provides a computer readable storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform a method as described above.
In some embodiments, the application provides a computer program product which, when run on an electronic device, causes the electronic device to perform the method as described above.
It will be apparent to those skilled in the art from this description that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of specific embodiments of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present application should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A session management method, comprising:
under the condition that a first device and a second device establish a physical link, the first device obtains a reserved bandwidth of a non-file type session corresponding to the physical link by combining the number of the sessions of a second type corresponding to the physical link based on the number of the sessions of the first type corresponding to the physical link and a first preset bandwidth corresponding to the first type; wherein the non-file type session includes the first type session and the second type session; the first type represents a session type in which the expected transmission delay is less than a preset delay; the non-file type represents a type other than a file type; the second type of session represents a type other than the first type of the non-file types; the file type session is used for transmitting files; the first preset bandwidth represents that the session transmission time delay of the first type is smaller than the minimum bandwidth occupied by the preset time delay;
The first device obtains the expected bandwidth of the file type session based on the expected total bandwidth of all the file type sessions corresponding to the physical link and the number of the file type sessions corresponding to the physical link; wherein the desired total bandwidth is a difference between a maximum transmission bandwidth of the physical link and a reserved bandwidth of the non-file type session;
the first device obtains a speed limit parameter of the session of the file type corresponding to the physical link based on the expected bandwidth of the session of the file type; and the speed limiting parameter is used for limiting the bandwidth of the file type session when transmitting the file to be smaller than or equal to the expected bandwidth of the file type session.
2. The method according to claim 1, wherein the method further comprises:
transmitting data of a first service through the session of the non-file type; the first service comprises a key mouse service;
and sending the file through the session of the file type.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
under the condition that a first file session on the physical link meets a preset progress updating condition, the first device obtains a reserved bandwidth of a non-file type session corresponding to the physical link by combining the number of the first type session corresponding to the physical link and the first preset bandwidth corresponding to the first type session corresponding to the physical link;
Wherein the first file session is a session of any file type on the physical link; the preset progress update condition includes at least one of: the increment size of the file correspondingly transmitted by the first file session is larger than or equal to a first preset value, the increment value of the file transmission progress is larger than or equal to a second preset value, and the progress update interval time is larger than or equal to a preset time interval; the progress update interval time indicates a difference between the current time and the time when the first device last updated the file transmission progress displayed on the first device interface.
4. A method according to claim 1 or 2, characterized in that in case a new session is established on the physical link, if the new session type belongs to the first type, the number of sessions of the first type corresponding to the physical link is increased by 1;
and if the new session type belongs to a second type, adding 1 to the number of sessions of the second type corresponding to the physical link.
5. The method according to claim 1 or 2, wherein the type of physical link comprises a plurality of; for each type of physical link, under the condition that a new session is established on the type of physical link, if the type of the new session belongs to a first type, the number of the sessions of the first type corresponding to the type of the physical link is increased by 1;
And if the new session type belongs to a second type, adding 1 to the number of sessions of the second type corresponding to the physical link type.
6. A method according to claim 3, wherein in case a new session is established on the physical link, if the new session type belongs to a file type, the number of sessions of the file type corresponding to the physical link is increased by 1;
or,
and if the new session first meets the preset progress updating condition under the condition that the new session type belongs to the file type, adding 1 to the session number of the file type corresponding to the physical link.
7. The method according to claim 1, wherein in case one session on the physical link is closed, if the type of closed session belongs to a first type, the number of sessions of the first type on the physical link is reduced by 1;
if the type of the closed session belongs to a second type, subtracting 1 from the number of sessions of the second type corresponding to the physical link;
if the type of the closed session is a file type, the number of sessions of the file type corresponding to the physical link is reduced by 1.
8. The method according to any one of claims 1 to 7, wherein the obtaining, by the first device, the reserved bandwidth of the session of the non-file type corresponding to the physical link based on the number of sessions of the first type corresponding to the physical link and the first preset bandwidth corresponding to the first type, in combination with the number of sessions of the second type corresponding to the physical link, includes:
In the case that the number of the second type of sessions is smaller than the first number, the reserved bandwidth of the session of the non-file type is the sum of the reserved bandwidth of the session of the first type and a second preset bandwidth corresponding to the second type; wherein the reserved bandwidth of the first type of session is the product of the number of the first type of session and a first preset bandwidth;
in the case that the number of sessions of the second type is greater than or equal to the first number and less than the second number, the reserved bandwidth of the session of the non-file type is based on the sum of the reserved bandwidth of the session of the first type and the reserved bandwidth of the second type; the second type of reserved bandwidth is derived based on the second preset bandwidth and a first number;
when the number of the second type of sessions is greater than or equal to the second number, the reserved bandwidth of the session of the non-file type is the sum of the reserved bandwidth of the session of the first type and a third preset bandwidth corresponding to the second type;
wherein the third preset bandwidth is greater than the second preset bandwidth.
9. The method according to any of claims 1 to 8, wherein the speed limiting parameter is a difference between a maximum transmission bandwidth of the physical link and a desired bandwidth of the file-type session.
10. An electronic device, wherein the electronic device is a first device, the electronic device comprising a display screen, a memory, and one or more processors; the display screen, the memory and the processor are coupled; the display screen is used for displaying images generated by the processor, and the memory is used for storing computer program codes, and the computer program codes comprise computer instructions; the computer instructions, when executed by the processor, cause the electronic device to perform the method of any one of claims 1 to 9.
11. A computer readable storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method of any one of claims 1 to 9.
CN202310091000.6A 2023-01-19 2023-01-19 Session management method and electronic equipment Pending CN117135199A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310091000.6A CN117135199A (en) 2023-01-19 2023-01-19 Session management method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310091000.6A CN117135199A (en) 2023-01-19 2023-01-19 Session management method and electronic equipment

Publications (1)

Publication Number Publication Date
CN117135199A true CN117135199A (en) 2023-11-28

Family

ID=88857074

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310091000.6A Pending CN117135199A (en) 2023-01-19 2023-01-19 Session management method and electronic equipment

Country Status (1)

Country Link
CN (1) CN117135199A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070078986A1 (en) * 2005-09-13 2007-04-05 Cisco Technology, Inc. Techniques for reducing session set-up for real-time communications over a network
CN105765925A (en) * 2013-11-27 2016-07-13 汤姆逊许可公司 Method for distributing available bandwidth of network amongst ongoing traffic sessions run by devices of the network, and corresponding device
CN110351121A (en) * 2014-10-13 2019-10-18 柏思科技有限公司 For configuring the method and system of electronic device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070078986A1 (en) * 2005-09-13 2007-04-05 Cisco Technology, Inc. Techniques for reducing session set-up for real-time communications over a network
CN105765925A (en) * 2013-11-27 2016-07-13 汤姆逊许可公司 Method for distributing available bandwidth of network amongst ongoing traffic sessions run by devices of the network, and corresponding device
CN110351121A (en) * 2014-10-13 2019-10-18 柏思科技有限公司 For configuring the method and system of electronic device

Similar Documents

Publication Publication Date Title
US11151010B2 (en) Resource configuration method, mobile terminal and storage medium
CN110809297B (en) Data transmission method and electronic equipment
CN111800240B (en) Information transmission method, device, terminal, equipment and medium
CN113115439A (en) Positioning method and related equipment
EP4243556A1 (en) Method for monitoring link and terminal device
CN114968384B (en) Function calling method and device
WO2023065931A1 (en) Method for charging electronic device, and electronic device
WO2021109872A1 (en) Http request transmission method and device
WO2020019533A1 (en) Data transmission method and electronic device
CN113645608B (en) Data transmission method and data transmission device
WO2021057503A1 (en) Method and apparatus for downloading data packet
CN117135199A (en) Session management method and electronic equipment
WO2022247638A1 (en) Method for controlling connection of stylus, and electronic device
US20220360472A1 (en) Uplink transmission method and apparatus, device, and storage medium
CN110139390B (en) Resource scheduling indication method, terminal and network equipment
US20220174701A1 (en) Information processing method, device, and computer-readable storage medium
KR20200089984A (en) Apparatus and mehtod for providing work environment for application program between electronic device and external server
EP4191409A1 (en) Shared library multiplexing method and electronic device
CN116709417B (en) Temperature control method and related equipment
CN115551117B (en) PDN connection method and communication system
CN114928899B (en) Physical link establishment method and electronic equipment
WO2023005783A1 (en) Data processing method and electronic device
EP4280042A1 (en) Distributed audio playing method, and electronic device
CN111434154A (en) Management method for internal and peripheral devices of terminal and terminal
EP4310672A1 (en) Application keep-alive method, electronic device and a storage medium

Legal Events

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