Project switching method, device and equipment and readable storage medium

By dynamically acquiring and overwriting project data from different sources, it solves the problem of same-origin policy restrictions in switching between projects in GIS scenarios, achieves fast and accurate project switching, and improves performance and maintainability.

CN118673243APending Publication Date: 2024-09-20GUANGZHOU KINDLINK SOFTWARE TECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410666033.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

In digital twin technology, switching between projects in GIS scenarios is limited by the same origin policy. Traditional web page switching methods such as using inline frames (iframes) have high performance overhead, poor maintainability and data transmission problems, and cannot be applied to projects from different sources. switch between.

Method used

Dynamically obtain project data at runtime, realize project switching based on data drive, use the data access addresses of different source projects to obtain data, and overwrite the original project data to achieve switching between different source projects and avoid restrictions on the same origin policy.

Benefits of technology

It achieves fast and accurate switching between different source projects, improves performance and maintainability, simplifies the troubleshooting and repair process, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118673243A
    Figure CN118673243A
Patent Text Reader

Abstract

The invention discloses a project switching method, device and equipment and a readable storage medium. Terminal equipment opens and displays a first digital twin world of a first project through a browser. When the terminal device recognizes that the user operates the twinborn body in the first digital twinborn world, the access address of second item data of a second item associated with the twinborn body is determined, and the first item and the second item are different source items. And then the terminal device obtains the second project data according to the access address of the second project data, and covers the first project data of the first project by using the second project data so as to switch from the first project to the second project. By adopting the scheme, the project data is dynamically acquired during operation, the project switching is realized based on data driving, the limitation of a homologous strategy is avoided, and the purpose of switching different source projects is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of digital twin technology, and in particular, to a project switching method, device, equipment, and readable storage medium. Background Art

[0002] With the rapid development of Internet technology, the popularity of digital twins is increasing day by day. Based on digital twin technology, physical entities in the real world can be mapped to the digital world. The virtual representation of a physical entity in the digital world is called a twin.

[0003] In digital twin technology, when a regional project contains multiple school projects, there is a need to switch projects. For example, when a user opens a regional project through a browser, the digital twin world of the regional project displays the twin of the school project. When the user double-clicks the twin, it means that the user wants to enter the digital twin world corresponding to the school project, that is, switch from the regional project to the school project.

[0004] The above-mentioned project switching is equivalent to switching in the Geographic Information System (GIS) scenario. However, the current web page switching is not applicable to switching between projects in the GIS scenario. This is because web page switching uses inline frames (iframes), which requires that the two web pages are from the same source, while the above-mentioned projects are not web pages, but projects from different sources. Therefore, how to achieve switching between projects in the GIS scenario is an urgent problem to be solved. Summary of the invention

[0005] The embodiments of the present application provide a project switching method, apparatus, device and readable storage medium, which dynamically obtain project data at runtime, implement project switching based on data drive, are not restricted by the same-source policy, and achieve the purpose of switching projects from different sources.

[0006] In a first aspect, an embodiment of the present application provides a project switching method, comprising:

[0007] The first digital twin of the first project is shown;

[0008] In response to a user's operation on a twin on the first digital twin world, determining an access address of second project data of a second project associated with the twin, wherein the first project and the second project are different source projects;

[0009] acquiring the second project data according to the access address of the second project data;

[0010] The first project data of the first project is overwritten with the second project data to switch from the first project to the second project.

[0011] In a second aspect, an embodiment of the present application provides a project switching device, comprising:

[0012] A display module, used for displaying a first digital twin world of a first project;

[0013] A response module, configured to determine, in response to a user's operation on a twin on the first digital twin world, an access address of second project data of a second project associated with the twin, wherein the first project and the second project are different source projects;

[0014] A processing module, configured to obtain the second project data according to an access address of the second project data;

[0015] The switching module is used to overwrite the first project data of the first project with the second project data to switch from the first project to the second project.

