Communication method and device between micro front-end sub-applications
By defining and deploying custom events in the browser event center, data security and compatibility issues in communication between micro-frontend sub-applications are solved, and safe and compatible data transmission is achieved.
Patent Information
- Application Number
- CN202011578270.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-28
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-12-28
AI Technical Summary
The existing communication methods between micro-frontend applications have data security and compatibility issues. The data transmitted in the browser address bar is easy to be tampered with and the amount of data is limited. The Broadcast Channel has poor compatibility and cannot be widely used.
By defining and deploying custom events in the browser event center, the first sub-application executes the send event to send data to the second sub-application, and the second sub-application executes the receive event to receive the data, ensuring that the data is transmitted in the event center to avoid user tampering and No data length limit.
It realizes safe and compatible large-scale data transmission between sub-applications in the micro front-end system, ensuring the security and applicability of data transmission.
Smart Images

Figure CN114760278B
Abstract
Description
Technical Field
[0001] The present application relates to the field of micro-front-end technology, and in particular to a communication method and device between micro-front-end sub-applications. Background Art
[0002] Micro-Frontends is an architecture similar to backend microservices. Single-Spa is a JavaScript micro-frontend framework that aggregates multiple single-page applications into a whole application. Micro-frontend technology allows multiple front-end frameworks to be used on one page without refreshing the page. In addition, multiple sub-applications on the same page can be developed and deployed independently, reducing the communication cost between members of each sub-application project. In addition, new functions use new frameworks, and old pages do not need to be rewritten and can coexist with new functions.
[0003] At present, there are two main communication methods between multiple sub-applications under the same page. The first method: the sub-application that sends data splices the data on the browser address bar, and the sub-application that receives data monitors the changes in the browser address bar and obtains the data spliced on the browser address bar by the sub-application that sends data. The second method: create a broadcast message channel under the same source page, that is, Broadcast Channel. After the page that sends data sends a message to the channel, the page that receives data can receive and call back to receive the message by monitoring the channel.
[0004] However, if the first method is used for communication between sub-applications, the browser address bar is visible to the user, and the transmitted data is easily tampered with, so important data cannot be transmitted. In addition, each browser has a limit on the address length, so a large amount of data cannot be transmitted. If the second method is used for communication between sub-applications, the second method cannot be widely used in various browsers because the Broadcast Channel is not compatible with various browsers. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a method and device for communication between micro-front-end sub-applications, so that large amounts of data can be securely transmitted between sub-applications of various browsers.
[0006] In order to solve the above technical problems, the embodiments of the present application provide the following technical solutions:
[0007] In a first aspect, the present application provides a communication method between micro-front-end sub-applications, which is applied to a micro-front-end system including a first sub-application, a second sub-application and an event center, and the method includes: the first sub-application reads a sending event from the event center; the first sub-application executes the sending event and sends the data to be transmitted to the second sub-application; the second sub-application reads a receiving event from the event center; the second sub-application executes the receiving event and receives the data to be transmitted sent by the first sub-application.
[0008] In some changed implementation modes of the first aspect of the present application, before the first sub-application reads the sending event from the event center, the method also includes: defining the sending event and the receiving event in the event center; and deploying the sending event and the receiving event in the first sub-application and the second sub-application, respectively.
[0009] In some modified implementations of the first aspect of the present application, after the sending event and the receiving event are respectively deployed in the first sub-application and the second sub-application, the method further includes: determining a location where data is received in the second sub-application; introducing the sending event and the receiving event at the location, and defining a specific name in the sending event and the receiving event;
[0010] The first sub-application reads the sending event from the event center, including: the first sub-application reads the sending event from the event center according to the specific name.
[0011] In some modified implementations of the first aspect of the present application, the first name is fn.
[0012] In some modified implementation modes of the first aspect of the present application, defining the sending event and the receiving event in the event center includes: using a custom event Custom Event to define the sending event and the receiving event in the event center.
[0013] According to a second aspect of the present application, there is provided a communication device between micro-front-end sub-applications, which is applied to a micro-front-end system including a first sub-application, a second sub-application and an event center, and the device includes: a first reading unit, which is used for the first sub-application to read a sending event from the event center; a first execution unit, which is used for the first sub-application to execute the sending event and send the data to be transmitted to the second sub-application; a second reading unit, which is used for the second sub-application to read a receiving event from the event center; and a second execution unit, which is used for the second sub-application to execute the receiving event and receive the data to be transmitted sent by the first sub-application.
[0014] In some modified implementations of the second aspect of the present application, the device also includes: a first definition unit, used to define the sending event and the receiving event in the event center; and deploy the sending event and the receiving event in the first sub-application and the second sub-application, respectively.
[0015] In some modified implementations of the second aspect of the present application, the device further includes: a second definition unit, configured to determine a location where data is received in the second sub-application; introduce the sending event and the receiving event at the location, and define a specific name in the sending event and the receiving event;
[0016] The first reading unit is used for the first sub-application to read the sending event from the event center according to the specific name.
[0017] In some modified implementations of the second aspect of the present application, the first name is fn.
[0018] In some modified implementations of the second aspect of the present application, the first definition unit is used to define the sending event and the receiving event in the event center by using a custom event Custom Event.
[0019] The third aspect of the present application provides an electronic device, which includes: at least one processor; and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; and the processor is used to call program instructions in the memory to execute the method in the first aspect.
[0020] A fourth aspect of the present application provides a computer-readable storage medium, wherein the storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the method in the first aspect.
[0021] Compared with the prior art, the communication method between micro-front-end sub-applications provided in the first aspect of the present application is that the first sub-application obtains the sending event in the browser event center and executes the sending event, and the second sub-application obtains the receiving event in the browser event center and executes the receiving event, so that the data to be transmitted in the first sub-application can be directly transmitted to the second sub-application. Since the first sub-application is implemented by executing the sending event in the process of sending the data to be transmitted to the second sub-application, the data to be transmitted is not visible and cannot be tampered by the user, and the sending event does not limit the length of the data to be transmitted. Therefore, the communication method between micro-front-end sub-applications provided in the embodiment of the present application can ensure that a large amount of data is safely transmitted between each sub-application of the micro-front-end system. In addition, the sending event executed when the first sub-application sends the data to be transmitted and the receiving event executed when the second sub-application receives the data are stored in the event center of the browser, and each browser contains an event center. Therefore, the communication method between micro-front-end sub-applications provided in the embodiment of the present application can also be compatible with various browsers, improving the applicability in the browser.
[0022] The communication device between micro front-end sub-applications provided in the second aspect of the present application, the electronic device provided in the third aspect, and the computer-readable storage medium provided in the fourth aspect have the same beneficial effects as the communication method between micro front-end sub-applications provided in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become easy to understand. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0024] Figure 1 The architecture diagram of the micro frontend system is schematically shown;
[0025] Figure 2 Schematically shows the flow of the communication method between micro front-end sub-applications Figure 1 ;
[0026] Figure 3 Schematically shows the flow of the communication method between micro front-end sub-applications Figure 2 ;
[0027] Figure 4 A schematic diagram of a communication device between micro-front-end sub-applications is shown;
[0028] Figure 5 The structure diagram of an electronic device is schematically shown. DETAILED DESCRIPTION
[0029] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0030] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by technicians in the field to which this application belongs.
[0031] The present application embodiment provides a method and device for communication between micro front-end sub-applications. The method and device for communication between micro front-end sub-applications provided by the present application embodiment can realize communication between sub-applications in a micro front-end system.
[0032] Figure 1 The architecture diagram of the micro front-end system is schematically shown. Figure 1 In the embodiment, the micro front-end system may include: a first sub-application 101, a second sub-application 102, and an event center 103. By defining a sending event and a receiving event in the browser event center 103, the first sub-application 101 and the second sub-application 102 obtain the sending event and the receiving event from the event center 103 respectively. When the first sub-application 101 executes the sending event and the second sub-application 102 executes the receiving event, the first sub-application 101 sends the data to be transmitted to the second sub-application 102.
[0033] In practical applications, sending events and receiving events can exist in the form of sending functions and receiving functions respectively.
[0034] The present application embodiment provides a method for communication between micro front-end sub-applications. Figure 2 Schematically shows the flow of the communication method between micro front-end sub-applications Figure 1 ,exist Figure 2 In, the method may include:
[0035] S201: The first sub-application reads a sending event from the event center.
[0036] S202: The first sub-application executes a sending event to send the data to be transmitted to the second sub-application.
[0037] S203: The second sub-application reads a received event from the event center.
[0038] S204: The second sub-application executes a receiving event to receive the data to be transmitted sent by the first sub-application.
[0039] In the process of communication between sub-applications in the micro-frontend system, since the data to be transmitted is spliced in the address bar of the browser, the data to be transmitted will be visible to the user and easy to be tampered with. In addition, the use of Broadcast Channel to transmit the data to be transmitted cannot be widely used in various browsers. Therefore, a new transmission method is replaced. Specifically, the sending event and receiving event are pre-defined in the event center of the browser. The first sub-application that sends data can obtain the sending event from the event center, and the second sub-application that receives data can obtain the receiving event from the event center. When the first sub-application executes the sending event and the second sub-application executes the receiving event, the data to be transmitted in the first sub-application can be directly sent to the second sub-application. Communication between micro-frontend sub-applications is thereby achieved.
[0040] It should be noted that S201 and S203 can be executed simultaneously, that is, the first sub-application and the second sub-application obtain the sending event and the receiving event from the event center at the same time, respectively, the first sub-application and the second sub-application execute the sending event and the receiving event at the same time, respectively, and after the first sub-application sends the data to be transmitted, the second sub-application can receive the data to be transmitted.
[0041] Of course, S201 and S203 may not be executed at the same time. S201 may be executed first and S203 may be executed later. S203 may also be executed first and S201 may be executed later. The execution order of S201 and S203 is not limited here.
[0042] As can be seen from the above content, the communication method between micro-front-end sub-applications provided in the embodiment of the present application is that the first sub-application obtains the sending event in the browser event center and executes the sending event, and the second sub-application obtains the receiving event in the browser event center and executes the receiving event, so that the data to be transmitted in the first sub-application can be directly transmitted to the second sub-application. Since the first sub-application is implemented by executing the sending event in the process of sending the data to be transmitted to the second sub-application, the data to be transmitted is not visible and cannot be tampered by the user, and the sending event does not limit the length of the data to be transmitted. Therefore, the communication method between micro-front-end sub-applications provided in the embodiment of the present application can ensure that a large amount of data is safely transmitted between the sub-applications of the micro-front-end system. In addition, the sending event executed when the first sub-application sends the data to be transmitted and the receiving event executed when the second sub-application receives the data are stored in the event center of the browser, and each browser contains an event center. Therefore, the communication method between micro-front-end sub-applications provided in the embodiment of the present application can also be compatible with various browsers, improving the applicability in the browser.
[0043] Furthermore, as a Figure 2As a refinement and extension of the method shown, an embodiment of the present application also provides a communication method between micro front-end sub-applications. Figure 3 Schematically shows the flow of the communication method between micro front-end sub-applications Figure 2 ,exist Figure 3 In, the method may include:
[0044] S301: Define sending events and receiving events in the event center.
[0045] Since the first sub-application and the second sub-application need to obtain corresponding events from the browser's event center when sending and receiving data, it is necessary to pre-define an event center class in the browser event center, which is the sending event and the receiving event.
[0046] Specifically, you can use custom events, namely Custom Event, to define sending events and receiving events.
[0047] In actual applications, sending events and receiving events can be defined in any language, as long as the sub-application can perform the corresponding sending action or receiving action after obtaining the sending event and receiving event. The specific language form for defining the sending event and receiving event is not limited here.
[0048] In addition, in addition to using Custom Event to define sending events and receiving events, you can also use Event to define sending events and receiving events. There is no limitation on the specific type of the constructor that defines sending events and receiving events.
[0049] S302: Deploy the sending event and the receiving event in the first sub-application and the second sub-application respectively.
[0050] That is, the send event and receive event in the browser event center are linked to the first sub-application, and the send event and receive event in the browser event center are linked to the second sub-application. In this way, both the first sub-application and the second sub-application can obtain the send event and receive event through the browser event center, and send data to the other party, and receive data sent by the other party.
[0051] After the sending event and the receiving event are deployed in the first sub-application and the second sub-application respectively, in order to enable the first sub-application that sends data to send the data to be transmitted only to the second sub-application that receives data, and to avoid the first sub-application that sends data to send the data to be transmitted to other irrelevant sub-applications, a separate communication bridge can be established between the first sub-application and the second sub-application.
[0052] S303: Determine the location of receiving data in the second sub-application.
[0053] S304: Introduce a sending event and a receiving event at the location where data is received in the second sub-application, and define specific names in the sending event and the receiving event.
[0054] At this time, there will be send events and receive events with the specific name in the browser's event center. That is to say, when the second sub-application needs the first sub-application to send data to it, the second sub-application introduces the deployed send events and receive events at the place where it wants to receive data, and defines the specific name in the introduced send events and receive events. At this time, there will be send events and receive events with the specific name in the browser's event center. In this way, the first sub-application can find the corresponding send event in the browser event center according to the specific name and execute the send event. In this way, the data in the first sub-application will only be sent to the second sub-application, and sent to the place where the second sub-application wants to introduce data.
[0055] In practical applications, the specific name may be fn. Of course, the specific name may also be other names. The specific content of the specific name is not limited here.
[0056] In addition to the second sub-application receiving data defining a specific name in the send event and the receive event, the first sub-application can also define a specific name in the send event and the receive event. Specifically, the first sub-application introduces the send event and the receive event in the browser event where the data is to be transmitted, and defines a specific name in the send event and the receive event. In this way, when the second sub-application needs to receive the data sent by the first sub-application, the second sub-application reads and executes the corresponding receive event in the browser event center according to the specific name.
[0057] S305: Determine the location where data is sent in the first sub-application.
[0058] S306: The first sub-application reads a sending event from the event center according to a specific name, and executes the sending event at the location where the first sub-application sends data.
[0059] At this time, since the deployed sending events and receiving events have been introduced to the place where the second sub-application wants to receive data, when the first sub-application executes the sending event and sends the data to be transmitted, the second sub-application can also execute the receiving event and receive the data sent by the first sub-application to the location where the data needs to be received in the second sub-application.
[0060] As can be seen from the above content, the communication method between micro-front-end sub-applications provided in the embodiment of the present application is to predefine the sending event and receiving event in the browser event center, and deploy the sending event and receiving event in the first sub-application and the second sub-application respectively, and introduce the deployed sending event and receiving event at the location where data needs to be received in the second sub-application, and define a specific name in the sending event and receiving event introduced in the second sub-application. Finally, the first sub-application executes the sending function with a specific name at the location where it needs to receive data, so that the second sub-application can immediately receive the data to be transmitted sent by the first sub-application. Since the first sub-application sends the data to be transmitted to the second sub-application by executing the sending event, the data to be transmitted is not visible and cannot be tampered with by the user, and the sending event does not limit the length of the data to be transmitted. Therefore, the communication method between micro-front-end sub-applications provided in the embodiment of the present application can ensure that a large amount of data is safely transmitted between the sub-applications of the micro-front-end system. In addition, the sending event executed when the first sub-application sends the data to be transmitted and the receiving event executed when the second sub-application receives the data are both stored in the event center of the browser, and each browser includes an event center. Therefore, the communication method between micro-front-end sub-applications provided in the embodiment of the present application can also be compatible with various browsers, thereby improving its applicability in browsers.
[0061] Based on the same inventive concept, as an implementation of the above method, an embodiment of the present application also provides a communication device between micro-front-end sub-applications, which is applied to a micro-front-end system including a first sub-application, a second sub-application and an event center. Figure 4 The structure diagram of the communication device between micro front-end sub-applications is schematically shown. Figure 4 The device may include: a first reading unit 401, used for the first sub-application to read a sending event from the event center; a first execution unit 402, used for the first sub-application to execute the sending event and send the data to be transmitted to the second sub-application; a second reading unit 403, used for the second sub-application to read a receiving event from the event center; a second execution unit 404, used for the second sub-application to execute the receiving event and receive the data to be transmitted sent by the first sub-application.
[0062] Based on the foregoing embodiment, the device further includes: a first definition unit, configured to define the sending event and the receiving event in the event center; and deploy the sending event and the receiving event in the first sub-application and the second sub-application, respectively.
[0063] Based on the above embodiment, the device further includes: a second definition unit, configured to determine a location in the second sub-application where data is received; introduce the sending event and the receiving event at the location, and define a specific name in the sending event and the receiving event;
[0064] The first reading unit is used for the first sub-application to read the sending event from the event center according to the specific name.
[0065] Based on the above embodiment, the first name is fn.
[0066] Based on the above embodiment, the first definition unit is used to define the sending event and the receiving event in the event center by using a custom event Custom Event.
[0067] It should be noted here that the description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0068] The communication device between the micro-front-end sub-applications includes a processor and a memory. The above-mentioned first reading unit, first execution unit, second reading unit, second execution unit, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0069] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and large amounts of data can be safely transmitted between sub-applications of various browsers by adjusting kernel parameters.
[0070] An embodiment of the present application provides a storage medium on which a program is stored. When the program is executed by a processor, the communication method between the micro front-end sub-applications is implemented.
[0071] An embodiment of the present application provides a processor, which is used to run a program, wherein the communication method between the micro front-end sub-applications is executed when the program is run.
[0072] The present application embodiment provides an electronic device, Figure 5 The structure of the electronic device is schematically shown. Figure 5In the embodiment, the electronic device may include: at least one processor 501; and at least one memory 502 and a bus 503 connected to the processor 501; wherein the processor 501 and the memory 502 communicate with each other through the bus 503; the processor 501 is used to call the program instructions in the memory 502 to execute the communication method between the micro front-end sub-applications. The electronic device in this article may be a server, a PC, a PAD, a mobile phone, etc.
[0073] An embodiment of the present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: (defining sending events and receiving events in an event center; deploying sending events and receiving events in a first sub-application and a second sub-application respectively; determining a location for receiving data in the second sub-application; introducing sending events and receiving events at the location for receiving data in the second sub-application, and defining specific names in the sending events and receiving events; determining a location for sending data in the first sub-application; the first sub-application reads the sending event from the event center according to the specific name, and executes the sending event at the location for sending data in the first sub-application).
[0074] 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.
[0075] In a typical configuration, the device includes one or more processors (CPU), memory and bus. The device may also include input / output interface, network interface and the like.
[0076] 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, and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
[0077] 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.
[0078] 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.
[0079] 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 on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0080] 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 communication method between micro front-end sub-applications, characterized in that: Applied to a micro-frontend system including a first sub-application, a second sub-application, and an event center, the method includes: The event center in the browser defines sending events and receiving events. Each browser contains an event center. Deploy the sending event and the receiving event in the first sub-application and the second sub-application respectively; Determine a location in which data is received in the second sub-application; Introducing the sending event and the receiving event at the position, and defining specific names in the sending event and the receiving event; The first sub-application reads the sending event from the event center according to the specific name; The first sub-application executes the sending event to send the data to be transmitted to the second sub-application; The second sub-application reads a reception event from the event center; The second sub-application executes the receiving event to receive the data to be transmitted sent by the first sub-application.
2. The method according to claim 1, characterized in that The specific name is fn.
3. The method according to claim 1, characterized in that Defining the sending event and the receiving event in the event center of the browser includes: The sending event and the receiving event are defined in the event center by using a custom event Custom Event.
4. A communication device between micro front-end sub-applications, characterized in that: Applied to a micro-frontend system including a first sub-application, a second sub-application, and an event center, the device includes: A first definition unit is used to define a sending event and a receiving event in the event center of the browser, each browser includes an event center; and deploy the sending event and the receiving event in the first sub-application and the second sub-application respectively; A second definition unit is used to determine a location in the second sub-application where data is received; introduce the sending event and the receiving event at the location, and define a specific name in the sending event and the receiving event; A first reading unit, configured for the first sub-application to read the sending event from the event center according to the specific name; A first execution unit, configured for the first sub-application to execute the sending event and send the data to be transmitted to the second sub-application; A second reading unit, configured for the second sub-application to read a received event from the event center; A second execution unit is used for the second sub-application to execute the receiving event and receive the data to be transmitted sent by the first sub-application.
5. An electronic device, characterized in that: The electronic device comprises: at least one processor; and at least one memory and bus connected to the processor; The processor and the memory communicate with each other via the bus; the processor is used to call program instructions in the memory to execute the method as claimed in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 3.