[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the method described in the first aspect or various possible implementation methods of the first aspect.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed by a processor, they are used to implement the method described in the first aspect or various possible implementation methods of the first aspect.

[0018] In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computing program, and when the computer program is executed by a processor, the method described in the first aspect or various possible implementation methods of the first aspect is implemented.

[0019] The project switching method, apparatus, device and readable storage medium provided in the embodiments of the present application, the terminal device opens and displays the first digital twin world of the first project through a browser. When the terminal device recognizes that the user operates the twin in the first digital twin world, it determines the access address of the second project data of the second project associated with the twin, and the first project and the second project are projects from different sources. After that, the terminal device obtains the second project data according to the access address of the second project data, and uses the second project data to overwrite the first project data of the first project to switch from the first project to the second project. With this solution, project data is dynamically acquired at runtime, and project switching is realized based on data-driven, which is not restricted by the same-source policy, thereby achieving the purpose of switching projects from different sources. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 is a flow chart of a project switching method provided in an embodiment of the present application;

[0022] Figure 2 is a first digital twin world schematic diagram of the first project in the project switching method provided in an embodiment of the present application;

[0023] Figure 3 is a schematic diagram of the second digital twin world in the project switching method provided in an embodiment of the present application;

[0024] Figure 4 is a schematic diagram of an editing interface in a project switching method provided in an embodiment of the present application;

[0025] Figure 5 is another flow chart of the project switching method provided in an embodiment of the present application;

[0026] Figure 6 A schematic diagram of a project switching device provided in an embodiment of the present application;

[0027] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] At present, digital twin technology is aimed at schools and education, and school projects are created for each school. However, each school project is not completely isolated, but has a relationship. For example, a university has a total of 4 campuses, which are located in different cities or different districts of the same city. Then, one campus is a school project. You can create a regional project, and the digital twin world of the regional project will display a school-type twin, and the school-type twin is associated with the school project. When a user views or uses a regional project, the regional project is displayed on the user interface of the terminal device. If the user clicks on the school-type twin in the regional project, the user switches from the regional project to the school project. After entering the school project, a return ball is displayed on the digital twin world of the school project. Clicking the return ball can switch to the regional project.

[0029] In the above GIS scenario, the switching between projects is not from the same source, that is, the access addresses of the project data of each project are from different sources, which makes it impossible to apply the traditional web page switching method to project switching. This is because: the traditional web page switching uses an inline frame (iframe), and the web page address to be switched is assembled and carried by the iframe, so as to complete the switching at a relatively low cost. However, due to the browser's homology policy restrictions, data cannot be transmitted and called normally, resulting in the general applicability of iframe. In other words, when embedding other web pages on a parent web page, if iframe is used for web page switching, the parent web page and the embedded web page must have the same source, that is, the protocol, domain name and port of the parent web page and the embedded web page correspond to the same. If the parent web page and the embedded web page are from different sources, for example, when a Hypertext Transfer Protocol (HTTP) page is embedded in a Hypertext Transfer Protocol Secure (HTTPS) page, that is, when the parent web page uses the HTTPS protocol and the embedded web page uses the HTTP protocol, the browser will directly report an error.

[0030] In addition to the same-origin policy restrictions, iframe-based switching also has the following disadvantages:

[0031] First, the switching process is long and has high performance overhead.

[0032] Each switch involves a process of rebuilding the browser context and reloading resources. The created context environment cannot be reused, which results in each switching process being very long and with a relatively high performance overhead.

[0033] Second, maintainability is poor.

[0034] Based on the iframe switching method, if there is a problem with the embedded web page, it is difficult to troubleshoot the problem through conventional endpoint debugging, console logs, etc., and the repair cost is high.

[0035] Obviously, the iframe-based switching method cannot be transferred to the switching between projects in the GIS scenario.

[0036] Based on this, the embodiments of the present application provide a project switching method, device, equipment and readable storage medium, which dynamically obtains project data at runtime, implements project switching based on data drive, is not restricted by the same-source policy, and achieves the purpose of switching between different-source projects.

[0037] The embodiments of the present application are applicable to pure edge scenarios, pure cloud scenarios, and cloud-edge hybrid scenarios. These scenarios are described in detail below.

[0038] First, the pure edge scenario.

[0039] The pure edge scenario means that the project data of each project is deployed on the server in the LAN. For example, a university has a total of 4 campuses, which are located in different cities. The 4 campuses include a main campus and three branch campuses, so there are a total of 5 projects: 4 school projects and 1 regional project. Among them, the 4 school projects correspond to different campuses, and the 4 campuses each have a LAN. Assume that the project data of the 4 school projects are project data 1, project data 2, project data 3, and project data 4, respectively, and the 4 LANs have servers a, server b, server c, and server d respectively. The campus corresponding to project data 1 is the main campus, and the others are branch campuses. Server a is located in the LAN of the main campus. Project data 0 of the regional project is deployed on server e, and server e is located in the LAN of the main campus. Project data 1, project data 2, project data 3, and project data 4 are deployed on servers a, server b, server c, and server d respectively.

[0040] In this scenario, at least one of the protocols, IP addresses, and ports in the access addresses of the project data of any two projects is different. For example, the access address of the project data 0 of the main campus is: http: / / abc.de.fgh.ijk:8190, and the access address of the project data 1 is: http: / / abc.de.fgh.ijk:8188, where a~k represent Arabic numerals. The protocols and IP addresses of these two access addresses are the same, but the ports are different: the port in the access address of project data 0 is 8190, while the port in the access address of project data 1 is 8188.

[0041] In addition, the two access addresses only indicate the protocol, IP, and port, but do not indicate the relative path behind the port. In the pure edge scenario, in the access addresses of the project data of any two projects, except for at least one of the protocol, IP, and port, the rest of the relative paths are the same.

[0042] It can be seen that in the pure edge scenario, two projects have different sources, which means that at least one of the protocol, IP and port in the access address of the project data of the two projects is different.

[0043] In the pure edge scenario, the LAN and the public network are not connected. Users open the regional project through the browser of terminal devices such as laptops, desktops, mobile phones, and pads. When the project needs to be switched, a request is initiated to obtain project data from the server in the LAN. For example, the terminal device currently stays in the digital twin world of the regional project, which displays the twins of the four campuses. The user double-clicks any twin, such as campus B, and the project data of campus B is project data 2, then the terminal device obtains project data 2 from server b.

[0044] Secondly, the pure cloud scenario.

[0045] A pure cloud scenario means that the project data of each project is deployed on a cloud server, that is, a server in the public network. Continuing with the above example, a university has 4 campuses in different cities, so there are 5 projects in total: 4 school projects and 1 regional project. The project data of these five projects are all deployed on a server in the public network. For example, they are deployed on the same server or different servers in the public network.

[0046] In this scenario, at least one of the domain names or protocols in the access addresses of the project data of any two projects is different. For example, the access address of project data 0 of the main campus is: http: / / www.abcd.com, and the access address of project data 1 is: http: / / www.dfgh.com, where a~h represent letters in the domain name. The domain names in these two access addresses are different. In addition, these two access addresses only illustrate the protocol and domain name, and do not illustrate the relative path after the domain name. In a pure cloud scenario, in the access addresses of the project data of any two projects, except for at least one of the protocol and domain name, the rest of the relative paths are the same.

[0047] It can be seen from this that in a pure cloud scenario, two projects with different sources means that at least one of the protocol and domain name in the access address of the project data of the two projects is different.

[0048] In a pure cloud scenario, users open regional projects through browsers on terminal devices such as laptops, desktops, mobile phones, and pads. When a project switch is required, a request is initiated to obtain project data from a server in the public network. For example, the terminal device currently stays in the digital twin world of the regional project, which displays the twins of the four campuses. The user double-clicks any twin, such as campus B, and the project data of campus B is project data 2, then the terminal device obtains project data 2 from the public network server.

[0049] Finally, cloud edge blending.

[0050] The cloud-edge hybrid scenario means that the project data of some projects are deployed on servers in the local area network, and the project data of some projects are deployed on cloud servers, that is, servers in the public network. Continuing with the above example, a university has a total of 4 campuses, and the 4 campuses are located in different cities, so there are a total of 5 projects: 4 school projects and 1 regional project. Assuming that the project data of the 4 school projects are project data 1, project data 2, project data 3, and project data 4, and the project data of the regional project is project data 0, then project data 0 is deployed on a server in the public network, and project data 1, project data 2, project data 3, and project data 4 are deployed on server a, server b, server c, and server d, respectively, and these servers are located in different local area networks.

[0051] In the cloud-edge hybrid scenario, two projects with different sources means that the access addresses of the project data of any two projects are different.

[0052] Below, based on the above-mentioned introduction of pure edge, pure cloud and cloud-edge hybrid scenarios, as well as the introduction of different sources of projects, the embodiments of this application are described in detail. Figure 1 .

[0053] Figure 1 This is a flow chart of the project switching method provided in the embodiment of the present application. The execution subject of this embodiment is a terminal device, and application software such as a browser is installed on the terminal device, and the first digital twin world of the first project can be displayed through the browser. This embodiment includes the following steps:

[0054] 101. Display the first digital twin world of the first project.

[0055] Exemplarily, a browser is installed on the terminal device, and after the user enters the URL of the first project in the browser using a mouse, keyboard, etc., the first digital twin world of the first project is displayed on the user interface of the terminal device.

[0056] In the embodiment of the present application, the first project is a regional project, and the digital twin world of the first project is called the first digital twin world, and several twins are displayed on the first digital twin world. The first project is equivalent to a general project, and the general project contains multiple sub-projects, that is, multiple second projects. The first digital twin world is a digital twin world for users to view or use the first project, and the first digital twin world displays the twins corresponding to each second project, so as to clearly and intuitively display the location, distance, etc. of each second project.

[0057] For example, in the field of education, a university has a first project, and each campus is a different campus project, namely the second project. In the first digital twin world, you can intuitively see how many campuses the university has, the location of each campus, etc. Figure 2 This is a schematic diagram of the first digital twin world of the first project in the project switching method provided in the embodiment of the present application. Figure 2 The first digital twin world is a digital twin world for users to view or use the first project. The two pennants in the first digital twin world each represent a twin, namely Campus A and Campus B. In the first digital twin world, users can roam in the digital twin world corresponding to the first project by moving the mouse, clicking, double-clicking, changing the viewing angle, etc.

[0058] For example, if the Education Bureau of a certain district in a city has jurisdiction over many primary and secondary schools, then the district corresponds to one first project, and each primary and secondary school is a different second project.

[0059] In the embodiment of the present application, the first project and most of the second projects are located in different geographical locations, that is, they are not in the same geographical location. This is the main reason why the first project and the second project have different origins, and any two second projects belonging to the same first project have different origins.

[0060] 102. In response to a user's operation on a twin in the first digital twin world, determine an access address of second project data of a second project associated with the twin, wherein the first project and the second project are different source projects.

[0061] When a user wishes to enter the digital twin world of a school project, the user operates the twin in the first digital twin world by using a mouse or the like. For example, please refer to Figure 2 , assuming that the user wants to enter the digital twin world of Campus A, double-click the pennant representing Campus A.

[0062] After the terminal device recognizes the user's operation on the twin in the first digital twin world, it determines the access address of the second project data of the second project associated with the twin. The second project data is data used to render and display the second digital twin world.

[0063] In the embodiment of the present application, the first item and the second item are items from different sources. For the description of different sources, please refer to the description of the pure edge scenario, pure cloud scenario and cloud-edge hybrid scenario, which will not be repeated here.

[0064] 103. Acquire the second project data according to the access address of the second project data.

[0065] In the embodiment of the present application, the access address of the second project data is used to indicate which server the terminal device obtains the second project data from. Therefore, after the terminal device determines the access address of the second project data, it can obtain the second project data according to the access address of the second project data.

[0066] 104. Overwrite the first project data of the first project with the second project data to switch from the first project to the second project.

[0067] After acquiring the second project data, the browser on the terminal device clears the first project data of the first project in the GIS execution context, fills it with the second project data, renders the second digital twin world, and then covers the first digital twin world with the second digital twin world and displays it, thereby switching from the first project to the second project.

[0068] In the project switching method provided in an embodiment of the present application, a terminal device opens and displays the first digital twin world of the first project through a browser. When the terminal device recognizes that the user operates the twin in the first digital twin world, it determines the access address of the second project data of the second project associated with the twin, and the first project and the second project are projects from different sources. After that, the terminal device obtains the second project data according to the access address of the second project data, and uses the second project data to overwrite the first project data of the first project to switch from the first project to the second project. With this solution, project data is dynamically acquired at runtime, and project switching is realized based on data-driven, which is not restricted by the same-origin policy, thereby achieving the purpose of switching projects from different sources.

[0069] Optionally, in the above embodiment, in the process of the terminal device acquiring the second project data according to the access address of the second project data, first, the terminal device replaces the port and IP in the access address of the first project data with the port and IP in the access address of the second project data to obtain a spliced ​​access address. Afterwards, the electronic device sends an acquisition request to the server according to the spliced ​​access address to request the second project data, and receives an acquisition response from the server, wherein the acquisition response carries the second project data.

[0070] For example, in a pure edge scenario, when the terminal device displays the first digital twin world of the first project, the interface of the second project is called to enter the second digital twin world of the second project. Since the called interface is deployed in the local area network of the second project, at least one of the protocol, IP and port in the access address of the project data of the first project and the second project is different. Therefore, when the terminal device displays the first digital twin world of the first project and initiates a call to the interface of the second project, cross-domain, i.e., different sources, will occur.

[0071] In an embodiment of the present application, in a pure edge scenario, the access address of the project data of each project includes a protocol, an IP address, a port, and a relative path. In addition to the same relative path, the access addresses of different projects have at least one different protocol, IP address, and port. Therefore, after the terminal device obtains the access address of the second project data, it replaces the protocol, IP address, and port in the access address of the first project data with the protocol, IP address, and port in the access address of the second project data, respectively, to obtain a spliced ​​access address.

[0072] For example, the access address of the first project data is: http: / / abc.de.fgh.ijk:8190kevinissight / dveb / drgwpeqpx4fd3cph. Among them, http: / / abc.de.fgh.ijk:8190 includes the protocol, IP and port. kevinissight / dveb / drgwpeqpx4fd3cph is a relative path, etc. The access address of the second project data is: http: / / abc.de.fgh.ijk:8188kevinissight / dveb / drgwpeqpx4fd3cph. After the user double-clicks the twin and the terminal device obtains the access address of the second project data, the access address of the second project is stored in the global variable. Therefore, when the terminal device initiates an acquisition request, such as an HTTP request, the terminal device replaces "http: / / abc.de.fgh.ijk:8190" in the global variable with "http: / / abc.de.fgh.ijk:8188", thereby obtaining the spliced ​​access address: http: / / abc.de.fgh.ijk:8188kevinissight / dveb / drgwpeqpx4fd3cph.

[0073] After obtaining the spliced ​​access address, the terminal device determines a server in the local area network according to the spliced ​​access address, and sends a request to the server to obtain the second project data. After receiving the request, the server sends a response carrying the second project data to the terminal device.

[0074] By adopting this solution, in a pure edge scenario, the terminal device assembles a spliced ​​access address according to the access address of the first project data and the access address of the second project data, and then obtains the second project data, thereby achieving the purpose of quickly and accurately obtaining the second project data.

[0075] Optionally, in the above embodiment, in the process of the terminal device acquiring the second project data according to the access address of the second project data, first, the terminal device replaces the domain name in the access address of the first project data with the domain name in the access address of the second project data to obtain a concatenated access address, and the first project data and the second project data are deployed on a cloud server. Afterwards, the terminal device sends an acquisition request to the server according to the concatenated access address to request the second project data; and receives an acquisition response from the server, the acquisition response carrying the second project data.

[0076] Exemplarily, in a pure cloud scenario, the access address of the project data of each project includes a protocol, a domain name, and a relative path, etc. In addition to the same relative path, the access addresses of different projects have at least one different protocol and domain name. Therefore, after the terminal device obtains the access address of the second project data, it replaces the protocol and domain name in the access address of the first project data with the protocol and domain name in the access address of the second project data, thereby obtaining a spliced ​​access address.

[0077] For example, the access address of the first project data is: http: / / www.abcd.com / kevinissight / dveb / drgwpeqpx4fd3cph. Among them, http: / / www.abcd.com includes the protocol and domain name. kevinissight / dveb / drgwpeqpx4fd3cph is a relative path, etc. The access address of the second project data is: http: / / www.dfgh.com / kevinissight / dveb / drgwpeqpx4fd3cph. Because the user double-clicks the twin and the terminal device obtains the access address of the second project data, the access address of the second project is stored in the global variable. Therefore, when the terminal device initiates a request to obtain, such as an HTTP request, the terminal device replaces "http: / / www.abcd.com" in the global variable with "http: / / www.dfgh.com", thereby obtaining the spliced ​​access address: http: / / www.dfgh.com / kevinissight / dveb / drgwpeqpx4fd3cph.

[0078] After obtaining the spliced ​​access address, the terminal device determines a server in the public network according to the spliced ​​access address, and sends a request to the server to obtain the second project data. After receiving the request, the server sends a response carrying the second project data to the terminal device.

[0079] By adopting this solution, in a pure cloud scenario, the terminal device assembles a spliced ​​access address based on the access address of the first project data and the access address of the second project data, and then obtains the second project data, thereby achieving the purpose of quickly and accurately obtaining the second project data.

[0080] Optionally, in the above embodiment, before the terminal device sends a request to the server to obtain the second project data according to the spliced ​​access address, it also sends an authentication request to the server according to the spliced ​​access address to request a token. Afterwards, the terminal device receives an authentication response from the server, and the authentication response carries the token.

[0081] For example, whether in a pure edge, pure cloud, or cloud-edge hybrid scenario, before the terminal device obtains the second project data of the second project from the server, it also requests the server to generate a token for the second project. Afterwards, when the terminal device requests the second project data from the server, it carries the token in the request header of the acquisition request as a login credential. Based on the token, the terminal device can access the server data at will.

[0082] With this solution, after the terminal device requests the second project data from the server, it requests the server to generate a token for authentication, so that the terminal device simulates logging into the server, thereby ensuring data security when switching projects in the GIS scene.

[0083] Optionally, in the above embodiment, when the terminal device uses the second project data to overwrite the first project data of the first project to switch from the first project to the second project, first, the terminal device clears the first project data from the GIS execution context of the browser, and fills the second project data in the GIS execution context of the browser, and the browser is the browser running the first project. After that, the terminal device transforms the view component of the second project into a responsive component, the view component is a visual component on the second digital twin world, renders the second digital twin world according to the responsive component, and updates the first digital twin world to the second digital twin world, so as to switch from the first project to the second project.

[0084] Exemplarily, switching from the first project to the second project is essentially a process in which the first project data of the first project is cleared, the second project data of the second project comes in, re-rendering is triggered, and then the interface is updated. Therefore, after the terminal device obtains the second project data, the first project data is cleared from the browser's GIS execution context and the second project data is filled in. After that, the view component is transformed into a responsive component. For example, by using the mobx observer decorator, view components such as the Enow component and the Bg3D component are transformed into responsive components. Responsive components can automatically respond to state changes and re-render when project data changes.

[0085] With this solution, during the project switching process, the view component is transformed into a responsive component, triggering automatic rendering and interface updates, thereby improving the efficiency of project switching. In addition, by clearing and filling the browser GIS execution context to switch projects, the created context environment is reused to avoid context reconstruction and resource reconstruction loading every time the switch is made, thereby improving the speed of project switching.

[0086] Optionally, in the above embodiment, after the terminal device uses the second project data to overwrite the first project data of the first project to switch from the first project to the second project, the terminal device also determines the access address of the first project data of the first project associated with the return ball in response to the user's operation on the return ball on the second digital twin world. Afterwards, the terminal device obtains the first project data according to the access address of the first project data; and uses the first project data to overwrite the second project data to switch from the second project to the first project.

[0087] In the embodiment of the present application, the first digital twin world of the first project is equivalent to a digital twin interface for users to view or use the first project. The first digital twin world displays the twins corresponding to each second project so that the user can switch to any second project. When the terminal device displays the second digital twin world of the second project, the return ball is displayed on the second digital twin world. For example, please refer to Figure 3 .

[0088] Figure 3 This is a schematic diagram of the second digital twin world in the project switching method provided in an embodiment of the present application, with a return ball displayed in the lower left corner. When the user wants to switch to the first project, double-click the return ball. After the terminal device recognizes the operation, it determines the access address of the first project data of the first project associated with the return ball, and then obtains the second project data. After that, the first digital twin world of the first project can be returned according to the second project data.

[0089] By adopting this solution, the switch from the second item to the first item is triggered by the return ball, and the operation is simple and fast.

[0090] In the project switching of the embodiments of the present application, in addition to switching from the first project to the second project and from the second project to the first project, there is another scenario: switching from one second project to another second project. For example, switching from Campus A to Campus B. When the terminal device currently stays in the second digital twin world of Campus A, the area below the second digital twin world displays the twins of other second projects except itself. The user can double-click any twin to achieve the purpose of switching from one second project to another second project.

[0091] Optionally, in the above embodiment, before the terminal device displays the first digital twin world of the first project, it also displays an editing interface, and sets associated projects and interactive events for the twin on the first digital twin interface through the editing interface.

[0092] Figure 4 This is a schematic diagram of the editing interface in the project switching method provided in the embodiment of the present application. Figure 4, the editing interface displays the first digital twin world and the editing bar at the same time. The editing bar includes basic attributes, business attributes, etc. The user can edit the basic attributes and business attributes of the selected twin. For example, the user selects Campus A and associates a second project with it. The project identification (PID) of the second project is, for example, 285694. Through the drop-down menu, the user chooses to associate other second projects with Campus A.

[0093] After the terminal device associates a second project with a twin, the PID of the second project is saved in the associated project (project relation) field of the twin's custom attributes.

[0094] After the terminal device associates the second project with the twin, it also adds a default interaction event for it. For example, the interaction event is a double-click event. If the user double-clicks the twin in the first digital twin world, the behavior of switching to the second project is triggered.

[0095] With this solution, before switching projects, the user associates a second project with each twin in the editing interface and adds interactive events, so that subsequent project switching can be conveniently and quickly realized.

[0096] Below, an example of project switching in a pure edge scenario is used to explain in detail the project switching method described in the embodiment of the present application. Figure 5 .

[0097] Figure 5 is another flow chart of the project switching method provided in the embodiment of the present application. This embodiment includes:

[0098] 501. Access the first project and double-click the twin in the first digital twin interface.

[0099] Exemplarily, a browser is installed on the terminal device, and the user enters the URL of the first project in the browser through a mouse, keyboard, etc., and the first digital twin world of the first project is displayed. After that, the user double-clicks the twin in the first digital twin interface. For example, please refer to Figure 2 , the user double-clicks Campus A.

[0100] 502. The interactive event manager on the terminal device triggers the behavior world of [entering campus A].

[0101] In the embodiment of the present application, a preview module, an interactive event manager and a GIS engine are set on the terminal device, and the interactive event manager is, for example, a package manager (Node Package Manager, NPM).

[0102] 503. Determine whether the project relationship field of the twin has a value. If the project relationship field has a value, execute step 504 to enter the switching process; if the project relationship field is empty, end.

[0103] Exemplarily, if the project relation field of the twin has a value, it means that the second project is previously associated with the twin in the editing interface. If the project relation field of the twin is empty, it means that the second project is not previously associated with the twin.

[0104] 504. Determine the PID of the second project associated with Campus A, and determine the access address of the second project data according to the PID.

[0105] In the embodiment of the present application, since the second project is associated with each twin in advance in the editing interface, after the user double-clicks the twin, the terminal device determines the PID of the second project associated with the twin, and then determines the access address of the second project data according to the PID. For example, there is a device or table specifically used to store the correspondence between the PID and the access address, and the terminal device calls the relevant interface to determine the access address of the second project data.

[0106] 505. Globally set access address.

[0107] In this step, the terminal device uses the protocol, port and IP in the access address of the second project data to replace the protocol, port and IP in the access address of the first project data to obtain a spliced ​​access address. When initiating an HTTP request, that is, a get request, the spliced ​​access address is used as the access address of the interface. Only in this way can the get request be sent to the server where the second project data is located, otherwise the get request is still sent to the server where the first project data is located.

[0108] 506. Request the server to generate a token for the second project.

[0109] In this step, the terminal device sends an authentication request to the server according to the spliced ​​access address to request a token; and receives an authentication response from the server, which carries a token. The token is used as the credential for the terminal device to log in to the server. Based on the token, the terminal device can access the server's data at will.

[0110] 507. The terminal device determines whether the second project data is obtained. If the second project data is obtained, step 508 is executed; if the second project data cannot be obtained, the process ends.

[0111] In this step, the terminal device queries whether the second project data is obtained according to the associated project field of the twin, and whether there is key information in the second project data. If the second project data is obtained and there is key information in the second project data, step 508 is executed; if the second project data is not obtained or there is no key information in the second project data, the process ends. Among them, the key information is, for example, a courseware representation (class identification, CID), etc.

[0112] 508. Check whether the terminal device has the authority to access the second project. If the terminal device has the authority to access the second project, execute step 509; if the terminal device does not have the authority to access the second project, end.

[0113] 509. Update GIS resource address.

[0114] In the embodiment of the present application, the access address of the first project data and the access address of the second project data are HTTP interface request addresses at the project level. In addition, each project has its own GIS resources, and the GIS resources of different projects are different.

[0115] 510. Prepare to switch environments.

[0116] In this step, the terminal device clears the first project data of the first project from the browser GIS execution context, and fills it with the second project data of the second project.

[0117] 511. Trigger re-rendering.

[0118] The terminal device transforms the view components into responsive components. For example, by using the mobx observer decorator, view components such as Enow components and Bg3D components are transformed into responsive components. Responsive components can automatically respond to state changes and re-render when project data changes.

[0119] 512. Update the interface to the second digital twin world, and display the return ball in the second digital world.

[0120] In this step, the terminal device updates the interface to the second digital twin world to complete the switch from the first project to the second project. At the same time, a return ball is displayed so that the user can return to the first project.

[0121] Table 1 is a comparison chart of the switching solution and the iframe solution of this application project.

[0122] Table 1

[0123]

[0124] According to Table 1, the project switching solution provided in the embodiment of the present application not only greatly shortens the time consumption of the project switching process, but also makes the entire switching process smoother and more natural, and provides a better user experience.

[0125] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0126] Figure 6 Schematic diagram of a project switching device provided in an embodiment of the present application. The project switching device 600 includes: a display module 61 , a response module 62 , a processing module 63 and a switching module 64 .

[0127] A display module 61, configured to display a first digital twin world of a first project;

[0128] A response module 62, configured to determine, in response to a user's operation on a twin on the first digital twin world, an access address of second project data of a second project associated with the twin, wherein the first project and the second project are different source projects;

[0129] A processing module 63, configured to obtain the second project data according to an access address of the second project data;

[0130] The switching module 64 is configured to overwrite the first project data of the first project with the second project data, so as to switch from the first project to the second project.

[0131] In a feasible implementation, the processing module 63 is used to replace the protocol, port and IP in the access address of the first project data with the protocol, port and IP in the access address of the second project data to obtain a spliced ​​access address, and the first project data and the second project data are deployed on edge servers of different local area networks; send an acquisition request to the server according to the spliced ​​access address to request the second project data; receive an acquisition response from the server, and the acquisition response carries the second project data.

[0132] In a feasible implementation, the processing module 63 is used to replace the domain name in the access address of the first project data with the domain name in the access address of the second project data to obtain a spliced ​​access address, and the first project data and the second project data are deployed on a cloud server; send an acquisition request to the server according to the spliced ​​access address to request the second project data; receive an acquisition response from the server, and the acquisition response carries the second project data.

[0133] In a feasible implementation, before the processing module 63 sends an acquisition request to the server according to the splicing access address to request the second project data, it is also used to send an authentication request to the server according to the splicing access address to request a token; and receive an authentication response from the server, and the authentication response carries the token.

[0134] In a feasible implementation, the switching module 64 is used to clear the first project data from the GIS execution context of the browser, and the browser is the browser running the first project; fill the second project data in the GIS execution context of the browser; transform the view component of the second project into a responsive component, and the view component is the visualization component on the second digital twin world; render the second digital twin world according to the responsive component; update the first digital twin world to the second digital twin world to switch from the first project to the second project.

[0135] In a feasible implementation, the response module 62, after the switching module 64 overwrites the first project data of the first project with the second project data to switch from the first project to the second project, is further used to determine the access address of the first project data of the first project associated with the return ball in response to the user's operation on the return ball on the second digital twin world;

[0136] The processing module 63 is further configured to obtain the first project data according to the access address of the first project data;

[0137] The switching module 64 is further configured to overwrite the second project data with the first project data to switch from the second project to the first project.

[0138] In a feasible implementation, before the display module 61 displays the first digital twin world of the first project, it is also used to display an editing interface;

[0139] The processing module 63 is also used to set associated items and interactive events for the twin on the first digital twin interface through the editing interface.

[0140] The interactive device provided in the embodiment of the present application can execute the actions of the terminal device in the above embodiment. Its implementation principle and technical effects are similar and will not be repeated here.

[0141] Figure 7 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and the electronic device is, for example, the terminal device mentioned above. Figure 7The electronic device 700 described in the embodiment of the present application includes: at least one processor 71, at least one communication bus 72, a user interface 73, at least one network interface 74 and a memory 75.

[0142] The communication bus 72 is used to realize the connection and communication between these components.

[0143] The user interface 73 may include a display screen (Display) and a camera (Camera), and the optional user interface 73 may also include a standard wired interface and a wireless interface. The display screen is used to display an editing interface, a roaming interface, and the like.

[0144] The network interface 74 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0145] Among them, the processor 71 may include one or more processing cores. The processor 71 uses various interfaces and lines to connect various parts of the entire electronic device 70, and executes various functions and processes data of the electronic device 70 by running or executing instructions, programs, code sets or instruction sets stored in the memory 75, and calling data stored in the memory 75. Optionally, the processor 71 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 71 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 71, and it can be implemented separately through a chip.

[0146] Among them, the memory 75 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 75 includes a non-transitory computer-readable storage medium. The memory 75 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 75 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 75 may also be optionally at least one storage device located away from the aforementioned processor 71. As Figure 7 As shown, the memory 75 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an operating application of the electronic device.

[0147] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0148] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0149] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0150] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0151] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0152] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0153] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0154] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0155] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A project switching method, It is characterized in that include: The first digital twin of the first project is shown; In response to a user's operation on a twin on the first digital twin world, determining an access address of second project data of a second project associated with the twin, wherein the first project and the second project are different source projects; acquiring the second project data according to the access address of the second project data; The first project data of the first project is overwritten with the second project data to switch from the first project to the second project.

2. The method according to claim 1, It is characterized in that The acquiring the second project data according to the access address of the second project data includes: Using the protocol, port and IP in the access address of the second project data, the protocol, port and IP in the access address of the first project data are replaced to obtain a concatenated access address, wherein the first project data and the second project data are deployed on edge servers in different local area networks; Sending a request to the server according to the spliced ​​access address to request the second project data; A get response is received from the server, where the get response carries the second item data.

3. The method according to claim 1, It is characterized in that The acquiring the second project data according to the access address of the second project data includes: Using the domain name in the access address of the second project data to replace the domain name in the access address of the first project data to obtain a concatenated access address, the first project data and the second project data being deployed on a cloud server; Sending a request to the server according to the spliced ​​access address to request the second project data; A get response is received from the server, where the get response carries the second item data.

4. The method according to claim 2 or 3, It is characterized in that Before sending a request to the server according to the spliced ​​access address to request the second project data, the method further includes: Sending an authentication request to a server according to the spliced ​​access address to request a token; An authentication response is received from the server, wherein the authentication response carries the token.

5. The method according to any one of claims 1 to 3, It is characterized in that The using the second project data to overwrite the first project data of the first project, so as to switch from the first project to the second project, comprises: Clearing the first project data from a GIS execution context of a browser, the browser being the browser running the first project; Filling the second project data into the GIS execution context of the browser; Transforming a view component of the second project into a responsive component, wherein the view component is a visualization component on the second digital twin world; Rendering the second digital twin world according to the responsive component; The first digital twin world is updated to the second digital twin world to switch from the first project to the second project.

6. The method according to any one of claims 1 to 3, It is characterized in that After the first project data of the first project is overwritten by the second project data to switch from the first project to the second project, the method further includes: In response to a user's operation on a return ball on the second digital twin world, determining an access address of first project data of the first project associated with the return ball; acquiring the first project data according to the access address of the first project data; The second project data is overwritten with the first project data to switch from the second project to the first project.

7. The method according to any one of claims 1 to 3, It is characterized in that Before displaying the first digital twin world of the first project, the method further includes: Display the editing interface; Associated items and interactive events are set for the twin on the first digital twin interface through the editing interface.

8. A project switching device, It is characterized in that include: A display module, used for displaying a first digital twin world of a first project; A response module, configured to determine, in response to a user's operation on a twin on the first digital twin world, an access address of second project data of a second project associated with the twin, wherein the first project and the second project are different source projects; A processing module, configured to obtain the second project data according to an access address of the second project data; The switching module is used to overwrite the first project data of the first project with the second project data to switch from the first project to the second project.

9. An electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the electronic device implements the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • An operation right judgment system and method realized by introducing right judgment client end

    CN101217367A

  • Cross-domain communication method and cross-domain communication system

    CN108737331A

  • Digital twin object processing method and system

    CN115563680A

  • Interaction method, device and equipment and readable storage medium

    CN117539368A

  • Browser enabled switching between virtual worlds in artificial reality

    US11755180B1